/* ============================================================
   AI-Астролог — светлая мистическая тема.
   Тёплый кремовый фон, глубокий индиго-текст, золото и фиолетовый
   акценты, мягкие тени и градиенты. Заголовки — Playfair Display,
   текст — Inter (оба с кириллицей). Звёздные акценты золотом.
   ============================================================ */

:root {
  /* Surfaces */
  --cream: #f7f2ea;        /* page background */
  --paper: #ffffff;        /* cards */
  --paper-2: #fbf7f1;      /* inputs / soft fills */
  --paper-gold: #fffdf6;   /* featured tint */

  /* Text */
  --ink: #2b2450;          /* headings, primary text (deep indigo) */
  --ink-2: #6a6388;        /* muted / secondary */
  --ink-3: #948da8;        /* faint */

  /* Accents */
  --gold: #b9954e;
  --gold-2: #c8a55e;
  --violet: #7a66bd;
  --blush: #d7a0aa;
  --line: #ece3d5;         /* borders / dividers */
  --line-2: #e2d8c8;

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Radius */
  --r-card: 16px;
  --r-input: 10px;
  --r-pill: 999px;

  /* Effects */
  --shadow: 0 14px 40px rgba(43,36,80,0.08);
  --shadow-sm: 0 6px 18px rgba(43,36,80,0.06);

  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; font-weight: 700; }
h2 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; }
h3 { font-size: 21px; line-height: 1.25; }
p { margin: 0 0 14px; }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--ink); }

.eyebrow {
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
  display: inline-block; margin-bottom: 16px;
}
.eyebrow .star, .star { color: var(--gold); }
.lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 48ch; }
.muted { color: var(--ink-2); }
.fog { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.ember, .gold { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 12px 26px; border-radius: var(--r-pill); border: 1px solid transparent;
  cursor: pointer; transition: transform .12s, background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap; line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
/* Primary — deep indigo */
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #3a3168; color: #fff; }
/* Gold — premium / featured purchase */
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #fff; box-shadow: 0 8px 22px rgba(185,149,78,0.30); }
.btn-gold:hover { filter: brightness(1.05); color: #fff; }
/* Ghost — outline */
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }
/* Telegram-flavoured */
.btn-tg { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-tg:hover { border-color: var(--violet); color: var(--violet); }
/* Text link button */
.btn-link { background: none; border: none; color: var(--ink-2); cursor: pointer; font: inherit; font-weight: 600; padding: 0; }
.btn-link:hover { color: var(--ink); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- Header / nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,242,234,0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 23px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand .star { color: var(--gold); font-size: 17px; }
.nav-links { display: flex; gap: 24px; margin-left: 20px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-cta > a:not(.btn), .nav-cta form .btn-link { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav-cta > a:not(.btn):hover { color: var(--ink); }
.nav-user { font-size: 13px; color: var(--ink-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 22px; cursor: pointer; }
@media (max-width: 880px) { .nav-user { display: none; } }

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.section.tight { padding: 60px 0; }
.section.alt { background: linear-gradient(180deg, #f3ece1, #f7f2ea); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { margin-bottom: 14px; }
.section-head p { color: var(--ink-2); font-size: 17px; }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 76px 0 86px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 50% at 82% 8%, rgba(215,160,170,0.30), transparent 70%),
    radial-gradient(55% 55% at 8% 92%, rgba(122,102,189,0.20), transparent 70%),
    radial-gradient(40% 40% at 95% 95%, rgba(185,149,78,0.14), transparent 70%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 24px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.badge {
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-pill);
  padding: 7px 14px; box-shadow: var(--shadow-sm);
}
.badge .star { color: var(--gold); }
.hero-tg { margin-top: 22px; font-size: 14px; color: var(--ink-2); }
.hero-tg a { color: var(--violet); font-weight: 600; }
.hero-tg a:hover { color: var(--ink); }

/* ---------- Cards / forms ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; box-shadow: var(--shadow); }
.form-card h3 { font-size: 22px; margin-bottom: 6px; }
.form-card .sub { color: var(--ink-2); font-size: 13px; margin-bottom: 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 7px; }
.field input {
  width: 100%; background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-input);
  padding: 12px 14px; font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(122,102,189,0.14); }
.field input::placeholder { color: var(--ink-3); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check input { margin-top: 3px; accent-color: var(--violet); }
.check a { color: var(--violet); }
.hint { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }
.hint a { color: var(--violet); font-weight: 600; }
.divider { text-align: center; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; margin: 18px 0 14px; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--r-input); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: #fbeceb; border-color: #e7b7b2; color: #9a3b34; }
.alert-ok { background: #f0f4ec; border-color: #c9d8bd; color: #4d6638; }

/* ---------- Grids / steps / features ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-num, .feat-num { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--gold); text-transform: uppercase; margin-bottom: 10px; }
.card .ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 16px;
  font-family: var(--font-display); font-size: 23px; line-height: 1; color: var(--gold);
  background: radial-gradient(circle at 30% 25%, #fbf1da, #f3e6c7);
  border: 1px solid #e8d9b8; border-radius: 50%;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }

/* problem / solution split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; box-shadow: var(--shadow-sm); }
.panel h3 { margin-bottom: 14px; }
.panel ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.panel li { margin-bottom: 8px; }
.panel.bad { opacity: 0.85; background: var(--paper-2); }
.panel.bad h3 { color: var(--ink-2); }
.panel.good { border-color: var(--gold-soft, #e8d9b8); box-shadow: var(--shadow); }

/* ---------- Pricing ---------- */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 30px 26px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.price.featured { border-color: var(--gold); background: var(--paper-gold); box-shadow: 0 18px 44px rgba(185,149,78,0.16); }
.price .tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-radius: var(--r-pill); padding: 5px 12px; margin-bottom: 14px; }
.price h3 { font-size: 22px; margin-bottom: 8px; }
.amount { font-family: var(--font-display); font-weight: 700; font-size: 40px; color: var(--ink); margin-bottom: 18px; }
.amount small { font-size: 14px; color: var(--ink-2); font-weight: 400; font-family: var(--font-body); }
.price ul { list-style: none; margin: 0 0 24px; padding: 0; flex: 1; }
.price li { color: var(--ink-2); font-size: 14px; padding: 8px 0 8px 24px; position: relative; border-top: 1px solid var(--line); }
.price li:first-child { border-top: 0; }
.price li::before { content: "✦"; color: var(--gold); position: absolute; left: 0; font-size: 12px; top: 10px; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { color: var(--ink-2); font-size: 15px; padding: 0 0 20px; max-width: 72ch; }
.faq details > div a { color: var(--violet); font-weight: 600; }

/* ---------- Contact / CTA band ---------- */
.contact-card { text-align: center; max-width: 660px; margin: 0 auto; }
.cta-band { text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 58px 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 80% at 50% 0%, rgba(122,102,189,0.10), transparent 70%); }
.cta-band > * { position: relative; }
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { color: var(--ink-2); margin-bottom: 24px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 20px; background: #f3ece1; }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer, .footer a { color: var(--ink-2); font-size: 13px; }
.footer a:hover { color: var(--ink); }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 440px; margin: 64px auto; }
.auth-wrap h1 { text-align: center; font-size: 36px; margin-bottom: 8px; }

/* ---------- Cabinet / result ---------- */
.page-head { padding: 40px 0 6px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.wheel-card .svg-wrap { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-input); padding: 12px; cursor: zoom-in; }
.wheel-card svg { width: 100%; height: auto; display: block; }
.wheel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.upsell { margin-top: 22px; background: var(--paper-gold); border: 1px solid var(--gold); border-radius: var(--r-card); padding: 30px; box-shadow: var(--shadow); }
.upsell h3 { margin-bottom: 8px; }
.upsell p { color: var(--ink-2); margin-bottom: 18px; }
.upsell .cta-actions { justify-content: flex-start; }
.access-ok { background: #f0f4ec; border-color: #bcd0aa; }

/* ---------- Loading / failed state ---------- */
.loading-card {
  margin-top: 24px; text-align: center; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 56px 28px; box-shadow: var(--shadow);
}
.loading-card h3 { margin: 22px 0 8px; font-size: 24px; }
.loading-card p { color: var(--ink-2); max-width: 52ch; margin: 0 auto; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
.fail-mark { font-size: 40px; color: var(--gold); line-height: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Rich AI text */
.rich { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.rich b { color: var(--ink); font-weight: 600; }
.rich p { margin: 0 0 12px; }

/* ---------- Lightbox ---------- */
.lightbox { display: none; position: fixed; inset: 0; z-index: 80; background: rgba(43,36,80,0.78); backdrop-filter: blur(4px); }
.lightbox.open { display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox .lb-body { max-width: 92vw; max-height: 92vh; background: var(--paper); border-radius: var(--r-card); padding: 12px; }
.lightbox .lb-body svg { max-width: 88vw; max-height: 88vh; width: auto; height: auto; }
.lightbox .close { position: absolute; top: 18px; right: 24px; background: none; border: none; color: #fff; font-size: 34px; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .grid-3, .prices { grid-template-columns: 1fr; }
  .grid-2, .split, .result-grid, .row-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 66px; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--line); padding: 16px 24px; gap: 14px; margin: 0; }
  .nav-toggle { display: block; }
  .section { padding: 64px 0; }
}
