/* ============================================================
   iforgot.retailpad.ru · SPA восстановления пароля
   Дизайн v9 (Mack), адаптирован под baseline iOS 13+ / Chromium 80+:
   — без 100dvh, без :has(), без container queries, без color-mix
   — без CSS nesting, без оператора @scope
   — backdrop-filter с -webkit- префиксом (iOS 9+ поддерживает)
   ============================================================ */

:root {
  --bg:           #050505;
  --bg-card-out:  rgba(255, 255, 255, 0.035);
  --bg-card-in:   rgba(14, 14, 16, 0.72);
  --bg-input:     rgba(255, 255, 255, 0.025);
  --bg-input-hi:  rgba(255, 255, 255, 0.06);
  --bg-row:       rgba(255, 255, 255, 0.03);
  --bg-row-hi:    rgba(255, 255, 255, 0.06);

  --rim:          rgba(255, 255, 255, 0.06);
  --rim-mid:      rgba(255, 255, 255, 0.10);
  --rim-strong:   rgba(255, 255, 255, 0.16);

  --t1: rgba(245, 246, 248, 0.98);
  --t2: rgba(180, 184, 192, 0.78);
  --t3: rgba(120, 124, 134, 0.72);
  --t4: rgba(70, 72, 80, 0.86);

  /* Brand-цвет из логотипа RetailPad ID */
  --signal:       #2F88D6;
  --signal-soft:  rgba(47, 136, 214, 0.12);
  --signal-ring:  rgba(47, 136, 214, 0.22);
  --success:      #6BD68A;
  --success-soft: rgba(107, 214, 138, 0.10);
  --danger:       #FF6A6A;
  --danger-soft:  rgba(255, 106, 106, 0.10);

  --e-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --e-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --e-glass:  cubic-bezier(0.16, 1, 0.3, 1);

  --sans:  "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Charter, Georgia, serif;

  /* iOS 13/14 fallback для viewport-height (без dvh).
     JS обновляет --vh = window.innerHeight * 0.01 на resize/orientationchange. */
  --vh: 1vh;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

/* На iOS Safari overflow-x: hidden на body иногда игнорируется —
   ставим на оба и фиксируем max-width: 100vw, чтобы .ambient
   с inset:-30% не создавал horizontal scroll. */
html {
  background: var(--bg);
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  /* min-height: 100dvh → используем calc через --vh для iOS 13. */
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  background: var(--bg);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

/* ── Ambient mesh ──────────────────────────────────────────── */
.ambient {
  position: fixed;
  top: -30%; right: -30%; bottom: -30%; left: -30%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.ambient::before, .ambient::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  mix-blend-mode: screen;
}
.ambient::before {
  background:
    radial-gradient(38% 32% at 22% 28%, rgba(47, 136, 214, 0.20) 0%, transparent 60%),
    radial-gradient(32% 30% at 78% 24%, rgba(96, 80, 220, 0.16) 0%, transparent 60%),
    radial-gradient(46% 38% at 82% 82%, rgba(28, 90, 200, 0.16) 0%, transparent 60%),
    radial-gradient(34% 30% at 18% 80%, rgba(60, 180, 200, 0.10) 0%, transparent 55%);
  animation: ambient-drift-1 38s var(--e-glass) infinite alternate;
  -webkit-filter: saturate(125%);
  filter: saturate(125%);
}
.ambient::after {
  background: radial-gradient(50% 50% at 50% 50%, transparent 0%, rgba(5, 5, 5, 0.55) 60%, var(--bg) 100%);
  animation: ambient-drift-2 26s var(--e-glass) infinite alternate;
}
@keyframes ambient-drift-1 {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  100% { transform: translate3d(-2%, 1.5%, 0) scale(1.05) rotate(2deg); }
}
@keyframes ambient-drift-2 {
  0%   { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.08) rotate(-1.5deg); }
}

/* ── Layout ────────────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.nav {
  display: flex;
  justify-content: center;
  padding: 24px 24px 0;
}
.nav__pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px 8px 16px;
  background: rgba(8, 8, 10, 0.55);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--rim-mid);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 40px -10px rgba(0, 0, 0, 0.6);
  max-width: calc(100vw - 48px);
  overflow: hidden;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--t1);
  flex-shrink: 0;
}
.brand__logo {
  height: 18px;
  width: auto;
  display: block;
  -webkit-filter: brightness(1.1) saturate(115%);
  filter: brightness(1.1) saturate(115%);
  user-select: none;
  -webkit-user-drag: none;
}
.brand__dot {
  position: relative;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(47, 136, 214, 0.6);
}
.brand__dot::after {
  content: "";
  position: absolute;
  top: -6px; right: -6px; bottom: -6px; left: -6px;
  border-radius: 50%;
  border: 1px solid rgba(47, 136, 214, 0.45);
  animation: dot-pulse 3.2s var(--e-spring) infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.8; }
  50%      { transform: scale(1.4); opacity: 0; }
}

.nav__sep { width: 1px; height: 14px; background: var(--rim-mid); flex-shrink: 0; }
.nav__chip {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--t2);
  transition: opacity 360ms var(--e-out);
  white-space: nowrap;
}
.nav__chip[hidden] { display: none; }
.nav__clock {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}
.nav__back {
  appearance: none;
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--rim);
  color: var(--t1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 240ms var(--e-out), transform 240ms var(--e-spring), opacity 240ms var(--e-out);
  flex-shrink: 0;
  padding: 0;
}
.nav__back:hover { background: rgba(255, 255, 255, 0.10); }
.nav__back:active { transform: scale(0.92); }
.nav__back[data-on="false"] {
  opacity: 0;
  pointer-events: none;
  width: 0;
  padding: 0;
  border: none;
  margin-right: -12px;
}
.nav__back[data-on="false"] svg { display: none; }
.nav__back svg { width: 12px; height: 12px; }

/* ── Canvas (centered card) ────────────────────────────────── */
.canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 96px;
  -webkit-perspective: 1400px;
  perspective: 1400px;
}

.card-out {
  width: 100%;
  max-width: 460px;
  padding: 8px;
  background: var(--bg-card-out);
  border: 1px solid var(--rim);
  border-radius: 32px;
  position: relative;
  will-change: transform;
  transition: transform 420ms var(--e-spring);
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  box-shadow:
    inset 0 1px 0 var(--rim-mid),
    0 30px 80px -30px rgba(0, 0, 0, 0.7),
    0 8px 20px -6px rgba(0, 0, 0, 0.5);
}
.card-out::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 32px;
  background: radial-gradient(
    320px 220px at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.07),
    transparent 60%
  );
  pointer-events: none;
  transition: opacity 600ms var(--e-out);
  opacity: 0;
}
.card-out:hover::before { opacity: 1; }

.card-in {
  background: var(--bg-card-in);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--rim-mid);
  border-radius: 24px;
  padding: 30px 28px 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  position: relative;
  /* overflow: hidden убрано — иначе intl-tel-input dropdown
     (position:absolute, top ~ниже field) обрезается родителем.
     Stage transitions держим через opacity/transform/blur — без visual leak'а. */
}

/* Progress dots */
.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  align-items: center;
}
.progress[hidden] { display: none; }
.progress__dot {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--rim-mid);
  transition: background-color 320ms var(--e-out), width 320ms var(--e-spring);
}
.progress__dot[data-state="done"]   { background: var(--t3); }
.progress__dot[data-state="active"] { background: var(--t1); width: 36px; }

/* Hero-logo в карточке */
.card-logo {
  display: block;
  width: 140px;
  max-width: 60%;
  height: auto;
  margin: 4px 0 22px;
  -webkit-filter: brightness(1.08) saturate(110%);
  filter: brightness(1.08) saturate(110%);
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 600px) {
  .card-logo { width: 120px; margin-bottom: 18px; }
}

/* Eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t2);
  margin-bottom: 16px;
}
.eyebrow__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--signal);
}
.eyebrow--success .eyebrow__dot { background: var(--success); }
.eyebrow--success {
  background: var(--success-soft);
  border-color: rgba(107, 214, 138, 0.3);
  color: rgba(214, 240, 220, 0.85);
}
.eyebrow--danger .eyebrow__dot { background: var(--danger); }
.eyebrow--danger {
  background: var(--danger-soft);
  border-color: rgba(255, 106, 106, 0.3);
  color: rgba(255, 200, 200, 0.85);
}

/* Title + lede */
.stage h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--t1);
  line-height: 1.15;
}
.stage h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--signal);
  font-size: 1.08em;
  letter-spacing: -0.01em;
}
.stage .lede {
  margin: 0 0 24px;
  color: var(--t2);
  font-size: 14px;
  line-height: 1.55;
}

/* Stage transitions */
.stages { position: relative; }
.stage { display: none; }
.stage.is-active { display: block; }
.stage.is-entering {
  animation: stageEnter 420ms var(--e-glass) both;
}
.stage.is-exiting {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: auto;
  animation: stageExit 240ms var(--e-out) both;
  pointer-events: none;
}
@keyframes stageEnter {
  from { opacity: 0; transform: scale(0.98) translateY(8px); -webkit-filter: blur(8px); filter: blur(8px); }
  to   { opacity: 1; transform: none; -webkit-filter: none; filter: none; }
}
@keyframes stageExit {
  from { opacity: 1; transform: none; -webkit-filter: blur(0); filter: blur(0); }
  to   { opacity: 0; transform: scale(0.98) translateY(-4px); -webkit-filter: blur(8px); filter: blur(8px); }
}

/* ── Form ──────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 10px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--rim);
  border-radius: 14px;
  height: 54px;
  padding-right: 8px;
  transition:
    background-color 320ms var(--e-out),
    border-color 320ms var(--e-out),
    box-shadow 320ms var(--e-out);
}
.field:hover { border-color: var(--rim-mid); }
.field:focus-within {
  background: var(--bg-input-hi);
  border-color: rgba(47, 136, 214, 0.45);
  box-shadow: 0 0 0 4px var(--signal-ring);
}
.field__input {
  flex: 1; width: 100%; height: 100%;
  padding: 20px 16px 6px;
  background: transparent;
  border: none; outline: none;
  color: var(--t1);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  caret-color: var(--signal);
  font-feature-settings: "tnum" 1, "ss01" 1;
}
.field__input::placeholder { color: transparent; }
.field__label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--t2);
  font-size: 14px;
  font-weight: 400;
  pointer-events: none;
  -webkit-transform-origin: left center;
  transform-origin: left center;
  transition: transform 320ms var(--e-spring), color 320ms var(--e-out), padding 320ms var(--e-out);
  /* Outlined material-style: при поднятии label получает фон под цвет card-in
     с горизонтальным padding, чтобы аккуратно «вырезать» границу field. */
  background: transparent;
  padding: 0;
  border-radius: 4px;
  line-height: 1;
}
.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label {
  transform: translateY(-28px) scale(0.78);
  color: var(--t3);
  letter-spacing: 0.04em;
  /* Цвет фона имитирует фон card-in после backdrop-filter.
     Прямого "вырезания" border'а не делаем — лейбл выше границы. */
  padding: 0 4px;
  background: rgba(14, 14, 16, 0.95);
}
.field__input:focus + .field__label { color: var(--signal); }

.field__suffix {
  appearance: none;
  -webkit-appearance: none;
  background: transparent; border: none;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--t2);
  border-radius: 10px;
  cursor: pointer;
  transition: color 240ms var(--e-out), background-color 240ms var(--e-out), transform 240ms var(--e-spring);
  padding: 0;
  flex-shrink: 0;
}
.field__suffix:hover { color: var(--t1); background: rgba(255, 255, 255, 0.05); }
.field__suffix:active { transform: scale(0.92); }
.field__suffix svg { width: 18px; height: 18px; }

/* intl-tel-input overrides — все элементы dropdown в нашей dark-теме.
   v23 структура:
     .iti__dropdown-content (контейнер, дефолтно white — это и был баг)
       .iti__search-input
       .iti__a11y-text
       .iti__country-list
         .iti__country (рендеры строк)
   Каждый узел получает чистую dark-стилизацию, без gap'ов и белых полос. */
.iti { width: 100%; height: 100%; display: block; position: relative; }

.iti__dropdown-content {
  background: rgba(20, 20, 24, 0.98);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--rim-mid);
  border-radius: 14px;
  box-shadow:
    0 24px 60px -16px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  color: var(--t1);
  font-family: var(--sans);
  padding: 8px;
  margin-top: 6px;
}

.iti__country-list {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  color: var(--t1);
  font-family: var(--sans);
  /* Тонкий скроллбар */
  scrollbar-width: thin;
  scrollbar-color: var(--rim-mid) transparent;
}
.iti__country-list::-webkit-scrollbar {
  width: 6px;
}
.iti__country-list::-webkit-scrollbar-thumb {
  background: var(--rim-mid);
  border-radius: 3px;
}
.iti__country-list::-webkit-scrollbar-track {
  background: transparent;
}

.iti__country {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 1px 0;
  transition: background-color 160ms var(--e-out);
}
/* Highlighted row — заметнее, signal-blue tint + лёгкий border-left */
.iti__country.iti__highlight,
.iti__country[aria-selected="true"],
.iti__country:hover {
  background: rgba(47, 136, 214, 0.18);
}
.iti__country.iti__highlight {
  box-shadow: inset 2px 0 0 var(--signal);
}
.iti__dial-code { color: var(--t3); margin-left: 6px; }
.iti__divider {
  border-bottom: 1px solid var(--rim);
  margin: 4px 0;
}

.iti__search-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rim);
  color: var(--t1);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 240ms var(--e-out), background-color 240ms var(--e-out);
}
.iti__search-input::placeholder { color: var(--t3); }
.iti__search-input:focus {
  border-color: rgba(47, 136, 214, 0.45);
  background: rgba(255, 255, 255, 0.06);
}
/* Browser default search-input стили: убираем "X" reset, rounded UA appearance */
.iti__search-input::-webkit-search-cancel-button,
.iti__search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.iti__a11y-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Баджик с флагом + dial code (separateDialCode mode) */
.field--phone .iti__selected-flag {
  background: transparent;
  border-radius: 0;
  height: 100%;
  padding: 0 8px 0 18px;
}
.field--phone .iti__selected-flag:hover,
.field--phone .iti__selected-flag:focus {
  background: rgba(255, 255, 255, 0.04);
}
.field--phone .iti--separate-dial-code .iti__selected-dial-code {
  color: var(--t1);
  font-weight: 500;
  margin-left: 6px;
}
.iti__arrow {
  border-top-color: var(--t3);
}

/* Сам input в phone-поле смещён вправо чтобы не перекрывать баджик.
   intl-tel-input v23 в separateDialCode mode выставляет padding-left ~95px
   автоматически. Дополнительно поднимаем top-padding чтобы было место
   под floating-label. */
.field--phone .field__input {
  padding-top: 20px;
  padding-bottom: 6px;
}

/* Floating-label для phone-поля — управляется JS-классами,
   потому что intl-tel-input ломает adjacent sibling селектор.
   После поднятия label сдвигается влево к началу field
   (не остаётся прижатым к +7 баджику). */
.field--phone .field__label {
  left: 100px;
  transition: transform 320ms var(--e-spring), color 320ms var(--e-out), left 320ms var(--e-out);
}
.field--phone.is-floating .field__label,
.field--phone.is-focused .field__label {
  transform: translateY(-28px) scale(0.78);
  color: var(--t3);
  letter-spacing: 0.04em;
  left: 16px;
  padding: 0 4px;
  background: rgba(14, 14, 16, 0.95);
}
.field--phone.is-focused .field__label {
  color: var(--signal);
}

/* intl-tel-input сам позиционирует dropdown относительно phone field. */

/* ── CTA ───────────────────────────────────────────────────── */
.cta {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 8px 8px 22px;
  background: var(--t1);
  color: #0A0A0C;
  border: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08),
    0 14px 30px -10px rgba(0, 0, 0, 0.65);
  transition:
    background-color 320ms var(--e-out),
    transform 240ms var(--e-spring),
    -webkit-filter 320ms var(--e-out),
    filter 320ms var(--e-out);
}
.cta:hover:not(:disabled) { -webkit-filter: brightness(1.04); filter: brightness(1.04); }
.cta:active:not(:disabled) { transform: scale(0.985); }
.cta:disabled { opacity: 0.6; cursor: not-allowed; }
.cta__label { white-space: nowrap; }
.cta__circle {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.10);
  display: inline-flex; align-items: center; justify-content: center;
  color: #0A0A0C;
  transition: transform 360ms var(--e-spring), background-color 320ms var(--e-out);
}
.cta:hover:not(:disabled) .cta__circle {
  transform: translate(2px, -1px) scale(1.06);
  background: rgba(10, 10, 12, 0.16);
}
.cta__circle svg { width: 14px; height: 14px; }
.cta.is-loading .cta__circle { animation: spin 1s linear infinite; }
@keyframes spin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

.form-error {
  margin-top: 4px;
  padding: 10px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 106, 106, 0.3);
  border-radius: 12px;
  color: rgba(255, 200, 200, 0.95);
  font-size: 13px;
  line-height: 1.4;
  animation: shake 320ms var(--e-spring);
}
.form-error[hidden] { display: none; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rim);
  font-size: 12px;
  color: var(--t3);
}
.footer-link {
  appearance: none;
  -webkit-appearance: none;
  background: transparent; border: none;
  color: var(--t2);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 240ms var(--e-out);
  text-decoration: none;
}
.footer-link:hover { color: var(--t1); }
.footer-build {
  font-feature-settings: "tnum" 1;
  font-size: 11px;
  color: var(--t4);
}

/* ── Stack (phone-list) ────────────────────────────────────── */
.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.row {
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: var(--bg-row);
  border: 1px solid var(--rim);
  border-radius: 14px;
  text-decoration: none;
  color: var(--t1);
  cursor: pointer;
  text-align: left;
  transition:
    background-color 240ms var(--e-out),
    border-color 240ms var(--e-out),
    transform 240ms var(--e-spring);
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--sans);
}
@media (hover: hover) and (pointer: fine) {
  .row:hover {
    background: var(--bg-row-hi);
    border-color: var(--rim-mid);
    transform: translateX(2px);
  }
}
.row:active { transform: scale(0.99); }
.stage.is-entering .row {
  animation: rowIn 360ms var(--e-glass) both;
  animation-delay: calc(160ms + var(--i, 0) * 50ms);
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.row__avatar {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input-hi);
  color: var(--t1);
  border: 1px solid var(--rim);
  flex-shrink: 0;
}
.row__avatar svg { width: 18px; height: 18px; }
.row__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.row__sub {
  font-size: 11px;
  color: var(--t3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-feature-settings: "tnum" 1;
}
.row__chev {
  color: var(--t3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 240ms var(--e-spring), color 240ms var(--e-out);
}
.row:hover .row__chev { color: var(--t2); transform: translateX(2px); }
.row__chev svg { width: 14px; height: 14px; }

/* ── Pulse hero (2FA awaiting) ─────────────────────────────── */
.pulse {
  position: relative;
  width: 96px; height: 96px;
  margin: 4px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pulse__core {
  position: relative;
  z-index: 2;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-input-hi);
  border: 1px solid var(--rim-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--t1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 10px 30px -8px rgba(0, 0, 0, 0.5);
}
.pulse__core svg { width: 22px; height: 22px; }
.pulse__ring {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  border: 1.4px solid var(--signal);
  opacity: 0;
  animation: ripple 2.8s var(--e-out) infinite;
}
.pulse__ring:nth-child(2) { animation-delay: 0.7s; }
.pulse__ring:nth-child(3) { animation-delay: 1.4s; }
@keyframes ripple {
  0%   { transform: scale(0.6); opacity: 0.55; }
  80%  { opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 16px;
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--rim);
  border-radius: 999px;
  font-size: 12px;
  color: var(--t2);
}
.status-wrap { display: flex; justify-content: center; }
.status-line__dots { display: inline-flex; gap: 3px; }
.status-line__dots span {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--t2);
  animation: dotWave 1.4s ease-in-out infinite;
}
.status-line__dots span:nth-child(2) { animation-delay: 0.16s; }
.status-line__dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotWave {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-2px); }
}

/* Центрируем заголовок на awaiting / setpassword (pulse-стейджах) */
.stage[data-stage="awaiting"] h2,
.stage[data-stage="awaiting"] .lede {
  text-align: center;
}
.eyebrow-wrap {
  display: flex;
  justify-content: center;
}

/* ── Password requirements ─────────────────────────────────── */
.reqs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 4px 0;
  font-size: 12px;
  color: var(--t3);
}
.reqs__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 320ms var(--e-out);
}
.reqs__row[data-ok="true"] { color: var(--success); }
.reqs__icon {
  position: relative;
  width: 14px; height: 14px;
}
.reqs__icon svg {
  width: 14px; height: 14px;
  position: absolute;
  top: 0; left: 0;
  transition: opacity 320ms var(--e-out);
}
.reqs__icon-done { opacity: 0; }
.reqs__row[data-ok="true"] .reqs__icon-empty { opacity: 0; }
.reqs__row[data-ok="true"] .reqs__icon-done  { opacity: 1; }

/* ── Success ───────────────────────────────────────────────── */
.success-hero {
  width: 84px; height: 84px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: var(--success-soft);
  border: 1px solid rgba(107, 214, 138, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}
.success-hero svg { width: 38px; height: 38px; }
.success-hero svg path {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
  animation: checkDraw 520ms var(--e-spring) 180ms forwards;
}
@keyframes checkDraw { to { stroke-dashoffset: 0; } }

.error-hero {
  width: 84px; height: 84px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 106, 106, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
}
.error-hero svg { width: 38px; height: 38px; }

.success-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}
.success-cta-wrap .cta {
  width: auto;
  min-width: 220px;
}
.success-redirect-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--t3);
  font-feature-settings: "tnum" 1;
}

.stage[data-stage="success"] h2,
.stage[data-stage="success"] .lede,
.stage[data-stage="error"] h2,
.stage[data-stage="error"] .lede {
  text-align: center;
}

/* Confetti canvas — на success */
.confetti-canvas {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* ── Footer ────────────────────────────────────────────────── */
.foot {
  padding: 18px 24px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--t4);
  text-transform: uppercase;
  font-feature-settings: "tnum" 1;
}
.foot a { color: var(--t3); text-decoration: none; }
.foot a:hover { color: var(--t1); }

/* ── Reveal on load ────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  -webkit-filter: blur(8px);
  filter: blur(8px);
  transition:
    opacity 800ms var(--e-glass),
    transform 800ms var(--e-glass),
    -webkit-filter 800ms var(--e-glass),
    filter 800ms var(--e-glass);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  -webkit-filter: none;
  filter: none;
}
[data-reveal][data-delay="1"] { transition-delay: 60ms; }
[data-reveal][data-delay="2"] { transition-delay: 140ms; }
[data-reveal][data-delay="3"] { transition-delay: 220ms; }

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ambient::before, .ambient::after { animation: none; }
  .brand__dot::after { animation: none; opacity: 0.4; }
  .pulse__ring { animation: none; opacity: 0.2; }
  .status-line__dots span { animation: none; opacity: 0.6; }
  [data-reveal] {
    opacity: 1; transform: none;
    -webkit-filter: none; filter: none;
    transition: none;
  }
  .stage.is-entering, .stage.is-exiting { animation: none; }
  .stage.is-entering .row { animation: none; }
  .success-hero svg path { animation: none; stroke-dashoffset: 0; }
  .form-error { animation: none; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}

/* ── Mobile tweaks ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { padding: 16px 12px 0; }
  .nav__pill { padding: 7px 14px 7px 12px; gap: 10px; max-width: calc(100vw - 24px); }
  .nav__clock { display: none; }
  .canvas { padding: 32px 12px 40px; }
  .card-out { border-radius: 24px; padding: 6px; }
  .card-in { padding: 22px 18px 20px; border-radius: 18px; }
  .stage h2 { font-size: 22px; line-height: 1.2; }
  .stage .lede { font-size: 13.5px; margin-bottom: 20px; }
  .field { height: 52px; border-radius: 12px; }
  .field__input { font-size: 15px; padding: 18px 14px 4px; }
  .field__label { left: 14px; }
  .field--phone .field__label { left: 90px; }
  .field--phone.is-floating .field__label,
  .field--phone.is-focused .field__label { left: 14px; }
  .cta { padding: 7px 7px 7px 18px; font-size: 14.5px; margin-top: 10px; }
  .cta__circle { width: 34px; height: 34px; }
  .ghost { padding: 7px 7px 7px 18px; font-size: 13.5px; }
  .row { padding: 11px 12px; }
  .row__avatar { width: 36px; height: 36px; }
  .row__title { font-size: 13px; }
  .row__sub { font-size: 10px; }
  .pulse { width: 80px; height: 80px; margin: 0 auto 14px; }
  .pulse__core { width: 50px; height: 50px; }
  .progress { margin-bottom: 18px; }
  .card-footer { margin-top: 18px; padding-top: 14px; }
  .footer-build { display: none; }
  .foot { padding: 14px 16px; font-size: 10px; gap: 10px; }
  .success-hero, .error-hero { width: 72px; height: 72px; }
  .success-hero svg, .error-hero svg { width: 32px; height: 32px; }
  /* dropdown стран на mobile растягивается на весь width поля */
  .iti__dropdown-content {
    border-radius: 12px;
    padding: 6px;
  }
  .iti__country { padding: 8px 10px; }
  .iti__country-list { max-height: 200px; }
}

/* Очень узкие экраны (iPhone SE 1-го поколения и т.п.) */
@media (max-width: 360px) {
  .canvas { padding: 24px 10px 32px; }
  .card-in { padding: 18px 14px 16px; }
  .stage h2 { font-size: 20px; }
  .field--phone .field__input { padding-left: 84px; }
}

/* Fallback для браузеров без backdrop-filter (старый Android Chromium <76) */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav__pill { background: rgba(8, 8, 10, 0.92); }
  .card-in { background: rgba(14, 14, 16, 0.96); }
  .iti__country-list { background: rgba(20, 20, 24, 0.98); }
}
