/* cave-id auth pages — dark theme, no-JS, matches cavefinder.app palette.
   DESIGN.md §10.6 (no-JS requirement) and §10.7 (branded dark theme). */

:root {
  --bg-primary: #090d12;
  --bg-card: #11171f;
  --bg-input: #0b1017;
  --border: #1d2632;
  --border-focus: #00d4ff;
  --text-primary: #e6edf3;
  --text-muted: #8aa0b3;
  --accent: #00d4ff;
  --accent2: #39ff8c;
  --danger: #ff6b6b;
  --danger-bg: #2a1012;
  --info: #4fc3f7;
  --info-bg: #0f1d27;
  --radius: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.auth-shell {
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-header { text-align: center; }
.auth-brand {
  display: inline-block;
  font-family: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-primary);
}
.auth-brand-mark { color: var(--text-primary); }
.auth-brand-accent { color: var(--accent); }
.auth-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}
.auth-lede {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field > span {
  font-size: 13px;
  color: var(--text-muted);
}
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 100ms ease;
}
.auth-field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}
.auth-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.auth-button {
  display: inline-block;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 100ms ease, border-color 100ms ease;
}
.auth-button-primary {
  background: var(--accent);
  color: #031018;
}
.auth-button-primary:hover { background: #3de4ff; }

.auth-link-row {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.auth-link-row a { color: var(--accent); text-decoration: none; }
.auth-link-row a:hover { text-decoration: underline; }

.auth-flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}
.auth-flash-error {
  background: var(--danger-bg);
  border-color: #5a1d20;
  color: var(--danger);
}
.auth-flash-info {
  background: var(--info-bg);
  border-color: #1c3a4d;
  color: var(--info);
}

.auth-footer {
  margin-top: 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-footer a { color: var(--text-muted); text-decoration: none; }
.auth-footer a:hover { color: var(--accent); }

/* /account page — stacked sections with dividers between profile / password /
   email / delete. Each section owns its own form so JS-free users can submit
   one thing at a time without losing progress elsewhere. */
.auth-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}
.auth-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.auth-section-danger {
  border-top-color: #5a1d20;
}
.auth-h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 0 0 12px 0;
}
.auth-section-danger .auth-h2 { color: var(--danger); }

.auth-pill {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(57, 255, 140, 0.12);
  color: var(--accent2);
  border: 1px solid rgba(57, 255, 140, 0.4);
  vertical-align: middle;
  text-transform: uppercase;
}
.auth-pill-warn {
  background: rgba(255, 176, 59, 0.12);
  color: #ffb03b;
  border-color: rgba(255, 176, 59, 0.4);
}

.auth-button-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.auth-button-danger:hover { background: rgba(255, 76, 84, 0.08); }

.auth-link-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.auth-link-button:hover { color: var(--accent); text-decoration: underline; }
