/* ============================================================
   Denver VPN — Auth page (relies on denver.css tokens)
   ============================================================ */

.auth-body { min-height: 100vh; }
[hidden] { display: none !important; }

.auth {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
}
.auth__glow {
  position: absolute; top: -25%; left: -10%; width: 70%; height: 80%;
  background: radial-gradient(50% 50% at 40% 40%, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ---------- brand panel ---------- */
.auth__brand-panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  padding: clamp(40px, 6vw, 80px);
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface-1), var(--bg) 60%);
}
.brand--lg { gap: 13px; }
.brand--lg .brand__logo { width: 40px; height: 40px; }
.brand--lg .brand__name { font-size: 1.375rem; }

.auth__headline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.4vw, 3rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.025em;
  margin: auto 0 0;
}
.auth__sub { font-size: 1.125rem; color: var(--text-2); margin: 18px 0 0; max-width: 40ch; }

.auth__props { display: flex; flex-direction: column; gap: 14px; margin: 36px 0 auto; }
.auth__props li { display: flex; align-items: flex-start; gap: 12px; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; max-width: 44ch; }
.auth__props li::before {
  content: ""; width: 20px; height: 20px; flex: none; margin-top: 1px; border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C6F633' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 12px;
}
.auth__panel-foot { font-size: 0.8125rem; color: var(--muted); margin: 40px 0 0; }

/* ---------- form side ---------- */
.auth__main {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(32px, 5vw, 64px);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card__brand { display: none; margin-bottom: 28px; }

/* tabs */
.auth-tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 4px; margin-bottom: 32px;
}
.auth-tabs__btn {
  position: relative; z-index: 1;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem;
  color: var(--text-2); padding: 10px; border-radius: var(--r-full);
  transition: color .2s ease;
}
.auth-tabs__btn.is-active { color: var(--accent-ink); }
.auth-tabs__ind {
  position: absolute; z-index: 0; top: 4px; left: 4px;
  width: calc(50% - 4px); height: calc(100% - 8px);
  background: var(--accent); border-radius: var(--r-full);
  box-shadow: 0 0 16px var(--accent-glow);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.auth-tabs[data-mode="signup"] .auth-tabs__ind { transform: translateX(100%); }

/* form */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form__title { font-size: 1.5rem; font-weight: 600; margin: 0 0 4px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); }
.field__wrap { position: relative; display: flex; }
.field__input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body); font-size: 0.9375rem;
  padding: 13px 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field__wrap .field__input { padding-right: 46px; }
.field__input::placeholder { color: var(--muted); }
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface-1); }
.field__input.is-error { border-color: #F0664E; box-shadow: 0 0 0 3px color-mix(in srgb, #F0664E 18%, transparent); }

.field__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; background: none; cursor: pointer;
  color: var(--muted); border-radius: var(--r-sm); transition: color .15s ease;
}
.field__toggle:hover { color: var(--text-2); }
.field__toggle.is-on { color: var(--accent); }
.field__toggle svg { width: 19px; height: 19px; }

/* row: remember + forgot */
.auth-form__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-form__forgot { font-size: 0.875rem; color: var(--accent); font-weight: 500; }
.auth-form__forgot:hover { text-decoration: underline; }

/* checkbox */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.875rem; color: var(--text-2); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 19px; height: 19px; flex: none; border-radius: 6px;
  border: 1.5px solid var(--border-strong); background: var(--surface-2);
  transition: background .15s ease, border-color .15s ease;
  background-repeat: no-repeat; background-position: center; background-size: 12px;
}
.check input:checked + .check__box {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0B0D' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px var(--accent-soft); }
.check--terms { align-items: flex-start; line-height: 1.45; }
.check--terms .check__box { margin-top: 1px; }
.check--terms a { color: var(--accent); }
.check--terms a:hover { text-decoration: underline; }

.btn--block { margin-top: 4px; }

/* Telegram button */
.btn--tg { background: #2AABEE; color: #fff; border: 0; }
.btn--tg:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(42,171,238,0.32); background: #239fe0; }
.btn--tg:active { transform: translateY(0); box-shadow: none; background: #1d8fcc; }
.tg-ic { width: 20px; height: 20px; flex: none; }

/* Google button */
.btn--google { background: #fff; color: #1f1f1f; border: 1px solid rgba(0,0,0,.12); }
.btn--google:hover { background: #f5f5f5; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.btn--google:active { transform: translateY(0); box-shadow: none; }
.g-ic { width: 19px; height: 19px; flex: none; }

/* message */
.auth-form__msg { font-size: 0.875rem; margin: 0; padding: 11px 14px; border-radius: var(--r-md); }
.auth-form__msg.is-error { background: color-mix(in srgb, #F0664E 12%, transparent); color: #F0664E; }
.auth-form__msg.is-ok { background: var(--accent-soft); color: var(--accent); }

/* divider */
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.8125rem; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* switch line */
.auth-card__switch { text-align: center; font-size: 0.9375rem; color: var(--text-2); margin: 24px 0 0; }
.linklike { background: none; border: 0; cursor: pointer; color: var(--accent); font-weight: 600; font-family: var(--font-body); font-size: 0.9375rem; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand-panel { display: none; }
  .auth-card__brand { display: inline-flex; }
  .auth__glow { width: 120%; height: 50%; top: -15%; left: -10%; }
}
@media (max-width: 420px) {
  .auth__main { padding: 28px 18px; }
}

/* ============================================================
   Auth v2 — steps, field errors, toasts
   ============================================================ */

/* field-level error text (under the field) */
.field__err {
  font-size: 0.8125rem; color: #F0664E; line-height: 1.35; margin-top: -1px;
  display: flex; align-items: center; gap: 6px;
}
.field__err::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F0664E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16.5v.01'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* back link (← Изменить email) */
.auth-back {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  background: none; border: 0; cursor: pointer; padding: 2px 0; margin: -4px 0 2px;
  color: var(--text-2); font-family: var(--font-body); font-weight: 500; font-size: 0.875rem;
  transition: color .15s ease;
}
.auth-back:hover { color: var(--text); }
.auth-back svg { width: 16px; height: 16px; }

/* step note ("Код отправлен на …") */
.auth-step-note {
  font-size: 0.875rem; color: var(--text-2); line-height: 1.5; margin: 0;
  padding: 11px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--border);
}

/* code input — centered, spaced */
.field__input--code {
  text-align: center; font-family: var(--font-mono); font-size: 1.25rem;
  letter-spacing: 8px; padding-left: 15px;
}

/* tg-reset link */
.auth-tg-reset { display: block; text-align: center; margin-top: -4px; font-size: 0.875rem; font-weight: 500; }

/* ── Toasts (top-right) ── */
.toast-host {
  position: fixed; top: 18px; right: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 0.9rem; line-height: 1.35;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05);
  opacity: 0; transform: translateX(20px) scale(.98);
  transition: opacity .26s ease, transform .26s cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toast.is-in { opacity: 1; transform: translateX(0) scale(1); }
.toast__ic { display: inline-flex; flex: none; }
.toast__ic svg { width: 19px; height: 19px; }
.toast--ok    .toast__ic { color: #4ade80; }
.toast--error .toast__ic { color: #F0664E; }
.toast--info  .toast__ic { color: var(--accent); }
.toast__txt { flex: 1; }
.toast__spin {
  width: 17px; height: 17px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: toast-spin .7s linear infinite;
}
@keyframes toast-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  .toast-host { top: 12px; right: 12px; left: 12px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity .2s ease; transform: none; }
  .toast.is-in { transform: none; }
  .toast__spin { animation-duration: 1.2s; }
}
