/* =============================================================
   Design tokens — spacing, motion, color, type
   ============================================================= */

:root {
  /* Spacing — 4px baseline grid */
  --space-1: 0.25rem;   /* 4  */
  --space-2: 0.5rem;    /* 8  */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 3rem;      /* 48 */
  --space-8: 4rem;      /* 64 */
  --space-9: 6rem;      /* 96 */
  --space-10: 8rem;     /* 128 */

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --duration-1: 120ms;
  --duration-2: 200ms;
  --duration-3: 320ms;
  --duration-4: 520ms;
  --duration-5: 800ms;

  /* Color — paper / ink / gold */
  --paper: #f8f6f2;
  --paper-alt: #efece6;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #15171c;
  --ink-2: #1f2330;
  --ink-3: #41475a;
  --ink-muted: #6b7080;
  --line: rgba(20, 22, 28, 0.08);
  --line-2: rgba(20, 22, 28, 0.14);

  --accent: #c4a962;
  --accent-bright: #e8d2a0;
  --accent-rich: #a18334;
  --accent-soft: rgba(196, 169, 98, 0.16);
  --accent-glow: rgba(196, 169, 98, 0.45);

  /* Клеверные зелёные — гуманная педагогика, акварель, живое */
  --clover: #4a8a4a;
  --clover-deep: #2f6b3a;
  --clover-soft: #a9d2a3;
  --clover-mist: rgba(74, 138, 74, 0.16);

  --hero-deep: #0c0e14;
  --hero-mid: #161b27;
  --hero-rim: rgba(232, 210, 150, 0.45);

  --success: #2d6a4f;

  /* Shadows — multi-layer, ambient + key */
  --shadow-1:
    0 1px 2px rgba(15, 18, 25, 0.04),
    0 2px 6px rgba(15, 18, 25, 0.04);
  --shadow-2:
    0 1px 1px rgba(15, 18, 25, 0.04),
    0 4px 12px rgba(15, 18, 25, 0.06),
    0 16px 40px rgba(15, 18, 25, 0.06);
  --shadow-3:
    0 1px 1px rgba(15, 18, 25, 0.05),
    0 8px 24px rgba(15, 18, 25, 0.08),
    0 28px 80px rgba(15, 18, 25, 0.1);
  --shadow-glow: 0 0 0 1px rgba(196, 169, 98, 0.18), 0 8px 32px rgba(196, 169, 98, 0.18);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-script: "Caveat", "Cormorant Garamond", cursive;
}

/* =============================================================
   Base & reset
   ============================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* учитываем sticky-навигацию для якорных ссылок (#how, #slots, #support) */
  scroll-padding-top: 88px;
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 128px;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(196, 169, 98, 0.07), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-alt) 100%);
  background-attachment: fixed;
  font-feature-settings: "kern", "liga", "calt", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* iOS Safari: убираем серый прямоугольник на тапе */
  -webkit-tap-highlight-color: transparent;
}

/* Никаких 300ms-задержек на тапе и убираем tap-highlight у всего интерактивного */
a,
button,
label,
input,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.container {
  /* На мобилках 16px полей с краёв, на десктопе — 32px */
  width: min(1120px, calc(100% - clamp(2rem, 4vw, var(--space-6))));
  margin: 0 auto;
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - var(--space-4));
  }
}

/* =============================================================
   Typography
   ============================================================= */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #faf7f0;
}

h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent-bright);
  background: linear-gradient(180deg, #f4e2b6 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}

p {
  margin: 0;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  margin-right: var(--space-2);
  vertical-align: middle;
  opacity: 0.6;
}

.lead {
  max-width: 36em;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: rgba(235, 230, 220, 0.82);
  font-weight: 400;
}

.section-text {
  max-width: 42em;
  margin: 0 0 var(--space-6);
  font-size: 1.0625rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* =============================================================
   Hero
   ============================================================= */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(5rem, 10vw, 7.5rem) 0 clamp(4.5rem, 9vw, 6.5rem);
  background: linear-gradient(168deg, var(--hero-deep) 0%, var(--hero-mid) 55%, #11151f 100%);
  color: #f5f2ea;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  background: linear-gradient(to top, var(--paper), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Top hairline */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hero-rim), transparent);
}

/* Aurora — animated mesh gradient (Stripe-vibe) */
.hero-aurora {
  position: absolute;
  inset: -10% -10% 0 -10%;
  z-index: 0;
  background:
    radial-gradient(ellipse 40% 35% at 80% 5%, rgba(232, 210, 150, 0.22), transparent 60%),
    radial-gradient(ellipse 35% 30% at 15% 85%, rgba(106, 122, 168, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 55% 60%, rgba(196, 169, 98, 0.1), transparent 65%);
  filter: blur(20px);
  animation: aurora 22s var(--ease-out-cubic) infinite alternate;
  pointer-events: none;
}

@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(-1%, 1.5%, 0) scale(1.02); }
}

/* На мобилках filter:blur(20px) с анимацией = просадка FPS и нагрев батареи.
   Оставляем сами градиенты, но без blur и без анимации. */
@media (max-width: 768px) {
  .hero-aurora {
    filter: none;
    animation: none;
  }
}

/* Subtle grid lines */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, black, transparent 80%);
  pointer-events: none;
}

/* Cursor spotlight (driven by JS via --mx/--my) */
.hero[data-spotlight]::after {
  background:
    radial-gradient(
      circle 320px at calc(var(--mx, 50%) ) calc(var(--my, 0%)),
      rgba(232, 210, 150, 0.12),
      transparent 60%
    ),
    linear-gradient(to top, var(--paper), transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 210, 150, 0.22);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 242, 235, 0.92);
  margin: 0 0 var(--space-5);
  backdrop-filter: blur(12px);
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2.4s var(--ease-out-cubic) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero h1 {
  margin: 0 0 var(--space-5);
  max-width: 18ch;
}

.lead {
  margin: 0 0 var(--space-6);
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* CTA — primary (gold) */
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  isolation: isolate;
  transition: transform var(--duration-2) var(--ease-out-expo),
              box-shadow var(--duration-2) var(--ease-out-expo);
  will-change: transform;
}

.cta:not(.cta-secondary) {
  color: var(--hero-deep);
  background: linear-gradient(180deg, #f1de9f 0%, var(--accent) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 6px 24px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Shine sweep on hover */
.cta:not(.cta-secondary)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-110%);
  transition: transform var(--duration-5) var(--ease-out-expo);
  pointer-events: none;
  mix-blend-mode: overlay;
}

@media (hover: hover) {
  .cta:not(.cta-secondary):hover {
    transform: translateY(-2px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.5) inset,
      0 0 0 1px rgba(255, 255, 255, 0.1) inset,
      0 12px 36px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(196, 169, 98, 0.4),
      0 0 24px rgba(196, 169, 98, 0.25);
  }

  .cta:not(.cta-secondary):hover::before {
    transform: translateX(110%);
  }

  .cta:hover svg {
    transform: translateX(3px);
  }
}

.cta:not(.cta-secondary):active {
  transform: translateY(0) scale(0.98);
}

.cta svg {
  transition: transform var(--duration-2) var(--ease-out-expo);
}

.cta-secondary {
  color: rgba(250, 247, 242, 0.95);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 210, 150, 0.32);
  backdrop-filter: blur(12px);
}

@media (hover: hover) {
  .cta-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(232, 210, 150, 0.55);
    transform: translateY(-1px);
  }
}

.cta-secondary:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.98);
}

/* Hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-1);
  margin: var(--space-7) 0 0;
  padding: var(--space-1) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5) var(--space-4) 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-stat:last-child {
  border-right: 0;
}

.hero-stat dt {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fdf9f1;
}

.hero-stat dd {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(235, 230, 220, 0.7);
  letter-spacing: 0.005em;
}

@media (max-width: 640px) {
  .hero-stat {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: var(--space-4) 0;
  }
  .hero-stat:last-child { border-bottom: 0; }
}

/* =============================================================
   Sections
   ============================================================= */

.section {
  padding: clamp(3.5rem, 7vw, 6rem) 0 var(--space-3);
}

.section + .section {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.section > h2 {
  margin-bottom: var(--space-3);
}

/* =============================================================
   Step cards (How it works)
   ============================================================= */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.step-card {
  position: relative;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition:
    transform var(--duration-3) var(--ease-out-expo),
    border-color var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-3) var(--ease-out-expo);
  overflow: hidden;
}

.step-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  opacity: 0.7;
}

@media (hover: hover) {
  .step-card:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 169, 98, 0.3);
    box-shadow: var(--shadow-2);
  }
}

.step-num {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 500;
  color: var(--accent-rich);
  letter-spacing: -0.02em;
}

.step-card h3 {
  margin-bottom: var(--space-2);
}

.step-card p {
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* =============================================================
   Slot cards
   ============================================================= */

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.slot-card {
  position: relative;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition:
    transform var(--duration-3) var(--ease-out-expo),
    border-color var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-3) var(--ease-out-expo);
  overflow: hidden;
}

.slot-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 169, 98, 0.5), transparent);
  opacity: 0;
  transition: opacity var(--duration-2) var(--ease-out-expo);
}

@media (hover: hover) {
  .slot-card:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 169, 98, 0.3);
    box-shadow: var(--shadow-2);
  }

  .slot-card:hover::before {
    opacity: 1;
  }
}

.slot-card h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.0625rem;
}

.slot-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: var(--space-2) 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.slot-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.slot-progress {
  width: 100%;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(20, 22, 28, 0.06);
  margin: var(--space-4) 0 var(--space-3);
  overflow: hidden;
}

.slot-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-rich), var(--accent), var(--accent-bright));
  transform-origin: left center;
  transition: width var(--duration-5) var(--ease-out-expo);
  box-shadow: 0 0 12px rgba(196, 169, 98, 0.35);
}

.slot-participant {
  margin: var(--space-3) 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--success);
  min-height: 1.35em;
  letter-spacing: 0.005em;
}

/* =============================================================
   Form / chips / segmented / button
   ============================================================= */

.form-section {
  margin-bottom: var(--space-9);
}

.support-form {
  display: grid;
  gap: var(--space-4);
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  max-width: 640px;
}

.field-label,
legend {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

/* Маленькая золотая звёздочка у меток обязательных полей */
.required-mark {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--accent-rich);
  font-weight: 700;
  font-size: 0.85em;
  line-height: 1;
  vertical-align: 1px;
}

.form-required-note {
  margin: -0.25rem 0 0;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.support-form > label {
  display: block;
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  /* минимум 16px — иначе iOS Safari зумит страницу при фокусе */
  font-size: 16px;
  /* высота >= 44px для touch-target */
  min-height: 48px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-2) var(--ease-out-expo),
    background var(--duration-2) var(--ease-out-expo);
}

/* Кастомная иконка-стрелка для select (нативная скрыта appearance: none) */
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2341475a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

@media (hover: hover) {
  input[type="text"]:hover,
  input[type="email"]:hover,
  input[type="number"]:hover,
  select:hover {
    border-color: rgba(20, 22, 28, 0.22);
  }
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent-rich);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}

input::placeholder {
  color: rgba(20, 22, 28, 0.32);
}

/* Phone field with fixed +7 prefix */
.phone-field {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition:
    border-color var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-2) var(--ease-out-expo),
    background var(--duration-2) var(--ease-out-expo);
}

.phone-field:focus-within {
  border-color: var(--accent-rich);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}

.phone-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem 0 1rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--line-2);
  background: rgba(20, 22, 28, 0.025);
  user-select: none;
  pointer-events: none;
}

.phone-field input[type="tel"] {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
  /* свой focus-стиль убираем — кольцо рисуется на phone-field */
}

.phone-field input[type="tel"]:focus {
  box-shadow: none;
  background: transparent;
  border: 0;
}

@media (hover: hover) {
  .phone-field:hover {
    border-color: rgba(20, 22, 28, 0.22);
  }
}

/* Amount chips */
.amount-chips {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: var(--space-2);
}

.chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  font-variant-numeric: tabular-nums;
  transition:
    border-color var(--duration-2) var(--ease-out-expo),
    background var(--duration-2) var(--ease-out-expo),
    color var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-2) var(--ease-out-expo),
    transform var(--duration-1) var(--ease-out-expo);
}

@media (hover: hover) {
  .chip:hover {
    border-color: rgba(20, 22, 28, 0.22);
    background: var(--surface);
  }
}

.chip:active {
  transform: scale(0.97);
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.chip:has(input:checked) {
  border-color: var(--accent-rich);
  background: linear-gradient(180deg, rgba(241, 222, 159, 0.45), rgba(196, 169, 98, 0.2));
  color: var(--ink);
  box-shadow:
    0 0 0 1px var(--accent-rich) inset,
    0 4px 14px rgba(168, 134, 58, 0.18);
}

.chip:focus-within {
  outline: none;
  box-shadow:
    0 0 0 1px var(--accent-rich) inset,
    0 0 0 4px var(--accent-soft);
}

.chip-custom {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 500;
}

/* Segmented control */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: rgba(20, 22, 28, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  isolation: isolate;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  margin: 0;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--duration-2) var(--ease-out-expo);
}

.segmented input:checked + label {
  color: var(--ink);
}

.segmented input:focus-visible + label {
  outline: 2px solid var(--accent-rich);
  outline-offset: 2px;
}

.segmented-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--surface);
  border: 1px solid rgba(196, 169, 98, 0.35);
  border-radius: var(--radius-pill);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 2px 8px rgba(15, 18, 25, 0.06),
    0 0 0 1px rgba(196, 169, 98, 0.1) inset;
  transition: transform var(--duration-3) var(--ease-out-expo);
  z-index: 0;
}

.segmented:has(#freqOnce:checked) .segmented-thumb {
  transform: translateX(100%);
}

.frequency-note {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Consent checkbox */
.consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-3) 0 0;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0;
}

.consent input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.consent-box {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  background: var(--surface-2);
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  color: transparent;
  transition:
    background var(--duration-2) var(--ease-out-expo),
    border-color var(--duration-2) var(--ease-out-expo),
    color var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-2) var(--ease-out-expo),
    transform var(--duration-1) var(--ease-out-expo);
}

.consent-box svg {
  transform: scale(0.6);
  opacity: 0;
  transition: transform var(--duration-2) var(--ease-spring), opacity var(--duration-2) var(--ease-out-expo);
}

.consent input:checked ~ .consent-box {
  background: linear-gradient(180deg, #2c303d 0%, var(--ink) 100%);
  border-color: var(--ink);
  color: var(--accent-bright);
  box-shadow:
    0 0 0 1px rgba(232, 210, 150, 0.18) inset,
    0 2px 8px rgba(15, 18, 25, 0.18);
}

.consent input:checked ~ .consent-box svg {
  transform: scale(1);
  opacity: 1;
}

.consent input:focus-visible ~ .consent-box {
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-color: var(--accent-rich);
}

.consent:active .consent-box {
  transform: scale(0.94);
}

.consent-text a {
  color: var(--accent-rich);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(168, 134, 58, 0.4);
  transition: color var(--duration-2) var(--ease-out-expo), text-decoration-color var(--duration-2) var(--ease-out-expo);
}

.consent-text a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* Footer links */
.footer-links {
  margin-top: var(--space-3) !important;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(20, 22, 28, 0.18);
  transition: color var(--duration-2) var(--ease-out-expo), text-decoration-color var(--duration-2) var(--ease-out-expo);
}

.footer-links a:hover {
  color: var(--accent-rich);
  text-decoration-color: var(--accent-rich);
}

/* Primary button */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-2);
  padding: 1.05rem 1.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #faf7f0;
  background: linear-gradient(180deg, #2c303d 0%, var(--ink) 100%);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 6px 24px rgba(15, 18, 25, 0.22),
    0 0 0 1px rgba(232, 210, 150, 0.12) inset;
  transition:
    transform var(--duration-2) var(--ease-out-expo),
    box-shadow var(--duration-2) var(--ease-out-expo);
  will-change: transform;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(232, 210, 150, 0.18) 50%,
    transparent 70%
  );
  transform: translateX(-110%);
  transition: transform var(--duration-5) var(--ease-out-expo);
  pointer-events: none;
}

@media (hover: hover) {
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 12px 32px rgba(15, 18, 25, 0.3),
      0 0 0 1px rgba(232, 210, 150, 0.28) inset;
  }

  .btn-primary:hover::before {
    transform: translateX(110%);
  }

  .btn-primary:hover svg {
    transform: translateX(3px);
  }
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-primary svg {
  transition: transform var(--duration-2) var(--ease-out-expo);
}

.form-message {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--success);
  min-height: 1.35em;
  line-height: 1.5;
}

.form-message.is-error {
  color: #b54848;
}

.btn-primary.is-loading {
  cursor: progress;
  opacity: 0.85;
}

.btn-primary.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: btn-shimmer 1.2s linear infinite;
  pointer-events: none;
}

@keyframes btn-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =============================================================
   Site nav (top header with logo)
   ============================================================= */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 246, 242, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(1rem, 4vw, var(--space-6));
  padding: 0.65rem 0;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  min-height: 64px;
}

.site-nav-middle {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, var(--space-5));
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav-middle a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--duration-2) var(--ease-out-cubic);
}

@media (hover: hover) {
  .site-nav-middle a:hover {
    color: var(--clover-deep);
  }
}

/* Логотип = типография бренда. Текст рядом не нужен (есть visually-hidden для SR). */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  padding: 0.15rem 0.35rem;
  transition: transform var(--duration-2) var(--ease-out-cubic),
    filter var(--duration-2) var(--ease-out-cubic);
}

@media (hover: hover) {
  .brand:hover {
    transform: translateY(-1px);
  }
  .brand:hover .brand-logo {
    filter: drop-shadow(0 4px 12px rgba(47, 107, 58, 0.3));
  }
}

.brand-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(47, 107, 58, 0.18));
  transition: filter var(--duration-3) var(--ease-out-cubic);
}

.site-nav-cta {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--clover);
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(74, 138, 74, 0.28);
  transition: transform var(--duration-2) var(--ease-out-cubic),
    box-shadow var(--duration-2) var(--ease-out-cubic),
    background var(--duration-2) var(--ease-out-cubic);
}

@media (hover: hover) {
  .site-nav-cta:hover {
    background: var(--clover-deep);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(74, 138, 74, 0.34);
  }
}

.site-nav-cta:active {
  transform: scale(0.98);
}

@media (max-width: 720px) {
  .site-nav-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--space-3) var(--space-4);
    align-items: center;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.85rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    padding: 0.2rem 0.15rem;
  }

  .brand-logo {
    height: 44px;
  }

  /* Второй ряд: две текстовые ссылки на всю ширину под логотипом */
  .site-nav-middle {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    gap: var(--space-2);
    width: 100%;
    justify-content: stretch;
  }

  .site-nav-middle a {
    flex: 1;
    text-align: center;
    padding: 0.7rem var(--space-3);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-3);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    -webkit-tap-highlight-color: transparent;
  }

  .site-nav-middle a:active {
    background: rgba(47, 107, 58, 0.08);
    border-color: rgba(74, 138, 74, 0.28);
    color: var(--clover-deep);
  }

  .site-nav-cta {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    padding: 0.65rem 1.15rem;
    font-size: 0.875rem;
    min-height: 44px;
  }
}

/* =============================================================
   Hero — клеверные акценты
   ============================================================= */

/* Рукописная надпись над H1 в герое */
.hero-script {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 600;
  color: var(--clover-soft);
  margin: 0 0 var(--space-3);
  letter-spacing: 0.01em;
  line-height: 1;
  /* лёгкое акварельное «свечение» */
  text-shadow: 0 0 24px rgba(169, 210, 163, 0.35);
}

/* Ссылка-якорь в форме «h1 em» уже акцент золотом — добавим лёгкий зелёный
   подчерк под em для тёплой ноты */
.hero h1 em {
  position: relative;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -0.05em;
  height: 0.18em;
  background: linear-gradient(90deg,
    rgba(169, 210, 163, 0),
    rgba(169, 210, 163, 0.55) 30%,
    rgba(169, 210, 163, 0.55) 70%,
    rgba(169, 210, 163, 0));
  border-radius: 999px;
  filter: blur(1px);
}

/* =============================================================
   Footer
   ============================================================= */

.footer {
  /* учитываем home indicator на iPhone */
  padding: var(--space-7) 0 calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(74, 138, 74, 0.06), transparent 60%),
    linear-gradient(180deg, transparent, rgba(169, 210, 163, 0.06));
}

.footer p {
  max-width: 36em;
  margin: 0 auto;
  line-height: 1.55;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.footer-logo {
  height: 132px;
  width: auto;
  object-fit: contain;
  /* акварель «вписана» в бумагу, без рамок и теней — пусть дышит */
  filter: drop-shadow(0 6px 18px rgba(47, 107, 58, 0.14));
  transition: transform var(--duration-4) var(--ease-out-cubic);
}

@media (hover: hover) {
  .footer-brand:hover .footer-logo {
    transform: translateY(-2px) rotate(-1deg);
  }
}

.footer-script {
  font-family: var(--font-script);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--clover-deep);
  margin: 0;
  line-height: 1;
  letter-spacing: 0.01em;
}

@media (max-width: 720px) {
  .footer-logo { height: 104px; }
}

/* =============================================================
   Scroll-reveal
   ============================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity var(--duration-4) var(--ease-out-expo),
    transform var(--duration-4) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* =============================================================
   Mobile polish (≤ 768px) — typography, layout, touch ergonomics
   ============================================================= */

@media (max-width: 768px) {
  /* Чуть мягче основной шрифт */
  body { font-size: 16px; }

  /* Hero: меньше воздуха, плотнее заголовок */
  .hero {
    padding: clamp(3.5rem, 14vw, 5rem) 0 clamp(3rem, 11vw, 4.5rem);
  }
  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.6rem);
    max-width: 100%;
  }
  .lead {
    font-size: 1.0625rem;
  }

  /* CTA на мобилке — в столбик и во всю ширину контейнера */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  .cta {
    width: 100%;
    padding: 0.95rem 1.4rem;
  }

  /* Секции — поджимаем верх/низ */
  .section {
    padding: clamp(2.5rem, 8vw, 4rem) 0 var(--space-2);
  }

  /* Карточки шагов и слотов — ровные, плотнее */
  .step-card,
  .slot-card {
    padding: var(--space-4);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-3);
  }

  /* Форма: меньше отступов внутри карточки */
  .support-form {
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-lg);
    gap: var(--space-3);
  }

  /* Чипы быстрых сумм — гарантируем минимум 3 в ряд на узких телефонах */
  .amount-chips {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  /* Сегмент-переключатель — растягиваем «бегунок» на всю ширину половины */
  .segmented label {
    padding: 0.85rem 0.5rem;
  }
}

@media (max-width: 380px) {
  /* Совсем узкие — iPhone SE и меньше */
  .amount-chips {
    grid-template-columns: repeat(2, 1fr);
  }
  .chip {
    font-size: 0.9rem;
  }
  .cta-secondary,
  .cta:not(.cta-secondary) {
    font-size: 0.875rem;
  }
}

/* =============================================================
   Reduced motion
   ============================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-aurora { animation: none; }
}
