/*
==============================================================================
auth.css — Shared styles for all authentication pages (REDESIGN)
==============================================================================
Same class names as before, but now fully token-driven so auth pages follow
the shared light/dark theme from base.css. No auth template markup changed.
==============================================================================
*/

/* ── Layout ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 66px);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 20px;
  background: var(--paper);
  position: relative; overflow: hidden;
}
.auth-wrap::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--brand-soft), transparent 65%);
  pointer-events: none; filter: blur(60px);
}

/* ── Card ────────────────────────────────────────────────── */
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

/* ── Brand mark ──────────────────────────────────────────── */
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.auth-brand-logo { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; }
.auth-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-brand-name { font-size: 1.15rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.auth-brand-beta {
  padding: 2px 7px; border-radius: 999px;
  background: rgba(183,121,31,.12); border: 1px solid rgba(183,121,31,.28);
  font-size: 9px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--amber);
}

/* ── Heading + sub ───────────────────────────────────────── */
.auth-title {
  font-size: 1.55rem; font-weight: 800; color: var(--ink);
  letter-spacing: -.03em; margin: 0 0 6px; text-align: center;
  background: none; -webkit-text-fill-color: currentColor;
}
.auth-sub { font-size: .9rem; color: var(--subtle); text-align: center; margin: 0 0 28px; line-height: 1.5; }

/* ── Alerts ──────────────────────────────────────────────── */
.auth-alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .85rem; font-weight: 500; line-height: 1.5; }
.auth-alert.error   { background: rgba(220,38,38,.08);  border: 1px solid rgba(220,38,38,.24);  color: #dc2626; }
.auth-alert.success { background: var(--green-soft);     border: 1px solid transparent;          color: var(--green); }
:root[data-theme="dark"] .auth-alert.error { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.28); color: #f87171; }

/* ── Form layout ─────────────────────────────────────────── */
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .auth-grid { grid-template-columns: 1fr; } }
.auth-field { margin-bottom: 14px; }
.auth-field:last-of-type { margin-bottom: 22px; }
.auth-field-submit { margin-top: 22px; }
.auth-label { display: block; margin-bottom: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.auth-label.required::after { content: " *"; color: #dc2626; }

/* ── Inputs ──────────────────────────────────────────────── */
.auth-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: .95rem; color: var(--ink);
  font-family: inherit; outline: none;
  transition: border-color .15s, background .15s;
}
.auth-input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-input::placeholder { color: var(--subtle); }

select.auth-input, #id_country {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%238a8f9c'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
select.auth-input option, #id_country option { background: var(--surface); color: var(--ink); }
#id_country:focus { border-color: var(--brand); }

/* ── Password toggle ─────────────────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap .auth-input { padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--subtle); border-radius: 8px; transition: color .14s, background .14s;
}
.pw-toggle:hover { color: var(--text); background: var(--hair); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pw-toggle svg { width: 18px; height: 18px; }

/* ── Primary button ──────────────────────────────────────── */
.auth-btn {
  width: 100%; padding: 12px;
  background: var(--brand); color: #fff;
  border: none; border-radius: 10px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  font-family: inherit; text-decoration: none; display: block; text-align: center;
  box-shadow: 0 6px 20px rgba(79,70,229,.28);
  transition: background .18s, transform .12s, box-shadow .18s;
}
.auth-btn:hover { background: var(--brand-2); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 30px rgba(79,70,229,.4); text-decoration: none; }
.auth-btn:active { transform: scale(.98); }
:root[data-theme="dark"] .auth-btn { color: #0a0c14; }

.auth-btn-ghost {
  width: 100%; padding: 11px; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px;
  font-size: .88rem; font-weight: 600; cursor: pointer; font-family: inherit;
  margin-top: 10px; text-decoration: none; display: block; text-align: center;
  transition: border-color .15s, color .15s;
}
.auth-btn-ghost:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

.auth-btn-check {
  width: 100%; padding: 12px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid var(--brand-line); border-radius: 10px;
  font-size: .88rem; font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 10px; text-decoration: none;
  transition: background .18s, border-color .18s;
}
.auth-btn-check:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); border-color: var(--brand); text-decoration: none; color: var(--brand); }

/* ── Footer links ────────────────────────────────────────── */
.auth-footer { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-top: 20px; font-size: .88rem; color: var(--subtle); }
.auth-footer a { color: var(--brand); font-weight: 600; transition: color .14s; }
.auth-footer a:hover { color: var(--brand-2); text-decoration: none; }

/* ── Free beta note ──────────────────────────────────────── */
.auth-free-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.auth-free-note::before { content: '✓'; color: var(--green); font-weight: 800; }

/* ── Registration success — animated envelope ────────────── */
.email-icon-wrap {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
  animation: auth-pulse 2.5s ease-in-out infinite;
}
@keyframes auth-pulse { 0%,100% { box-shadow: 0 0 0 0 var(--brand-soft); } 50% { box-shadow: 0 0 0 10px transparent; } }
.email-icon-wrap svg { width: 32px; height: 32px; }
.email-highlight {
  display: inline-block; margin: 12px 0 20px; padding: 8px 16px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 8px; font-size: .9rem; font-weight: 700; color: var(--brand);
  letter-spacing: .1px; word-break: break-all;
}
.spam-tip { margin-top: 18px; font-size: .8rem; color: var(--subtle); line-height: 1.5; }
.spam-tip a { color: var(--brand); font-weight: 600; text-decoration: none; }
.spam-tip a:hover { color: var(--brand-2); }

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--subtle); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
