/* GematriaLab — главная страница (вход, гость, «Когда мечта становится реальностью», тарифы).
   Отдельно от site.css: страницы «Пользователи» и «Мой аккаунт» остаются в прежнем оформлении. */

:root {
  --bg-1: #f5f0fc;
  --bg-2: #ece2f8;
  --bg-3: #e2d3f4;
  --violet: #4b2b74;          /* заголовки */
  --violet-2: #6a49a8;        /* кнопки, акценты */
  --violet-soft: #8c73bf;
  --ink: #3a2c4f;             /* основной текст */
  --ink-soft: #6c5d82;
  --gold: #c39a45;
  --gold-deep: #a07a2c;
  --gold-light: #ecd39a;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-line: rgba(195, 154, 69, 0.38);
  --field: rgba(255, 255, 255, 0.72);
  --field-line: rgba(140, 115, 191, 0.28);
  --display: 'Cormorant Garamond', 'Times New Roman', serif;
  --serif: 'PT Serif', Georgia, serif;
  --hebrew: 'Frank Ruhl Libre', 'Times New Roman', serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #e9def7; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg-2);   /* сам градиент — в неподвижном слое .bg */
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Фон ───────────────────────────────────────────────────────────────── */
/* Неподвижный слой. Высота — наибольшая высота экрана (lvh): на телефоне она не
   меняется, когда при прокрутке прячется и появляется адресная строка, поэтому
   волны не растягиваются заново и не скачут. vh — запас для старых браузеров. */
.bg {
  position: fixed; top: 0; left: 0; z-index: 0;
  width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none; overflow: hidden;
  background: linear-gradient(170deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  transform: translateZ(0);          /* свой слой: без перерисовки при прокрутке */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.waves { position: absolute; width: 100%; }
/* высота волн — от самого слоя фона, а не от экрана: слой не меняется, и волны тоже */
.waves-top { top: 0; right: 0; height: 52%; min-height: 320px; }
.waves-bottom { bottom: 0; left: 0; height: 62%; min-height: 380px; }
.glow { position: absolute; border-radius: 50%; filter: blur(40px); }
.glow-top { width: 520px; height: 520px; left: 50%; top: -180px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 245, 225, 0.35) 45%, transparent 70%); }
.glow-mid { width: 420px; height: 420px; left: 50%; top: 520px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 246, 222, 0.75), transparent 65%); }

.page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 34px 16px calc(28px + env(safe-area-inset-bottom));
}

/* ─── Шапка ─────────────────────────────────────────────────────────────── */
.hero { text-align: center; }
.star { width: 92px; height: 92px; margin: 0 auto 6px; filter: drop-shadow(0 0 14px rgba(236, 200, 120, 0.6)); }
.star svg { width: 100%; height: 100%; overflow: visible; }
.star path { fill: none; stroke: url(#gold); stroke-width: 3.2; stroke-linejoin: round; }
.star .dot { fill: url(#pearl); }

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(46px, 12.5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  background: linear-gradient(180deg, #5d3a8c 0%, #3d2160 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(15px, 4.4vw, 19px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-left: 0.26em;      /* выравнивает разрядку по центру */
}
.heb {
  margin: 10px 0 0;
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: clamp(22px, 6.4vw, 28px);
  color: #4e2e78;
}

.divider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 16px; max-width: 240px; }
.divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 70%, var(--gold)); }
.divider span:last-child { background: linear-gradient(270deg, transparent, var(--gold) 70%, var(--gold)); }
.divider svg { width: 18px; height: 18px; fill: url(#gold); filter: drop-shadow(0 0 4px rgba(236, 200, 120, 0.8)); }

.lead {
  margin: 0 auto;
  max-width: 470px;
  font-size: 17.5px;
  line-height: 1.55;
  color: var(--ink);
}
.credo {
  margin: 12px auto 0;
  max-width: 440px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.4;
  color: var(--violet-2);
}

.tree {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 22px auto 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 252, 240, 0.85) 0%, rgba(255, 245, 225, 0.35) 55%, transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(195, 154, 69, 0.35);
}
.tree::after {      /* мягкий свет под Древом */
  content: '';
  position: absolute;
  left: 50%; bottom: -26px;
  width: 140px; height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255, 238, 200, 0.95), transparent 70%);
  filter: blur(6px);
}
.tree svg { width: 104px; height: 132px; overflow: visible; position: relative; z-index: 1; }
.tree .paths line { stroke: #c39a45; stroke-width: 1.4; stroke-linecap: round; opacity: 0.85; }
.tree .spheres circle { fill: url(#pearl); filter: drop-shadow(0 1px 1.5px rgba(120, 80, 20, 0.35)); }

/* ─── Карточки ──────────────────────────────────────────────────────────── */
main { margin-top: 30px; display: flex; flex-direction: column; gap: 26px; }
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  padding: 22px 22px 26px;
  box-shadow: 0 18px 50px -18px rgba(90, 60, 150, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}
.card-spark {
  position: absolute;
  left: 50%; bottom: -13px;
  width: 26px; height: 26px;
  transform: translateX(-50%);
  fill: url(#gold);
  filter: drop-shadow(0 0 6px rgba(236, 200, 120, 0.9));
}

/* вкладки */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(236, 226, 250, 0.75);
  box-shadow: inset 0 1px 3px rgba(90, 60, 150, 0.12);
  margin-bottom: 20px;
}
.tab {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--violet-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 12px 10px;
  cursor: pointer;
  transition: color .2s, background .25s, box-shadow .25s;
}
.tab:hover { color: var(--violet); }
.tab.on {
  color: var(--violet);
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #efe4fb 100%);
  box-shadow: 0 6px 16px -6px rgba(110, 70, 180, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.9) inset, 0 0 18px rgba(170, 140, 230, 0.35);
}
.tab:focus-visible { outline: 2px solid rgba(140, 115, 191, 0.6); outline-offset: 2px; }

.pane[hidden] { display: none; }
.field { display: block; margin-bottom: 16px; }
.label { display: block; font-size: 15.5px; color: var(--ink-soft); margin: 0 0 7px 4px; }
.control { position: relative; display: block; }
.control input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 16px;
  padding: 14px 46px 14px 48px;
  outline: none;
  transition: border-color .2s, box-shadow .25s, background .2s;
}
.control input:focus {
  background: #ffffff;
  border-color: rgba(122, 90, 190, 0.6);
  box-shadow: 0 0 0 4px rgba(150, 120, 220, 0.16), 0 0 22px rgba(170, 140, 230, 0.3);
}
.ico {
  position: absolute; left: 15px; top: 50%;
  width: 22px; height: 22px; transform: translateY(-50%);
  fill: none; stroke: #6d5a8a; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}
.ico .fill { fill: #6d5a8a; stroke: none; }
.eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 6px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer;
}
.eye:hover { background: rgba(150, 120, 220, 0.12); }
.eye svg { width: 24px; height: 24px; fill: none; stroke: #4e3c66; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.eye .eye-shut { display: none; }
.eye.on .eye-open { display: none; }
.eye.on .eye-shut { display: inline; }

/* кнопка с подсветкой */
.go {
  position: relative;
  width: 100%;
  margin-top: 8px;
  padding: 15px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: #fffdf8;
  background: linear-gradient(180deg, #a98ddb 0%, #7d5bbf 48%, #5e3f9f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 8px rgba(50, 20, 100, 0.25),
    0 0 0 1px rgba(214, 180, 110, 0.55),
    0 12px 28px -8px rgba(98, 58, 170, 0.6),
    0 0 26px rgba(160, 125, 230, 0.45);
  animation: aura 4.5s ease-in-out infinite;
  transition: transform .15s ease, filter .2s ease;
}
.go span { position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(50, 20, 100, 0.35); }
.go::after {          /* блик, пробегающий по кнопке */
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg) translateX(-120%);
  animation: sheen 5.5s ease-in-out infinite;
}
.go:hover { filter: brightness(1.06) saturate(1.05); }
.go:hover::after { animation-duration: 1.6s; }
.go:active { transform: translateY(1px) scale(0.995); }
.go:focus-visible { outline: 3px solid rgba(214, 180, 110, 0.85); outline-offset: 3px; }

@keyframes aura {
  0%, 100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 8px rgba(50, 20, 100, 0.25),
      0 0 0 1px rgba(214, 180, 110, 0.55), 0 12px 28px -8px rgba(98, 58, 170, 0.6), 0 0 22px rgba(160, 125, 230, 0.4);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 8px rgba(50, 20, 100, 0.25),
      0 0 0 1px rgba(232, 200, 130, 0.85), 0 14px 32px -8px rgba(98, 58, 170, 0.7), 0 0 38px rgba(176, 140, 245, 0.65);
  }
}
@keyframes sheen {
  0%, 62% { transform: skewX(-18deg) translateX(-120%); }
  100% { transform: skewX(-18deg) translateX(520%); }
}

.hint { margin: 14px 4px 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); text-align: center; }
.error {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 240, 240, 0.85);
  border: 1px solid rgba(190, 80, 90, 0.35);
  color: #8a2c3a;
  font-size: 15px;
}

/* «Когда мечта становится реальностью» */
.dream { padding: 28px 24px 30px; }
.dream h2, .tariffs h2 {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 7.4vw, 36px);
  line-height: 1.15;
  color: var(--violet);
}
.dream-lead {
  margin: 0 0 16px;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.35;
  color: var(--gold-deep);
}
.dream p { margin: 0 0 14px; }
.dream-accent {
  margin: 20px 0 !important;
  padding: 14px 10px;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.35;
  color: var(--violet-2);
  border-top: 1px solid var(--glass-line);
  border-bottom: 1px solid var(--glass-line);
}
.dream-final { margin-bottom: 0 !important; }
.dream-final b { font-family: var(--display); font-size: 1.15em; color: var(--violet); }

/* тарифы */
.tariffs { margin-top: 4px; }
.plans { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.plan {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 12px 30px -16px rgba(90, 60, 150, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.plan-name { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--violet); }
.plan-price { font-size: 13.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); margin: 2px 0 8px; }
.plan p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }
.plan.accent {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(240, 230, 252, 0.8));
  border-color: rgba(122, 90, 190, 0.45);
  box-shadow: 0 14px 34px -14px rgba(98, 58, 170, 0.5), 0 0 24px rgba(170, 140, 230, 0.3);
}
.plan.soon { opacity: 0.8; }

.foot { margin-top: 30px; text-align: center; font-size: 14px; letter-spacing: 0.12em; color: var(--ink-soft); }
.foot .divider { margin-bottom: 10px; }

/* ─── Шире телефона ────────────────────────────────────────────────────── */
@media (min-width: 760px) {
  .page { max-width: 980px; padding-top: 48px; }
  .hero { max-width: 600px; margin: 0 auto; }
  main { align-items: center; }
  .enter { width: 100%; max-width: 520px; padding: 26px 28px 30px; }
  .dream { width: 100%; max-width: 760px; padding: 34px 44px 36px; font-size: 17.5px; }
  .tariffs { width: 100%; }
  .plans { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .glow-mid { top: 600px; }
}

@media (prefers-reduced-motion: reduce) {
  .go, .go::after { animation: none; }
  .tab, .control input, .go { transition: none; }
}
