/* ================================================================
   Handstand Tracker — Mobile-first, dark theme
   Fonts: Plus Jakarta Sans (headings) + Source Sans 3 (body)
   ================================================================ */

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

:root {
  --navy: #0a0f1a;
  --dark: #111827;
  --card: #161d2f;
  --card-border: rgba(255,255,255,0.06);
  --accent: #2d8bc9;
  --accent2: #60a5fa;
  --accent-glow: rgba(45,139,201,0.15);
  --success: #22c55e;
  --warn: #f59e0b;
  --error: #ef4444;
  --text: #e2e8f0;
  --sub: #94a3b8;
  --muted: #64748b;
  --light: #f8fafc;
  --border: rgba(255,255,255,0.08);
  --heading: 'Plus Jakarta Sans', sans-serif;
  --body: 'Source Sans 3', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
  --text-heading: #ffffff;
  --spinner-track: rgba(255,255,255,0.3);
  --spinner-top: #fff;
  --nav-bg: rgba(10,15,26,0.92);
  --alert-error-text: #fca5a5;
  --alert-success-text: #86efac;
}

/* Light mode: dark text on light backgrounds for visibility */
@media (prefers-color-scheme: light) {
  :root {
    --navy: #f1f5f9;
    --dark: #e2e8f0;
    --card: #ffffff;
    --card-border: rgba(0,0,0,0.08);
    --accent: #0369a1;
    --accent2: #0284c7;
    --accent-glow: rgba(2,132,199,0.12);
    --text: #0f172a;
    --sub: #475569;
    --muted: #64748b;
    --light: #0f172a;
    --border: rgba(0,0,0,0.1);
    --text-heading: #0f172a;
    --spinner-track: rgba(0,0,0,0.15);
    --spinner-top: #0f172a;
    --nav-bg: rgba(255,255,255,0.92);
    --alert-error-text: #b91c1c;
    --alert-success-text: #15803d;
  }
}

/* Light theme */
[data-theme="light"] {
  --navy: #f0f4f8;
  --dark: #e2e8f0;
  --card: #ffffff;
  --card-border: rgba(0,0,0,0.08);
  --accent: #1d6fa5;
  --accent2: #0369a1;
  --accent-glow: rgba(29,111,165,0.1);
  --text: #1e293b;
  --sub: #475569;
  --muted: #64748b;
  --light: #0f172a;
  --border: rgba(0,0,0,0.08);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--navy);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

h1, h2, h3, h4 { font-family: var(--heading); line-height: 1.2; }

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--heading);
  font-weight: 800; font-size: 0.8rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--light); text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.nav-user { font-size: 0.8rem; color: var(--sub); display: none; }
.nav-icon { font-size: 1.1rem; text-decoration: none; margin-right: 0.5rem; cursor: pointer; opacity: 0.7; }
.nav-icon:hover { opacity: 1; }
.nav-link { font-size: 0.75rem; color: var(--sub); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--text); text-decoration: none; }
@media (min-width: 640px) { .nav-user { display: inline; } .nav { padding: 0.75rem 1.5rem; } }

/* ===== MAIN / CONTAINER ===== */
.main { padding-bottom: env(safe-area-inset-bottom, 0); }
.container { max-width: 640px; margin: 0 auto; padding: 1rem; }
@media (min-width: 768px) { .container { padding: 1.5rem 2rem; max-width: 720px; } }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
}
.auth-brand {
  font-family: var(--heading); font-weight: 800; font-size: 0.7rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--light); margin-bottom: 1.5rem;
}
.auth-brand span { color: var(--accent); }
.auth-card h1 { font-size: 1.4rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.25rem; }
.auth-sub { font-size: 0.9rem; color: var(--sub); margin-bottom: 1.25rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.5rem; }
.auth-form label { font-size: 0.8rem; font-weight: 600; color: var(--sub); margin-top: 0.25rem; }
.auth-form input {
  padding: 0.65rem 0.75rem;
  background: var(--navy); border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-size: 0.95rem; font-family: var(--body);
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.auth-form button { margin-top: 0.75rem; }
.auth-footer { text-align: center; font-size: 0.85rem; color: var(--sub); margin-top: 1.25rem; }
.auth-footer-links { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.auth-footer-links a { margin: 0 0.15rem; }
.auth-dev-reset { margin-top: 0.75rem; padding: 0.65rem 0.85rem; border-radius: var(--radius); font-size: 0.8rem; color: var(--sub); background: rgba(255,255,255,0.06); border: 1px dashed rgba(255,255,255,0.15); }
.auth-dev-reset a { color: var(--accent); }

/* ===== ALERTS ===== */
.alert { padding: 0.65rem 0.85rem; border-radius: var(--radius); font-size: 0.85rem; margin-bottom: 0.75rem; }
.alert-error { background: rgba(239,68,68,0.12); color: var(--alert-error-text); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(34,197,94,0.12); color: var(--alert-success-text); border: 1px solid rgba(34,197,94,0.2); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--heading); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.04em;
  border: none; border-radius: var(--radius); cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(45,139,201,0.3); }
.btn-accent { background: var(--success); color: white; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--sub); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.75rem; }
.btn-full { width: 100%; }
.btn-icon {
  background: none; border: none; color: var(--muted); font-size: 1.2rem;
  cursor: pointer; padding: 0.25rem 0.5rem; line-height: 1;
}
.btn-icon:hover { color: var(--error); }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-family: var(--heading); font-weight: 600; font-size: 0.65rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 3px;
}
.badge-accent { background: var(--accent-glow); color: var(--accent2); border: 1px solid rgba(45,139,201,0.25); }
.badge-success { background: rgba(34,197,94,0.12); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }

/* ===== DASHBOARD HERO ===== */
.dashboard-hero {
  margin: -1rem -1rem 1.25rem -1rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  max-height: 200px;
}
.dashboard-hero-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center top;
}
@media (min-width: 768px) {
  .dashboard-hero { margin-left: -1.5rem; margin-right: -1.5rem; margin-bottom: 1.5rem; }
  .dashboard-hero-img { height: 240px; }
  .dashboard-hero { max-height: 240px; }
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 0.75rem 0.5rem; text-align: center;
}
.stat-num { font-family: var(--heading); font-weight: 800; font-size: 1.5rem; color: var(--text-heading); line-height: 1.1; }
.stat-label { font-size: 0.65rem; color: var(--sub); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-top: 0.15rem; }

/* ===== SECTION HEADING ===== */
.section-heading {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin: 1.5rem 0 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ===== LEVEL GRID (dashboard) ===== */
.level-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.level-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 0;
  overflow: hidden;
  transition: all 0.2s; text-decoration: none; color: inherit;
}
.level-card:hover { text-decoration: none; border-color: var(--accent); background: rgba(45,139,201,0.04); }
.level-card--current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--accent-glow); }
.level-card--done { opacity: 0.85; }
.level-card--done:hover { opacity: 1; }
.level-card--locked { opacity: 0.5; pointer-events: none; }
.level-card-thumb {
  flex-shrink: 0; width: 72px; height: 72px;
  background: var(--navy); overflow: hidden;
}
.level-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.level-card-num {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--heading); font-weight: 800; font-size: 0.85rem;
  background: var(--accent-glow); color: var(--accent2); border-radius: 50%;
}
.level-card--done .level-card-num { background: rgba(34,197,94,0.15); color: var(--success); }
.level-card-body { flex: 1; min-width: 0; padding: 0.6rem 0.5rem 0.6rem 0; }
.level-card-title { font-family: var(--heading); font-weight: 700; font-size: 0.9rem; color: var(--text-heading); }
.level-card-sub { font-size: 0.75rem; color: var(--sub); margin-top: 0.1rem; }
.level-card-arrow { color: var(--muted); font-size: 1.25rem; line-height: 1; font-weight: 300; padding-right: 0.75rem; }

/* ===== ACTIVITY LIST ===== */
.activity-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 1.5rem; }
.activity-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card); padding: 0.65rem 0.85rem;
  border-radius: var(--radius); border: 1px solid var(--card-border);
}
.activity-level {
  flex-shrink: 0; font-family: var(--heading); font-weight: 700;
  font-size: 0.7rem; color: var(--accent); letter-spacing: 0.05em;
}
.activity-body { flex: 1; min-width: 0; }
.activity-name { font-weight: 500; font-size: 0.85rem; color: var(--text); text-transform: capitalize; }
.activity-detail { font-size: 0.75rem; color: var(--sub); }
.activity-date { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }

/* ===== LEVEL DETAIL PAGE ===== */
.level-header { margin-bottom: 1.25rem; }
.back-link { font-size: 0.8rem; color: var(--sub); display: inline-block; margin-bottom: 0.5rem; }
.back-link:hover { color: var(--accent2); text-decoration: none; }
.level-header-num {
  font-family: var(--heading); font-weight: 800; font-size: 0.7rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.25rem;
}
.level-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.25rem; }
.level-header-sub { font-size: 0.9rem; color: var(--sub); }

/* ===== TIMER ===== */
.timer-widget {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 1rem;
  text-align: center; margin-bottom: 1.25rem;
}
.timer-display {
  font-family: var(--heading); font-weight: 800; font-size: 3rem;
  color: var(--text-heading); letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer-controls { display: flex; justify-content: center; gap: 0.35rem; margin: 0.75rem 0; flex-wrap: wrap; }
.timer-actions { display: flex; justify-content: center; gap: 0.5rem; }
.timer-elapsed { font-size: 0.75rem; color: var(--sub); margin-top: 0.5rem; min-height: 1.1em; }

.timer-widget.timer--running { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 30px var(--accent-glow); }
.timer-widget.timer--running .timer-display { color: var(--accent2); }
.timer-widget.timer--done { border-color: var(--success); }
.timer-widget.timer--done .timer-display { color: var(--success); }

/* ===== EXERCISE CARD ===== */
.exercise-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 1rem;
}
.exercise-card-header { padding: 1rem 1rem 0.5rem; }
.exercise-card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-heading); margin-bottom: 0.15rem; }
.exercise-rx { font-size: 0.8rem; color: var(--accent2); font-weight: 500; }

/* Exercise form reference images (from training guide) */
.exercise-images {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0 1rem 0.75rem;
  margin-bottom: 0.25rem;
}
.exercise-img {
  width: 100%;
  max-width: 140px;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--navy);
}
@media (min-width: 480px) {
  .exercise-img { max-width: 120px; max-height: 140px; }
}

/* Video embed */
.video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  margin: 0.5rem 0.75rem;
  border-radius: var(--radius); overflow: hidden;
  background: var(--navy);
}
.video-wrap iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0;
}

/* Log form inside exercise */
.log-form { padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--border); }
.log-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.15rem; }
.form-group label { font-size: 0.7rem; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group .optional { text-transform: none; font-weight: 400; letter-spacing: 0; }
.form-group input, .form-group textarea {
  padding: 0.5rem 0.6rem;
  background: var(--navy); border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-size: 0.9rem; font-family: var(--body);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* ===== GRADUATION SECTION ===== */
.grad-section { margin: 1.25rem 0 1.5rem; }
.grad-box {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: var(--card); border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg); padding: 1rem;
  margin-bottom: 0.75rem;
}
.grad-check { font-size: 1.5rem; color: var(--accent); line-height: 1; flex-shrink: 0; }
.grad-title { font-family: var(--heading); font-weight: 700; font-size: 0.85rem; color: var(--text-heading); margin-bottom: 0.2rem; }
.grad-desc { font-size: 0.85rem; color: var(--sub); line-height: 1.5; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 0.65rem 1.25rem;
  font-size: 0.85rem; color: var(--text); z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
.toast.toast--visible { transform: translateX(-50%) translateY(0); }
.toast.toast--success { border-color: var(--success); }

/* ===== SET PASSWORD MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay--visible { opacity: 1; visibility: visible; }
.modal-overlay .modal-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-overlay .modal-title { font-size: 1.25rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.25rem; }
.modal-overlay .auth-sub { margin-bottom: 1rem; }

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .stats-bar { gap: 0.75rem; }
  .stat-num { font-size: 1.8rem; }
  .timer-display { font-size: 4rem; }
  .exercise-card-header { padding: 1.25rem 1.25rem 0.5rem; }
  .log-form { padding: 0.85rem 1.25rem 1.25rem; }
}

@media (min-width: 1024px) {
  .container { max-width: 800px; }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--spinner-top);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===== PAGE HEADER (shared) ===== */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.25rem; }
.page-header .auth-sub { margin-bottom: 0; }

/* ===== EBOOK PAGE ===== */
.ebook-hero {
  display: flex; flex-direction: column; gap: 1.25rem;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 1.5rem;
}
.ebook-hero-cover {
  width: 100%; max-height: 220px; overflow: hidden;
  background: var(--navy);
}
.ebook-cover-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
}
.ebook-hero-body { padding: 0 1.25rem 1.25rem; }
.ebook-title {
  font-family: var(--heading); font-size: 1.1rem; font-weight: 700;
  color: var(--text-heading); margin-bottom: 0.5rem; line-height: 1.3;
}
.ebook-desc {
  font-size: 0.9rem; color: var(--sub); line-height: 1.55;
  margin-bottom: 1.25rem;
}
.ebook-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.ebook-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.9rem 1.25rem; font-size: 0.95rem;
}
.ebook-btn-icon { font-size: 1.2rem; }
.ebook-download-hint {
  font-size: 0.8rem; color: var(--muted); margin: 0;
  line-height: 1.5;
}
.ebook-features {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.ebook-feature {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius);
}
.ebook-feature-icon { font-size: 1.25rem; flex-shrink: 0; }
.ebook-feature strong { display: block; font-size: 0.85rem; color: var(--text); margin-bottom: 0.15rem; }
.ebook-feature span { font-size: 0.8rem; color: var(--sub); line-height: 1.4; }

/* Ebook card on dashboard */
.ebook-dashboard-card { margin: 1.5rem 0; }
.ebook-dashboard-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(45,139,201,0.12) 0%, rgba(45,139,201,0.04) 100%);
  border: 1px solid rgba(45,139,201,0.25);
  border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: all 0.2s;
}
.ebook-dashboard-link:hover {
  text-decoration: none; color: inherit;
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.ebook-dashboard-icon { font-size: 1.75rem; flex-shrink: 0; }
.ebook-dashboard-body { flex: 1; min-width: 0; }
.ebook-dashboard-title { font-family: var(--heading); font-weight: 700; font-size: 0.95rem; color: var(--text-heading); }
.ebook-dashboard-sub { font-size: 0.8rem; color: var(--sub); margin-top: 0.15rem; }
.ebook-dashboard-arrow { color: var(--accent); font-size: 1.25rem; font-weight: 300; }

@media (min-width: 480px) {
  .ebook-hero { flex-direction: row; }
  .ebook-hero-cover { max-width: 200px; max-height: none; min-height: 260px; }
  .ebook-hero-body { padding: 1.25rem; }
}

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 2rem; }
.settings-section h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.75rem; }
.settings-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; }
.setting-row:not(:last-child) { border-bottom: 1px solid var(--card-border); }
.setting-info { flex: 1; }
.setting-label { display: block; font-weight: 600; color: var(--text); }
.setting-value { display: block; font-size: 0.9rem; color: var(--sub); }
.setting-sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.danger-text { color: var(--error); }
.theme-toggle { display: flex; gap: 0.5rem; }
.theme-btn { background: var(--dark); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 0.4rem 0.6rem; font-size: 1rem; cursor: pointer; opacity: 0.5; transition: all 0.2s; }
.theme-btn:hover { opacity: 0.8; }
.theme-btn.active { opacity: 1; border-color: var(--accent); background: var(--accent-glow); }
.about-text { font-size: 0.85rem; color: var(--sub); text-align: center; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 300; opacity: 0; visibility: hidden; transition: all 0.2s; }
.modal-overlay.modal-overlay--visible { opacity: 1; visibility: visible; }
.modal { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1.5rem; width: 90%; max-width: 400px; }
.modal h3 { margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--sub); }
.form-group input { width: 100%; padding: 0.65rem 0.75rem; background: var(--dark); border: 1px solid var(--card-border); border-radius: var(--radius); color: var(--text); font-size: 0.95rem; }
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid var(--error); color: var(--error); padding: 0.65rem 0.75rem; border-radius: var(--radius); font-size: 0.85rem; margin-bottom: 1rem; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1rem; font-size: 0.85rem; font-weight: 600; border-radius: var(--radius); border: none; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent2); }
.btn--secondary { background: var(--dark); color: var(--text); border: 1px solid var(--card-border); }
.btn--secondary:hover { border-color: var(--accent); }
.btn--danger { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn--danger:hover { background: var(--error); color: #fff; }
