/* EmailVerifer — дизайн-система. Тёмная тема по умолчанию, светлая — [data-theme=light]. */

:root {
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --accent: #6f5cff;
  --accent-2: #3d9bff;
  --accent-grad: linear-gradient(120deg, #7a5cff 0%, #4f7bff 52%, #25b8ff 100%);
  --mint: #2de2a6;
  --danger: #ff5d73;
  --warn: #ffb84d;
}

:root, :root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-2: #0c0f16;
  --surface: #11141c;
  --surface-2: #171b26;
  --surface-3: #1f2433;
  --border: rgba(255, 255, 255, .075);
  --border-2: rgba(255, 255, 255, .14);
  --text: #f3f5fb;
  --text-2: #c5cadb;
  --muted: #8b91a8;
  --glass: rgba(17, 20, 28, .62);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --shadow-lg: 0 40px 100px rgba(0, 0, 0, .6);
  --card-glow: 0 0 0 1px var(--border), 0 30px 90px rgba(80, 90, 255, .16);
  --focus: 0 0 0 3px rgba(111, 92, 255, .4);
  --overlay: rgba(4, 5, 9, .74);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #fafbfd;
  --bg-2: #f2f4f9;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --surface-3: #e9ecf5;
  --border: #e5e8f1;
  --border-2: #d1d6e6;
  --text: #0d1020;
  --text-2: #394057;
  --muted: #6a7089;
  --glass: rgba(255, 255, 255, .74);
  --shadow-sm: 0 1px 2px rgba(15, 20, 50, .06);
  --shadow: 0 10px 40px rgba(30, 30, 90, .1);
  --shadow-lg: 0 40px 100px rgba(40, 40, 110, .18);
  --card-glow: 0 0 0 1px var(--border), 0 2px 50px rgba(30, 30, 90, .1);
  --focus: 0 0 0 3px rgba(111, 92, 255, .28);
  --overlay: rgba(14, 16, 32, .5);
  --accent: #5b46f0;
  --mint: #0fb383;
  --warn: #d98a12;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0; min-height: 100vh;
  font: 400 16px/1.55 var(--font);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
::selection { background: rgba(111, 92, 255, .4); color: #fff; }
[hidden] { display: none !important; }
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease) !important; }

.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.grad-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Бренд ──────────────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff;
  background: var(--accent-grad); box-shadow: 0 6px 20px rgba(100, 100, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .5s var(--ease-spring);
}
.brand-mark .ic { width: 19px; height: 19px; stroke-width: 2.1; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }

/* ── Кнопки ─────────────────────────────────────────────────────────────────── */
.btn {
  --h: 46px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: var(--h); padding: 0 22px; border-radius: var(--r-pill);
  font-weight: 650; font-size: 15px; letter-spacing: -.005em; white-space: nowrap;
  border: 1px solid transparent; user-select: none;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), border-color .3s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-sm { --h: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { --h: 56px; padding: 0 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-primary {
  color: #fff; background: var(--accent-grad); background-size: 160% 100%; background-position: 0 0;
  box-shadow: 0 8px 28px rgba(95, 100, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 12px 38px rgba(95, 100, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .3); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: rgba(255, 93, 115, .12); color: var(--danger); border-color: rgba(255, 93, 115, .3); }
.btn-danger:hover { background: rgba(255, 93, 115, .2); }
.btn-ink { background: var(--text); color: var(--bg); }
.btn-ink:hover { transform: translateY(-1px); opacity: .92; }
.btn .spin { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); color: var(--text-2); transition: background .25s, color .25s, transform .25s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

.link-btn { color: var(--accent-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color .2s; }
.link-btn:hover:not([disabled]) { text-decoration-color: currentColor; }
.link-btn[disabled] { color: var(--muted); cursor: default; }

/* ── Язык ───────────────────────────────────────────────────────────────────── */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 650; color: var(--text-2); text-transform: uppercase; transition: background .25s, color .25s; }
.lang-btn:hover { background: var(--surface-2); color: var(--text); }
.menu { position: absolute; z-index: 70; min-width: 164px; padding: 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); }
.menu.up { bottom: calc(100% + 8px); } .menu.down { top: calc(100% + 8px); } .menu.end { right: 0; } .menu.start { left: 0; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; font-weight: 550; color: var(--text-2); text-align: left; transition: background .2s, color .2s; }
.menu button:hover, .menu a:hover { background: var(--surface-2); color: var(--text); }
.menu button.is-on { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.menu .ic { width: 17px; height: 17px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }

/* ── Поля ───────────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 7px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; height: 46px; padding: 0 15px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b91a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.textarea { height: auto; padding: 13px 15px; min-height: 120px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-2)); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input-lg { height: 56px; font-size: 18px; font-weight: 600; border-radius: var(--r); }
.input-search { padding-left: 42px; }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 40px; cursor: pointer; font-size: 14.5px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); transition: background .3s var(--ease), border-color .3s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .35s var(--ease-spring); }
.switch input:checked + i { background: var(--accent); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: var(--focus); }

.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check i { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--border-2); background: var(--surface-2); transition: background .25s, border-color .25s; }
.check i::after { content: ''; width: 10px; height: 6px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; rotate: -45deg; scale: 0; transition: scale .25s var(--ease-spring); }
.check input:checked + i { background: var(--accent); border-color: transparent; }
.check input:checked + i::after { scale: 1; }
.check input:focus-visible + i { box-shadow: var(--focus); }
.check a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.seg button { height: 32px; padding: 0 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .25s, color .25s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); }

/* ── Бейджи / статусы ──────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; color: var(--text-2); background: var(--surface-3); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.valid { color: var(--mint); background: color-mix(in srgb, var(--mint) 14%, transparent); }
.badge.invalid { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.badge.risky { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.badge.pending { color: var(--muted); }
.badge.accent { color: var(--accent-2); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--mint); box-shadow: 0 0 0 0 rgba(45, 226, 166, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(45, 226, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(45, 226, 166, 0); } }

/* ── Модальные окна ────────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: var(--overlay); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .25s; }
.overlay.is-closing { opacity: 0; transition: opacity .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(var(--w, 460px), 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 30px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--card-glow), var(--shadow-lg); animation: modal-in .45s var(--ease); scrollbar-width: thin; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.modal h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.modal .lead { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.doc { line-height: 1.7; font-size: 15px; color: var(--text-2); }
.doc h3 { margin: 26px 0 8px; font-size: 16.5px; letter-spacing: -.02em; color: var(--text); }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 12px; padding-left: 18px; }
.doc li { margin: 0 0 6px; }
.doc-req { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }

/* ── Тосты ─────────────────────────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; display: grid; gap: 10px; translate: -50% 0; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); font-size: 14.5px; font-weight: 550; background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: toast-in .5s var(--ease-spring); pointer-events: auto; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: .3s; }
.toast .ic { width: 19px; height: 19px; color: var(--mint); }
.toast.err .ic { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }

/* ── Скелетоны ─────────────────────────────────────────────────────────────── */
.skeleton { border-radius: var(--r-sm); background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -220% 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

/* ── Окно входа ─────────────────────────────────────────────────────────────── */
.auth { display: grid; gap: 18px; text-align: center; }
.auth h2 { margin: 0; } .auth .lead { margin: -10px 0 4px; overflow-wrap: anywhere; }
.auth .field, .auth-consent { text-align: left; }
.auth-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 0; border-radius: 20px; color: #fff; background: var(--accent-grad); box-shadow: 0 12px 34px rgba(95, 100, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .3); animation: float 5s ease-in-out infinite; }
.auth-icon .ic { width: 28px; height: 28px; }
@keyframes float { 50% { transform: translateY(-5px) rotate(-3deg); } }
.auth-hint { min-height: 0; margin: 8px 0 0; font-size: 13px; font-weight: 550; color: var(--muted); }
.auth-error { min-height: 20px; margin: -6px 0 0; font-size: 13px; font-weight: 550; color: var(--danger); }
.auth-resend { margin: 0; font-size: 13.5px; color: var(--muted); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.otp-box { width: 100%; aspect-ratio: 1 / 1.18; max-height: 66px; text-align: center; font: 700 26px var(--mono); border-radius: var(--r-sm); background: var(--surface-2); border: 1.5px solid var(--border-2); color: var(--text); caret-color: var(--accent); transition: border-color .2s, box-shadow .2s, transform .25s var(--ease-spring); }
.otp-box:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); transform: translateY(-2px); }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 15%, 55%, 90% { transform: translateX(-7px); } 35%, 75% { transform: translateX(7px); } }

/* ── Range slider (лендинг и кабинет) ─────────────────────────────────────── */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; outline: none; background: linear-gradient(90deg, var(--accent) var(--p, 55%), var(--surface-3) var(--p, 55%)); cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); box-shadow: 0 4px 16px rgba(95, 100, 255, .55); transition: transform .25s var(--ease-spring); }
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); }
.range:focus-visible { box-shadow: var(--focus); }
