/* css/auth.css — standalone auth pages (register, login, verify) */

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

:root {
  --clr-bg:       #0f1117;
  --clr-surface:  #1a1d27;
  --clr-surface2: #22263a;
  --clr-border:   #2e3347;
  --clr-text:     #e8ecf4;
  --clr-muted:    #7a8099;
  --clr-accent:   #4aaca7;
  --clr-accent2:  #5668c8;
  --clr-error:    #ef4444;
  --clr-ok:       #22c55e;
  --radius:       10px;
  --font:         'Segoe UI', system-ui, sans-serif;
}
[data-theme="light"] {
  --clr-bg:       #f4f6fb;
  --clr-surface:  #ffffff;
  --clr-surface2: #edf0f7;
  --clr-border:   #d8dde8;
  --clr-text:     #1a1d27;
  --clr-muted:    #6b7399;
}

html, body {
  min-height: 100vh;
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
}

/* ── Minimal header ──────────────────────────────────────────── */
.auth-header {
  height: 56px;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.auth-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}
.auth-logo { display: flex; align-items: center; text-decoration: none; }
.auth-logo svg { display: block; }
.auth-header-actions { display: flex; align-items: center; gap: 8px; }
.auth-header-link {
  font-size: .82rem; font-weight: 500;
  color: var(--clr-muted); text-decoration: none;
  padding: 6px 14px; border-radius: 7px;
  transition: color .15s, background .15s;
}
.auth-header-link:hover { color: var(--clr-text); background: var(--clr-surface2); }
.auth-header-link.primary {
  background: var(--clr-accent); color: #fff; font-weight: 600;
}
.auth-header-link.primary:hover { background: #3d9a96; }
.theme-toggle-btn {
  background: none; border: 1px solid var(--clr-border);
  color: var(--clr-muted); font-size: 1rem;
  width: 34px; height: 34px; border-radius: 7px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.theme-toggle-btn:hover { background: var(--clr-surface2); }

/* ── Page layout ─────────────────────────────────────────────── */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 40px 16px 60px;
}

/* ── Card ────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  padding: 36px 36px 32px;
}
.auth-card-title {
  font-size: 1.35rem; font-weight: 800;
  color: var(--clr-text); margin-bottom: 4px; letter-spacing: -.3px;
}
.auth-card-sub {
  font-size: .85rem; color: var(--clr-muted); margin-bottom: 28px;
}

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: .8rem; font-weight: 600;
  color: var(--clr-muted); letter-spacing: .4px; text-transform: uppercase;
}
.field input {
  height: 44px; padding: 0 14px;
  background: var(--clr-surface2); border: 1px solid var(--clr-border);
  border-radius: 8px; color: var(--clr-text); font-size: .95rem;
  outline: none; transition: border-color .15s;
  font-family: var(--font); width: 100%;
}
.field input:focus { border-color: var(--clr-accent); }
.field input.err   { border-color: var(--clr-error); }

/* Password field with show/hide toggle */
.field-pw { position: relative; }
.field-pw input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--clr-muted); padding: 4px; display: flex; align-items: center;
  transition: color .15s;
}
.pw-toggle:hover { color: var(--clr-text); }
.pw-toggle svg { width: 18px; height: 18px; }

/* ── Alerts ──────────────────────────────────────────────────── */
.auth-alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: .875rem; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 10px;
}
.auth-alert.error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25); color: #f87171; }
.auth-alert.success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25); color: #4ade80; }
.auth-alert.info    { background: rgba(74,172,167,.1); border: 1px solid rgba(74,172,167,.25); color: var(--clr-accent); }
.auth-alert-icon { flex-shrink: 0; margin-top: 1px; font-size: 1rem; }

/* ── Submit button ───────────────────────────────────────────── */
.auth-btn {
  height: 46px; width: 100%; border: none; border-radius: 9px;
  background: var(--clr-accent); color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  letter-spacing: .2px; transition: background .15s, transform .1s;
  font-family: var(--font);
}
.auth-btn:hover    { background: #3d9a96; }
.auth-btn:active   { transform: scale(.98); }
.auth-btn:disabled { background: var(--clr-surface2); color: var(--clr-muted); cursor: not-allowed; }

/* ── OAuth buttons ───────────────────────────────────────────── */
.oauth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: .78rem; color: var(--clr-muted);
  margin: 4px 0;
}
.oauth-divider::before, .oauth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--clr-border);
}
.oauth-btn {
  height: 44px; width: 100%; border: 1px solid var(--clr-border);
  border-radius: 9px; background: var(--clr-surface2);
  color: var(--clr-text); font-size: .9rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 10px; font-family: var(--font); transition: background .15s;
  text-decoration: none;
}
.oauth-btn:hover { background: var(--clr-border); }
.oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.oauth-btn.soon { opacity: .45; cursor: not-allowed; }

/* ── Footer link ─────────────────────────────────────────────── */
.auth-footer {
  margin-top: 20px; text-align: center;
  font-size: .85rem; color: var(--clr-muted);
}
.auth-footer a { color: var(--clr-accent); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Verify page states ──────────────────────────────────────── */
.auth-state-card {
  text-align: center; padding: 48px 36px;
}
.auth-state-icon { font-size: 3rem; margin-bottom: 16px; }
.auth-state-title {
  font-size: 1.3rem; font-weight: 800; color: var(--clr-text);
  margin-bottom: 8px; letter-spacing: -.3px;
}
.auth-state-msg {
  font-size: .9rem; color: var(--clr-muted);
  line-height: 1.6; margin-bottom: 24px;
}
.auth-state-btn {
  display: inline-block; padding: 11px 24px;
  background: var(--clr-accent); color: #fff; font-weight: 700;
  border-radius: 8px; text-decoration: none; font-size: .9rem;
  transition: background .15s;
}
.auth-state-btn:hover { background: #3d9a96; }
.auth-state-btn.secondary {
  background: var(--clr-surface2); color: var(--clr-text);
  border: 1px solid var(--clr-border); margin-left: 8px;
}
.auth-state-btn.secondary:hover { background: var(--clr-border); }

/* ── Password hint ───────────────────────────────────────────── */
.pw-hint { font-size: .76rem; color: var(--clr-muted); margin-top: -4px; }

/* ── Loading spinner on submit ───────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.btn-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
