/* ==========================================================================
   Знаки Будут — витрина. Дизайн-система (раздел 6 спеки).
   Светлая тёплая база + тёмная схема. Базовый шрифт 17px (аудитория 45+).
   ========================================================================== */

:root {
  --bg:         #FAF6F0;
  --bg-soft:    #F3ECE2;
  --card:       #FFFFFF;
  --card-2:     #F7F1E9;
  --text:       #2D2440;
  --text-soft:  #6E6580;
  --text-dim:   #9A93A8;
  --accent:     #6B4E9B;
  --accent-2:   #4A3A82;
  --accent-soft:#EFE7F7;
  --gold:       #C9A227;
  --gold-soft:  #F6EED4;
  --danger:     #C6567A;
  --line:       #EBE2D6;
  --grad-banner: linear-gradient(135deg, #6B4E9B 0%, #4A3A82 55%, #372a6b 100%);
  --grad-gold:   linear-gradient(135deg, #C9A227 0%, #E0BE4B 100%);
  --shadow:     0 6px 22px rgba(45, 36, 64, 0.10);
  --shadow-sm:  0 2px 10px rgba(45, 36, 64, 0.07);
  --radius:     18px;
  --radius-sm:  12px;
  --tap:        48px;
  --maxw:       480px;
  color-scheme: light;
}

/* Тёмная схема — по системной теме браузера, если JS не выставил data-theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #1E1930;
    --bg-soft:    #241E38;
    --card:       #2A2342;
    --card-2:     #322A4E;
    --text:       #F3EFFA;
    --text-soft:  #B8AFD0;
    --text-dim:   #857CA0;
    --accent:     #B79BE8;
    --accent-2:   #9D80D6;
    --accent-soft:#33294F;
    --gold:       #E0BE4B;
    --gold-soft:  #3A3218;
    --danger:     #E38AA8;
    --line:       #372E52;
    --shadow:     0 6px 22px rgba(0, 0, 0, 0.35);
    --shadow-sm:  0 2px 10px rgba(0, 0, 0, 0.30);
    color-scheme: dark;
  }
}

/* Тёмная схема — принудительно от Telegram.WebApp.colorScheme */
:root[data-theme="dark"] {
  --bg:         #1E1930;
  --bg-soft:    #241E38;
  --card:       #2A2342;
  --card-2:     #322A4E;
  --text:       #F3EFFA;
  --text-soft:  #B8AFD0;
  --text-dim:   #857CA0;
  --accent:     #B79BE8;
  --accent-2:   #9D80D6;
  --accent-soft:#33294F;
  --gold:       #E0BE4B;
  --gold-soft:  #3A3218;
  --danger:     #E38AA8;
  --line:       #372E52;
  --shadow:     0 6px 22px rgba(0, 0, 0, 0.35);
  --shadow-sm:  0 2px 10px rgba(0, 0, 0, 0.30);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* -------------------------------------------------------------------------- */
/* Каркас                                                                     */
/* -------------------------------------------------------------------------- */

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

.screen {
  padding: 20px 18px calc(96px + env(safe-area-inset-bottom, 0px));
  animation: screen-in 0.32s ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { transition: none !important; }
}

.section-title {
  font-size: 21px;
  font-weight: 700;
  margin: 26px 2px 12px;
  letter-spacing: -0.2px;
}
.section-sub { color: var(--text-soft); font-size: 15px; margin: -6px 2px 12px; }

/* -------------------------------------------------------------------------- */
/* Шапка + октаграмма                                                         */
/* -------------------------------------------------------------------------- */

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 8px;
}
.hero__text h1 {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.hero__text p { color: var(--text-soft); font-size: 15px; margin-top: 2px; }

.octagram {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  filter: drop-shadow(0 3px 8px rgba(107, 78, 155, 0.28));
  animation: spin-slow 60s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .octagram { animation: none; } }
.octagram--lg { width: 130px; height: 130px; }

/* -------------------------------------------------------------------------- */
/* Универсальная карточка                                                     */
/* -------------------------------------------------------------------------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

/* Карточка баланса */
.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent-soft), var(--card));
  border: 1px solid var(--line);
}
.balance-card__num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--accent); }
.balance-card__txt { font-size: 15px; color: var(--text-soft); margin-top: 4px; }
.balance-card--empty {
  background: linear-gradient(135deg, #F6E4EA, var(--card));
  border-color: #EAC7D3;
}
:root[data-theme="dark"] .balance-card--empty,
:root:not([data-theme="light"]) .balance-card--empty {
  background: linear-gradient(135deg, #3A2438, var(--card));
  border-color: #5A3550;
}
.balance-card--empty .balance-card__num { color: var(--danger); }

.btn-pill {
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn-pill:active { transform: scale(0.96); filter: brightness(1.06); }

/* -------------------------------------------------------------------------- */
/* Акция-баннер + countdown                                                   */
/* -------------------------------------------------------------------------- */

.promos { margin-top: 20px; }
.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--grad-banner);
  color: #fff;
  padding: 20px 18px;
  box-shadow: var(--shadow);
}
.banner + .banner { margin-top: 12px; }
.banner::after {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 68%);
}
.banner__badge {
  display: inline-block;
  background: var(--grad-gold);
  color: #3a2c05;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.banner__title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; position: relative; }
.banner__sub { font-size: 15px; opacity: 0.9; margin-top: 4px; position: relative; }
.banner__pricing { margin-top: 10px; font-size: 15px; }
.banner__old { text-decoration: line-through; opacity: 0.7; margin-right: 8px; }
.banner__new { font-weight: 800; font-size: 19px; }

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  background: rgba(0,0,0,0.22);
  border-radius: 999px;
  padding: 7px 14px;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.countdown__dot { animation: pulse 1.6s ease-in-out infinite; }
.countdown__time { font-weight: 800; font-size: 17px; letter-spacing: 0.5px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.banner__cta {
  margin-top: 14px;
  min-height: var(--tap);
  width: 100%;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--accent-2);
  font-weight: 800;
  font-size: 16px;
  position: relative;
  transition: transform 0.12s ease;
  animation: cta-pulse 2.4s ease-in-out infinite;
}
.banner__cta:active { transform: scale(0.97); }
@keyframes cta-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.0); }
  50%     { box-shadow: 0 0 0 6px rgba(255,255,255,0.16); }
}
@media (prefers-reduced-motion: reduce) {
  .banner__cta, .countdown__dot { animation: none; }
}

/* -------------------------------------------------------------------------- */
/* Витрина продуктов                                                          */
/* -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 359px) { .grid { grid-template-columns: 1fr; } }

.product {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  text-align: left;
  min-height: 190px;
  position: relative;
  border: 1px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.product:active { transform: translateY(2px); box-shadow: var(--shadow-sm); }
.product:hover { border-color: var(--line); box-shadow: var(--shadow); }
.product__emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.product__title { font-size: 17px; font-weight: 700; }
.product__hook { font-size: 14px; color: var(--text-soft); margin-top: 5px; flex: 1; }
.product__foot { margin-top: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.product__price { font-size: 18px; font-weight: 800; color: var(--accent); }
.product__price--old { font-size: 14px; font-weight: 600; color: var(--text-dim); text-decoration: line-through; }

.badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge--sale { background: var(--danger); color: #fff; }
.badge--hit  { background: var(--grad-gold); color: #3a2c05; }
.badge--inline {
  position: static;
  display: inline-block;
}

/* -------------------------------------------------------------------------- */
/* Карточка подписки (золотой якорь)                                          */
/* -------------------------------------------------------------------------- */

.subscribe {
  margin-top: 14px;
  border-radius: var(--radius);
  padding: 22px 20px;
  background: linear-gradient(160deg, var(--gold-soft), var(--card) 70%);
  border: 1.5px solid var(--gold);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.subscribe__crown { font-size: 26px; }
.subscribe__title { font-size: 21px; font-weight: 800; margin-top: 4px; }
.subscribe__benefits { margin: 14px 0 4px; display: grid; gap: 9px; }
.subscribe__benefits li { display: flex; gap: 9px; align-items: flex-start; font-size: 15.5px; }
.subscribe__benefits .tick { color: var(--gold); font-weight: 900; flex: 0 0 auto; }
.subscribe__price { margin-top: 14px; font-size: 15px; color: var(--text-soft); }
.subscribe__price b { font-size: 22px; color: var(--text); font-weight: 800; }
.subscribe__cta {
  margin-top: 14px;
  width: 100%;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  background: var(--grad-gold);
  color: #3a2c05;
  font-weight: 800;
  font-size: 16px;
  transition: transform 0.12s ease;
}
.subscribe__cta:active { transform: scale(0.98); }
.subscribe--active {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--accent-soft), var(--card) 70%);
}

/* -------------------------------------------------------------------------- */
/* Мои отчёты — горизонтальный скролл                                         */
/* -------------------------------------------------------------------------- */

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.report-card {
  flex: 0 0 78%;
  max-width: 300px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 130px;
}
.report-card--locked {
  background: var(--card-2);
  border: 1.5px dashed var(--line);
  box-shadow: none;
  color: var(--text-soft);
}
.report-card__emoji { font-size: 24px; }
.report-card__title { font-weight: 700; font-size: 16px; }
.report-card__date { font-size: 13px; color: var(--text-dim); }
.report-card__hint { font-size: 13px; color: var(--text-dim); margin-top: auto; }

/* Список отчётов на экране #reports */
.report-list { display: grid; gap: 12px; margin-top: 8px; }
.report-list .report-card { flex: none; max-width: none; width: 100%; }

/* -------------------------------------------------------------------------- */
/* Детальная карточка продукта                                                */
/* -------------------------------------------------------------------------- */

.detail__emoji { font-size: 54px; text-align: center; margin: 6px 0 4px; }
.detail__title { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: -0.3px; }
.detail__hook { font-size: 17px; color: var(--text-soft); text-align: center; margin-top: 6px; }
.detail__block-title { font-size: 15px; font-weight: 700; color: var(--text-soft); margin: 22px 2px 10px; text-transform: uppercase; letter-spacing: 0.6px; }
.outcome { display: grid; gap: 11px; }
.outcome li { display: flex; gap: 11px; align-items: flex-start; font-size: 16.5px; }
.outcome .tick {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px;
}

.testimonial {
  margin-top: 22px;
  background: var(--card-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.testimonial p { font-size: 15.5px; font-style: italic; }
.testimonial cite { display: block; margin-top: 8px; font-size: 14px; color: var(--text-soft); font-style: normal; }

.price-row { margin-top: 22px; display: flex; align-items: baseline; gap: 10px; }
.price-row .now { font-size: 28px; font-weight: 800; color: var(--accent); }
.price-row .was { font-size: 17px; color: var(--text-dim); text-decoration: line-through; }

/* -------------------------------------------------------------------------- */
/* Баланс-экран                                                               */
/* -------------------------------------------------------------------------- */

.balance-hero { text-align: center; padding: 14px 0 6px; }
.balance-hero__num { font-size: 58px; font-weight: 800; color: var(--accent); line-height: 1; }
.balance-hero__cap { font-size: 16px; color: var(--text-soft); margin-top: 6px; }

.packages { display: grid; gap: 12px; margin-top: 18px; }
.package {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.package:active { transform: scale(0.99); }
.package--best { border-color: var(--gold); background: linear-gradient(120deg, var(--gold-soft), var(--card) 60%); }
.package__q { font-size: 19px; font-weight: 800; }
.package__bonus { font-size: 14px; color: var(--gold); font-weight: 700; margin-top: 2px; }
.package__price { font-size: 19px; font-weight: 800; color: var(--accent); white-space: nowrap; }

.note { font-size: 14.5px; color: var(--text-soft); text-align: center; margin-top: 14px; }

.bridge {
  margin-top: 18px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
}
.bridge p { font-size: 15.5px; }
.bridge b { color: var(--accent); }
.bridge__cta {
  margin-top: 10px;
  min-height: var(--tap);
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.demo-ask {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  text-align: center;
}
.demo-ask__cap { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.demo-ask__btn {
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  background: transparent;
}
.demo-ask__btn:disabled { opacity: 0.4; }

/* -------------------------------------------------------------------------- */
/* Оплата-мок + успех                                                         */
/* -------------------------------------------------------------------------- */

.summary {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.summary__what { font-weight: 700; font-size: 17px; }
.summary__desc { font-size: 14px; color: var(--text-soft); margin-top: 3px; }
.summary__price { font-size: 22px; font-weight: 800; color: var(--accent); white-space: nowrap; }

.pay-methods { display: grid; gap: 10px; margin-top: 18px; }
.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--card);
  text-align: left;
  font-size: 16px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.pay-method[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pay-method__radio {
  width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: grid; place-items: center;
}
.pay-method[aria-pressed="true"] .pay-method__radio { border-color: var(--accent); }
.pay-method[aria-pressed="true"] .pay-method__radio::after {
  content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
}
.pay-method__label { flex: 1; }
.pay-method__tag { font-size: 12px; color: var(--text-dim); }
.pay-method--star { border-color: var(--gold); }

.proto-note {
  margin-top: 16px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-soft);
  text-align: center;
}

/* Липкая нижняя кнопка действия */
.action-bar {
  position: sticky;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  margin-top: 22px;
  z-index: 5;
}
.action-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.action-btn:active { transform: scale(0.98); filter: brightness(1.05); }
.action-btn--gold { background: var(--grad-gold); color: #3a2c05; }

/* Экран успеха */
.success { text-align: center; padding: 40px 10px; }
.success__confetti { font-size: 56px; animation: pop 0.5s ease both; }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.success__title { font-size: 24px; font-weight: 800; margin-top: 12px; }
.success__text { font-size: 16px; color: var(--text-soft); margin-top: 8px; }
.success__proto {
  display: inline-block;
  margin-top: 18px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--text-soft);
}

/* -------------------------------------------------------------------------- */
/* Мок-превью отчёта                                                          */
/* -------------------------------------------------------------------------- */

.report-preview { text-align: center; }
.report-preview__octa { margin: 6px auto 10px; }
.report-preview__title { font-size: 24px; font-weight: 800; }
.report-preview__date { font-size: 14px; color: var(--text-dim); margin-top: 4px; }
.report-preview__body { text-align: left; margin-top: 20px; display: grid; gap: 14px; }
.report-preview__body h3 { font-size: 18px; font-weight: 700; }
.report-preview__body p { font-size: 16px; color: var(--text); line-height: 1.6; }
.report-preview__ph { font-size: 12.5px; color: var(--text-dim); text-align: center; margin-top: 8px; }

/* -------------------------------------------------------------------------- */
/* Заголовок экрана с кнопкой назад                                           */
/* -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 8px;
  min-height: var(--tap);
}
.topbar__back {
  width: var(--tap); height: var(--tap);
  margin-left: -10px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px;
  color: var(--accent);
  transition: background 0.12s ease;
}
.topbar__back:active { background: var(--accent-soft); }
.topbar__title { font-size: 19px; font-weight: 700; }

/* -------------------------------------------------------------------------- */
/* Нижняя навигация                                                           */
/* -------------------------------------------------------------------------- */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(45,36,64,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 20;
}
.tabbar__item {
  flex: 1;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim);
  transition: color 0.12s ease;
}
.tabbar__item[aria-current="page"] { color: var(--accent); }
.tabbar__icon { font-size: 21px; line-height: 1; }
.tabbar__label { font-size: 12px; font-weight: 600; }

/* -------------------------------------------------------------------------- */
/* Утилиты                                                                     */
/* -------------------------------------------------------------------------- */

.spacer-lg { height: 8px; }
.center { text-align: center; }
.loading { text-align: center; color: var(--text-soft); padding: 60px 0; }
