/* ─────────────────────────────────────────────────────────────
   Portal auth shell — shared styles for the unauthenticated
   portal pages (login, forgot-password, reset-password).

   These pages can't use shell.css (which assumes the sidebar +
   topbar layout reserved for authenticated portal views), but
   they DO share the same token palette + nav + theme-toggle
   chrome. Centralising it here:

     - kills the ~80 lines of identical CSS that lived inline in
       each of the three auth pages,
     - guarantees the dark-mode tokens stay in lock-step with
       shell.css,
     - makes future visual tweaks a one-file edit.

   Theme is applied by js/theme.js on first paint (it reads
   pedal.theme from localStorage then falls back to prefers-
   color-scheme), so this stylesheet only needs to define the
   :root and [data-theme="dark"] palettes — the script handles
   activation.
   ───────────────────────────────────────────────────────────── */

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

:root {
  --primary: #0f172a;
  --accent: #e3a341;
  --accent-hover: #d4922e;
  --accent-bg: rgba(227, 163, 65, 0.15);
  --text: #475569;
  --text-dark: #0f172a;
  --text-muted: #94a3b8;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-warm: #faf9f5;
  --border: #e2e8f0;
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.12);
  --error: #ef4444;
  --error-bg: #fef2f2;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --radius: 8px;
  color-scheme: light;
}

/* Dark theme — mirrors portal/shell.css so the user's preference
   carries seamlessly across marketing → auth → authenticated. */
[data-theme="dark"] {
  --primary: #f8fafc;
  --accent: #e3a341;
  --accent-hover: #f2b553;
  --accent-bg: rgba(227, 163, 65, 0.22);
  --text: #cbd5e1;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --bg: #111827;
  --bg-soft: #1e293b;
  --bg-warm: #0b1120;
  --border: #1f2937;
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.16);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.14);
  --nav-bg: rgba(17, 24, 39, 0.85);
  color-scheme: dark;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-warm);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--text-dark);
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon { width: 32px; height: 32px; }

.logo-wordmark {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
}

.nav-back {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--accent); }

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dark);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Shared primary button (used as .btn-primary AND .btn-signin) ── */
.btn-primary,
.btn-signin {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  /* Pinned dark ink for consistent contrast against amber in both themes. */
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-primary:hover,
.btn-signin:hover {
  background: var(--accent-hover);
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227, 163, 65, 0.3);
}

.btn-primary:active,
.btn-signin:active { transform: translateY(0); }

.btn-primary:disabled,
.btn-signin:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Shared back link ── */
.back-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.back-link:hover { color: var(--accent); }

/* ── Card container — used for login-card, reset cards, etc.
       Pages can layer page-specific styles on top.       ── */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 48px 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

[data-theme="dark"] .card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Form groups ── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-soft);
  transition: all 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(227, 163, 65, 0.15);
}

.form-group input::placeholder { color: var(--text-muted); }

/* ── Alerts — generic surface used by both the request-reset
       success state and the inline error/notice copy.    ── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  line-height: 1.5;
}

.alert.error {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--error);
}

.alert.success {
  background: var(--green-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
}

[data-theme="dark"] .alert.success {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.35);
}

/* Responsive — single shared breakpoint for the auth surface. */
@media (max-width: 480px) {
  nav { padding: 16px 24px; }
  .card { padding: 36px 24px; }
}
