:root {
  color-scheme: light;
  --bg: #f4f7fc;
  --panel: #ffffff;
  --text: #10224f;
  --muted: #607194;
  --primary: #2a74ea;
  --primary-dark: #184fb0;
  --line: #dbe5f5;
  --soft: #edf3fc;
  --ok: #178a63;
  --danger: #c53b57;
  --shadow: 0 16px 48px rgba(20, 52, 110, .055);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 95% 0, #dfe8fb, transparent 42%),
    radial-gradient(ellipse at 0 45%, #ececf8, transparent 42%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: var(--primary-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #6797df; outline-offset: 4px; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.17; }
h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: clamp(27px, 3.3vw, 39px); letter-spacing: -.035em; font-weight: 750; }
h3 { font-size: 20px; letter-spacing: -.02em; }
p:last-child { margin-bottom: 0; }

.shell {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 12px;
  background: #fff;
}
.skip:focus { top: 16px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid #ffffff30;
  border-radius: 16px;
  background: linear-gradient(145deg, #326fca, #142c58);
  color: #fff;
  font: italic 28px Georgia, serif;
  box-shadow: 0 8px 22px #17366920;
}

.brand-name { display: block; font-size: 20px; font-weight: 750; letter-spacing: -.6px; }
.brand-sub { display: block; color: var(--muted); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }

.actions, .top-actions, .links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn, .link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}

.btn.primary, .submit-btn, .pack-btn {
  border-color: transparent;
  background: linear-gradient(135deg, #2f86fb, #1f66d8);
  color: #fff;
  box-shadow: 0 8px 22px #2a74ea20;
}

.btn.ghost { background: transparent; }
.btn.light { background: #e6efff; color: #173a70; border-color: transparent; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.muted, .subtitle { color: var(--muted); }
.lead { font-size: 18px; color: var(--muted); line-height: 1.75; }
.fine { font-size: 12px; color: var(--muted); line-height: 1.75; }
.small { font-size: 14px; }
.section { padding-top: 68px; }
.section-head { max-width: 780px; margin-bottom: 26px; }
.section-head h2 { margin-bottom: 16px; }
.section-head p:last-child { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card, .panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card p { color: var(--muted); font-size: 14px; }
.card h3 { margin-bottom: 12px; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer a { text-decoration: none; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 40px;
  padding: 52px 0 42px;
}
.home-hero h1 { margin-bottom: 24px; }
.home-hero h1 em { color: #315d9a; font-family: Georgia, serif; font-weight: 400; }
.home-hero .actions { margin-top: 26px; }
.hero-note { margin: 15px 0 0; font-size: 12px; color: var(--muted); }

.ecosystem-map {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid #2f4870;
  border-radius: 28px;
  background: linear-gradient(145deg, #234775, #111f3b);
  color: #fff;
  box-shadow: 0 30px 65px #18355c25;
}
.ecosystem-map::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -140px;
  width: 320px;
  height: 320px;
  border: 1px solid #ffffff20;
  border-radius: 50%;
  box-shadow: 0 0 0 40px #ffffff04, 0 0 0 80px #ffffff03;
  pointer-events: none;
}
.map-head { position: relative; margin-bottom: 24px; }
.map-head .eyebrow { color: #b9cdea; }
.map-head h2 { font-size: 25px; margin: 0; }
.map-list { position: relative; display: grid; gap: 10px; }

.map-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid #ffffff22;
  border-radius: 15px;
  background: #ffffff09;
  color: #fff;
  text-decoration: none;
}
.map-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  background: var(--model-color);
  font: italic 23px Georgia, serif;
}
.map-link strong { display: block; font-size: 14px; }
.map-link small { display: block; margin-top: 2px; color: #d0dced; font-size: 11px; }
.map-arrow { margin-left: auto; color: #c5d6ee; }
.map-note { position: relative; margin: 20px 0 0; color: #bdcce2; font-size: 11px; }

.delphina { --model-color: #2a74ea; --model-soft: #eaf3ff; }
.sapphire { --model-color: #7447e8; --model-soft: #f1ebff; }
.sophia { --model-color: #762c43; --model-soft: #f7eaee; }
.almanac { --model-color: #a95533; --model-soft: #f8eade; }

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffffb8;
}
.feature-strip > div { padding: 22px; }
.feature-strip > div + div { border-left: 1px solid var(--line); }
.feature-strip strong { display: block; font-size: 15px; }
.feature-strip span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.module-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--model-color);
  border-radius: 23px;
  background: #fff;
  box-shadow: var(--shadow);
}
.module-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.module-heading .map-icon { color: #fff; width: 42px; height: 42px; flex-basis: 42px; }
.module-heading h3 { margin: 0; font-size: 21px; }
.module-heading small { color: var(--muted); font-size: 11px; }
.module-card h4 { margin: 0 0 14px; font-size: 24px; line-height: 1.23; letter-spacing: -.6px; }
.module-card p { font-size: 14px; color: var(--muted); }
.module-card .quote { margin: 6px 0 24px; padding: 16px; border-radius: 13px; background: var(--model-soft); color: var(--text); font-size: 13px; line-height: 1.75; }
.module-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.module-bottom span { font-size: 11px; color: var(--muted); }
.module-bottom a { color: var(--model-color); font-size: 13px; font-weight: 750; text-decoration: none; }
.new-tag { margin-left: auto; padding: 4px 7px; border-radius: 6px; background: #f7eaee; color: #762c43; font-size: 9px; font-weight: 750; }

.split-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(125deg, #fff, #e8effb);
}
.check-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.check-list li + li { margin-top: 13px; }

.steps { counter-reset: steps; padding: 0; margin: 0; list-style: none; }
.steps li { position: relative; padding-left: 44px; color: var(--muted); font-size: 14px; }
.steps li + li { margin-top: 25px; }
.steps li::before { counter-increment: steps; content: counter(steps); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--soft); color: var(--primary-dark); font-weight: 750; }
.steps strong { display: block; color: var(--text); margin-bottom: 5px; }

details { border-bottom: 1px solid var(--line); }
summary { padding: 20px 3px; font-size: 15px; font-weight: 650; cursor: pointer; }
details p { max-width: 850px; color: var(--muted); font-size: 14px; padding: 0 3px 6px; }

.final-cta {
  padding: 48px 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(125deg, #fff, #e6eefc);
  text-align: center;
}
.final-cta p { max-width: 650px; margin-inline: auto; color: var(--muted); }
.final-cta .actions { justify-content: center; }

/* Авторизация */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: start;
  gap: 42px;
  max-width: 1040px;
  margin: 36px auto;
}
.auth-form-panel { padding: 34px; }
.form-head { margin-bottom: 26px; }
.form-title { margin-bottom: 12px; font-size: 33px; }
.form-subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.form-box { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-size: 12px; font-weight: 650; }
.field-hint { margin: 0; font-size: 11px; color: var(--muted); }

.field input, .promo-input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #ccd9ed;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.field input:focus, .promo-input:focus { border-color: #83a8df; box-shadow: 0 0 0 3px #2a74ea10; }
.submit-btn, .pack-btn { min-height: 48px; width: 100%; padding: 12px 16px; border: 0; border-radius: 13px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.status { margin: 0; color: var(--muted); font-size: 13px; }
.status:empty { display: none; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.links { padding-top: 4px; }
.link-btn { font-size: 12px; }
.auth-aside { padding: 28px 0; }
.auth-aside h2 { font-size: 36px; }
.auth-modules { display: grid; gap: 12px; margin: 26px 0; }
.auth-module { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #ffffff90; }
.auth-module .map-icon { color: white; }
.auth-module strong { display: block; font-size: 14px; }
.auth-module small { color: var(--muted); font-size: 12px; }

.note, .schedule-note, .hero-note-box, .contact-note {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
}

/* Биллинг */
#billingPage { display: none; }
#billingPage.ready { display: block; }
.billing-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 26px; padding: 28px 0; align-items: start; }
.billing-intro h1 { font-size: clamp(32px, 4vw, 47px); margin-bottom: 18px; }
.billing-intro .lead { font-size: 16px; }
.billing-notes { display: grid; gap: 10px; margin-top: 22px; }
.hero-note-box { color: #23684d; background: #eff8f2; border-color: #d2e8d9; }
.contact-note a { font-weight: 700; }
.hero-side { padding: 25px; }
.side-title { margin: 0 0 17px; font-size: 19px; }
.user-card { display: grid; gap: 18px; }
.user-card-title { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.user-meta { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.user-meta strong { color: var(--text); }
.bonus-badge { padding: 16px; border: 1px solid #ccdff9; border-radius: 14px; background: #edf4ff; font-size: 12px; color: #315aa8; }
#userBonusPercent { display: block; margin-top: 5px; font-size: 36px; font-weight: 750; line-height: 1.2; letter-spacing: -1px; }
.progress-wrap { display: grid; gap: 8px; }
.progress-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.progress { height: 7px; border-radius: 99px; background: #eaf0fa; overflow: hidden; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5b9cff, #6f6af8); transition: width .2s; }

.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 26px;
  border: 1px solid #d3e0f3;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.pack-top { display: grid; gap: 5px; }
.pack-label { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.pack-value { font-size: 40px; line-height: 1.15; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pack-sub { font-size: 12px; color: var(--muted); }
.pack-price { padding-top: 4px; font-size: 20px; color: #315aa8; font-weight: 700; }
.pack-bonus { display: grid; gap: 9px; padding: 15px; border: 1px solid #cfe5d7; border-radius: 13px; background: #f0f8f3; color: #236b50; font-size: 11px; }
.pack-bonus.muted { border-color: var(--line); background: #f5f8fd; color: var(--muted); }
.pack-total { font-size: 12px; color: var(--text); }
.pack-total-value { display: block; margin-top: 3px; font-size: 24px; line-height: 1.3; font-weight: 750; font-variant-numeric: tabular-nums; }
.pack-btn { margin-top: auto; font-size: 12px; }

.promo-section { margin-top: 42px; }
.promo-head { max-width: 820px; margin-bottom: 24px; }
.promo-title { margin-bottom: 12px; font-size: 29px; }
.promo-subtitle { font-size: 14px; color: var(--muted); }
.promo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.promo-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: #fbfdff; }
.promo-list, .promo-form { display: grid; gap: 12px; }
.promo-empty { padding: 18px; border: 1px dashed #cddbef; border-radius: 13px; color: var(--muted); font-size: 13px; background: #fff; }
.promo-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.promo-item > div { min-width: 0; }
.promo-code { color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.promo-copy-btn { flex: 0 0 auto; font-size: 11px; padding-inline: 10px; }
.promo-help { margin-top: 14px; color: var(--muted); font-size: 12px; }
.promo-message { display: none; margin-top: 14px; padding: 13px; border-radius: 12px; font-size: 13px; }
.promo-message.success { display: block; border: 1px solid #cfe5d7; background: #eff8f2; color: var(--ok); }
.promo-message.error { display: block; border: 1px solid #ecc7d0; background: #fff3f6; color: var(--danger); }
.footer-note, .legal-note { margin-top: 22px; color: var(--muted); font-size: 12px; }
.loading-screen { max-width: 600px; margin: 70px auto; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: #fff; text-align: center; color: var(--muted); }

/* Проверка платежа */
.payment-shell { max-width: 940px; }
.payment-content { margin-top: 24px; padding: 34px; }
.payment-content h1 { font-size: 35px; margin-bottom: 16px; }
.payment-content > p { color: var(--muted); font-size: 14px; }
.status-box { display: grid; gap: 10px; margin: 25px 0; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: #f4f8ff; }
.status-box.success { background: #eef8f2; border-color: #c8e3d3; }
.status-box.pending { background: #eff5ff; border-color: #ccddf8; }
.status-box.error { background: #fff3f6; border-color: #edc8d1; }
.status-title { font-size: 23px; font-weight: 750; line-height: 1.3; letter-spacing: -.4px; }
.status-text { color: var(--muted); font-size: 14px; line-height: 1.8; }
.status-box.success .status-title { color: var(--ok); }
.status-box.pending .status-title { color: #315aa8; }
.status-box.error .status-title { color: var(--danger); }
.details { display: grid; gap: 0; margin-bottom: 25px; padding: 6px 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.label { color: var(--muted); font-size: 12px; }
.value { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.value.success { color: var(--ok); font-size: 21px; }
.value.gold { color: #6950bb; }

@media (hover: hover) {
  .btn:hover, .link-btn:hover { background: #eaf1fc; }
  .btn.primary:hover, .submit-btn:hover:not(:disabled), .pack-btn:hover:not(:disabled) { background: #1f66d8; box-shadow: 0 10px 26px #2a74ea30; }
  .map-link:hover { background: #ffffff15; }
  .module-bottom a:hover { text-decoration: underline; }
  .pack:hover { border-color: #a9c5ed; }
}

@media (max-width: 960px) {
  .home-hero { gap: 26px; }
  .auth-layout { gap: 25px; }
  .packages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-intro { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .topbar { gap: 12px; padding-bottom: 15px; flex-wrap: wrap; }
  .brand { gap: 9px; }
  .brand-mark { width: 39px; height: 39px; flex-basis: 39px; border-radius: 13px; font-size: 25px; }
  .brand-name { font-size: 18px; }
  .brand-sub { font-size: 8px; }
  .topbar .btn { min-height: 40px; padding: 9px 11px; font-size: 11px; }
  .topbar .top-actions { gap: 7px; }
  .home-hero { grid-template-columns: 1fr; padding: 34px 0 28px; gap: 30px; }
  .home-hero h1 { font-size: 42px; }
  .lead { font-size: 16px; }
  .home-hero .actions .btn { flex: 1 1 auto; }
  .ecosystem-map { padding: 24px; border-radius: 24px; }
  .feature-strip { grid-template-columns: 1fr; }
  .feature-strip > div { padding: 17px 20px; }
  .feature-strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .section { padding-top: 48px; }
  .grid.two, .grid.three, .split-panel { grid-template-columns: 1fr; }
  .module-card { padding: 24px; border-radius: 20px; }
  .module-card h4 { font-size: 23px; }
  .split-panel { padding: 25px; gap: 25px; }
  .card, .panel { padding: 23px; border-radius: 20px; }
  .final-cta { padding: 34px 20px; }
  .final-cta .btn { width: 100%; }

  .auth-layout { grid-template-columns: 1fr; margin: 20px auto; gap: 25px; max-width: 540px; }
  .auth-form-panel { padding: 25px 22px; }
  .form-title { font-size: 29px; }
  .auth-aside { padding: 10px 4px; }
  .auth-aside h2 { font-size: 28px; }
  .links .link-btn { flex: 1 1 130px; }

  .billing-intro { padding-top: 20px; gap: 20px; }
  .billing-intro h1 { font-size: 34px; }
  .packages { gap: 12px; }
  .pack { padding: 20px; }
  .pack-value { font-size: 33px; }
  .promo-grid { grid-template-columns: 1fr; }
  .promo-card { padding: 20px; }
  .promo-title { font-size: 25px; }
  .payment-content { padding: 24px 20px; }
  .payment-content h1 { font-size: 29px; }
  .status-box { padding: 20px; }
  .status-title { font-size: 21px; }
  .payment-content .actions .btn { flex: 1 1 150px; }
}

@media (max-width: 480px) {
  .packages { grid-template-columns: 1fr; }
  .pack { gap: 14px; padding: 24px; }
  .pack-value { font-size: 39px; }
  .pack-total-value { display: inline; margin-left: 4px; font-size: 20px; }
  .promo-item { flex-direction: column; align-items: stretch; }
  .promo-copy-btn { width: 100%; }
  .row { gap: 7px; flex-wrap: wrap; }
  .row .value { margin-left: auto; max-width: 100%; }
  .payment-content .actions .btn { width: 100%; flex-basis: 100%; }
}

@media (max-width: 360px) {
  .home-hero h1 { font-size: 36px; }
  .auth-form-panel { padding: 22px 17px; }
  .map-link { padding: 12px; }
}

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