@font-face {
  font-family: "Onest";
  src: url("/assets/onest-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Onest";
  src: url("/assets/onest-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d1014;
  --panel: #15191e;
  --panel-2: #1c2127;
  --line: rgba(255, 255, 255, .09);
  --cream: #fbf7ed;
  --muted: #90979f;
  --coral: #ff5a45;
  --pink: #ff6f9d;
  --success: #66d69e;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 7%, rgba(255, 90, 69, .12), transparent 30%),
    var(--bg);
  color: var(--cream);
  font-family: "Onest", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(22px + var(--safe-bottom));
  background: rgba(13, 16, 20, .82);
}

.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 20, .84);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.bot-avatar {
  width: 44px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
}

.bot-avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.bot-title strong {
  display: block;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.bot-title em {
  color: var(--coral);
  font-style: normal;
}

.bot-title span {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.bot-title i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(102, 214, 158, .12);
}

.secure {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.secure svg {
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.progress-wrap { padding: 15px 16px 5px; }

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.progress-copy b { color: var(--coral); }

.progress-track {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--pink));
  transition: width .35s ease;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 270px;
  padding: 22px 16px 12px;
}

.message {
  width: fit-content;
  max-width: min(86%, 500px);
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  animation: message-in .22s ease both;
}

.message.bot {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  background: var(--panel-2);
}

.message.user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, #ff5b43, #fa487b);
  color: #fff;
  font-weight: 650;
}

.message small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.message strong { font-weight: 850; }

.message .price {
  color: #ff806e;
  font-weight: 900;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 16px 14px;
}

.answer-btn {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  background: var(--panel);
  color: var(--cream);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.answer-btn:active { transform: scale(.98); }

.answer-btn:disabled {
  cursor: not-allowed;
  opacity: .42;
  filter: saturate(.45);
}

.answer-btn.selected {
  border-color: var(--coral);
  background: rgba(255, 90, 69, .12);
}

.answer-btn.primary {
  grid-column: 1 / -1;
  text-align: center;
  background: linear-gradient(135deg, var(--coral), #f94b76);
  color: #fff;
  border-color: transparent;
}

.answer-btn.secondary {
  grid-column: 1 / -1;
  text-align: center;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  padding: 8px 16px 14px;
}

.composer[hidden] { display: none; }

.composer input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--panel);
  color: var(--cream);
}

.composer input:focus { border-color: rgba(255, 90, 69, .65); }

.composer button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--coral);
}

.composer button svg {
  width: 22px;
  fill: none;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.summary {
  width: 100%;
  margin-top: 2px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #11151a;
}

.summary h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.summary dl {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 11px;
}

.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 650; }

.consent {
  display: flex;
  grid-column: 1 / -1;
  gap: 9px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.consent input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--coral);
}

.privacy-note {
  margin: 2px 16px 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  color: #777f88;
  font-size: 10px;
  line-height: 1.45;
}

.form-error {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 90, 69, .4);
  border-radius: 12px;
  background: rgba(255, 90, 69, .1);
  color: #ff9b8d;
  font-size: 11px;
  line-height: 1.4;
}

.form-error[hidden] { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 390px) {
  .answers { grid-template-columns: 1fr; }
  .answer-btn.primary,
  .answer-btn.secondary,
  .consent { grid-column: 1; }
  .message { max-width: 91%; }
}

@media (min-width: 681px) {
  body { padding: 24px 0; }
  .app-shell {
    min-height: calc(100dvh - 48px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 32px 90px rgba(0, 0, 0, .42);
  }
  .app-header { border-radius: 26px 26px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
