/* ============================================
   FONTS
============================================ */
@font-face {
  font-family: "Coolvetica";
  src: url("/static/fonts/Coolvetica-Rg.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Coolvetica";
  src: url("/static/fonts/Coolvetica-Rg-It.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "SuisseIntl";
  src: url("/static/fonts/SuisseIntl-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SuisseIntl";
  src: url("/static/fonts/SuisseIntl-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SuisseIntl";
  src: url("/static/fonts/SuisseIntl-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   ТОКЕНЫ
============================================ */
:root {
  /* Палитра: тёплый off-white + графит + ультрамарин */
  --bg:           #F6F3EE;
  --bg-elevated: #FBFAF6;
  --bg-tint:     #EFEBE3;
  --ink:         #15140F;
  --ink-soft:    #4A4842;
  --ink-mute:    #8A857A;
  --line:        #E5E0D6;
  --line-strong: #C8C2B3;
  --accent:      #2A3FBF;
  --accent-soft: #E8EAFC;
  --accent-ink:  #0F1E7A;
  --warn:        #B8541E;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;

  --shadow-card: 0 1px 0 rgba(21, 20, 15, 0.04),
                 0 8px 24px -12px rgba(21, 20, 15, 0.10);
  --shadow-pop:  0 24px 60px -20px rgba(21, 20, 15, 0.25);

  --font-display: "Coolvetica", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "SuisseIntl", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Лёгкая «бумажная» текстура */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(42, 63, 191, 0.04), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(184, 84, 30, 0.03), transparent 60%);
  background-attachment: fixed;
}

button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

.app { min-height: 100vh; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
.screen { padding: 24px 20px 32px; max-width: 560px; margin: 0 auto; }
[hidden] { display: none !important; }

/* ============================================
   HOME — ГЛАВНЫЙ ЭКРАН
============================================ */
.hero {
  padding: 28px 0 36px;
  position: relative;
}
.hero__eyebrow {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 16vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0 0 22px;
  color: var(--ink);
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  text-transform: none;
  letter-spacing: -0.02em;
}
.hero__lede {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 32ch;
  margin: 0;
}

/* Список услуг */
.services {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.service {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.service[data-status="active"] { cursor: pointer; }
.service[data-status="active"]:hover,
.service[data-status="active"]:active {
  border-color: var(--ink);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.service[data-status="soon"] { opacity: 0.62; }
.service__index {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: var(--ink-mute);
  min-width: 28px;
}
.service__body { min-width: 0; }
.service__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--ink);
}
.service__from {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}
.service__badge {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  padding: 5px 9px;
  background: var(--bg-tint);
  border-radius: 999px;
}
.service__arrow {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent);
  transition: transform .2s ease;
}
.service[data-status="active"]:hover .service__arrow { transform: translateX(3px); }
.service--active {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
}

/* ============================================
   FLOW — ЭКРАН ВОПРОСОВ
============================================ */
.flow__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 18px;
}
.back-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background .15s, border-color .15s;
}
.back-btn:hover { background: var(--bg-tint); }
.flow__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.flow__service {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.05;
  text-transform: uppercase;
}
.flow__progress {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

.progress {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0 28px;
}
.progress__bar {
  height: 100%;
  background: var(--ink);
  width: 0%;
  transition: width .35s cubic-bezier(.65,.05,.3,1);
}

.flow__body { padding-bottom: 24px; min-height: 320px; }

.q {
  animation: q-in .4s cubic-bezier(.2,.65,.3,1);
}
@keyframes q-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.q__eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 6px;
}
.q__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.q__title .help-trigger {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}
.q__hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

/* Карточки выбора */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color .15s, background .15s, transform .1s;
}
.option:active { transform: scale(0.995); }
.option:hover { border-color: var(--line-strong); }
.option--selected {
  border-color: var(--ink);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(21, 20, 15, 0.04);
}
.option__radio {
  width: 22px; height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s;
}
.option--selected .option__radio { border-color: var(--ink); }
.option--selected .option__radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--ink);
  border-radius: 50%;
}
.option__main { min-width: 0; }
.option__title {
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 2px;
  line-height: 1.3;
}
.option__sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}
.option__price {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
}
.option .help-trigger { margin-left: -6px; }

.help-trigger {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.help-trigger:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* Поля ввода */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.input, .textarea {
  width: 100%;
  padding: 16px 16px;
  font-size: 17px;
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 20, 15, 0.04);
}
.input--lg {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  padding: 18px 20px;
}
.input__unit {
  font-family: var(--font-body);
  font-style: normal;
  color: var(--ink-mute);
  font-size: 15px;
  font-weight: 400;
}
.field__hint {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* Чипсы (форматы / каты) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
}
.chip__remove {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink-mute);
  color: var(--bg-elevated);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Подвал с кнопками */
.flow__foot {
  display: flex;
  gap: 10px;
  padding: 16px 0 6px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}
.flow__foot .btn { flex: 1; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 22px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s, transform .1s, opacity .15s;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: var(--ink);
  color: var(--bg);
}
.btn--primary:hover:not(:disabled) { background: #000; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--bg-tint); }

/* ============================================
   TOTAL — ИТОГ
============================================ */
.total__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 24px;
}
.total__eyebrow {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
}
.total__amount {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.total__label {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.total__value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 16vw, 80px);
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.total__vat {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}
.total__vat em {
  font-family: var(--font-body);
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}

.total__items {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.line--head {
  border-bottom: none;
  padding: 4px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.line__head-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin: 0;
}
.line__head-meta {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}
.line--subtotal {
  border-bottom: none;
  border-top: 1px solid var(--ink);
  padding: 14px 0 4px;
  font-weight: 500;
}
.line--subtotal .line__title {
  font-weight: 500;
  font-size: 14px;
  margin: 0;
}
.line--subtotal .line__amount {
  font-size: 16px;
}
.line__title {
  font-weight: 500;
  font-size: 15px;
  margin: 0 0 2px;
}
.line__detail {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}
.line__amount {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.line__est { color: var(--warn); }

.total__note {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 18px 0 0;
}
.total__note span { color: var(--warn); font-weight: 600; }

.total__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
}

/* ============================================
   MODAL
============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 20, 15, 0.45);
  backdrop-filter: blur(2px);
  animation: fade-in .25s ease;
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 22px calc(22px + var(--safe-bottom));
  box-shadow: var(--shadow-pop);
  animation: slide-up .3s cubic-bezier(.2,.65,.3,1);
}
.modal__card::before {
  content: "";
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 4px;
  background: var(--line-strong);
  border-radius: 2px;
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  margin: 10px 0 12px;
}
.modal__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.modal__body ul { padding-left: 18px; margin: 8px 0; }
.modal__body li { margin-bottom: 4px; }
.modal__body strong { color: var(--ink); }
.modal__actions {
  display: flex;
  gap: 10px;
}
.modal__actions .btn { flex: 1; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Desktop modal centering */
@media (min-height: 640px) and (min-width: 600px) {
  .modal { align-items: center; }
  .modal__card { border-radius: var(--radius-lg); max-width: 460px; padding: 28px 26px; }
  .modal__card::before { display: none; }
}

/* Telegram dark mode override — приложение остаётся светлым по ТЗ */
html { color-scheme: light; }
