/* Dark mode for every page. Rules are keyed on html[data-theme="dark"], set by theme.js. */

.theme-toggle { position:fixed; left:16px; bottom:16px; z-index:60; width:44px; height:44px; display:grid; place-items:center; padding:0; border-radius:50%; border:1px solid #fcd34d; background:#fffbeb; color:#78350f; box-shadow:0 6px 20px rgba(15,23,42,.18); cursor:pointer; transition:background .15s,transform .15s; }
.theme-toggle:hover { transform:translateY(-1px); background:#fef3c7; }
.theme-toggle:focus-visible { outline:3px solid #a16207; outline-offset:3px; }
.theme-toggle svg { width:21px; height:21px; }
.theme-toggle .theme-icon-sun { display:none; }
html[data-theme="dark"] .theme-toggle { background:#1e293b; color:#fcd34d; border-color:rgba(251,191,36,.45); box-shadow:0 6px 20px rgba(0,0,0,.45); }
html[data-theme="dark"] .theme-toggle:hover { background:#273449; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display:block; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display:none; }
@media print { .theme-toggle { display:none !important; } }

html[data-theme="dark"] {
  --ink:#e5e7eb; --muted:#94a3b8; --line:rgba(251,191,36,.28); --paper:#111827; --brown:#fcd34d;
  --dm-bg:#0b1120; --dm-surface:#111827; --dm-raised:#1e293b; --dm-border:rgba(251,191,36,.24); --dm-soft:rgba(251,191,36,.08);
}
html[data-theme="dark"] body { color:#e5e7eb; background-color:#0b1120; }
html[data-theme="dark"] ::placeholder { color:#64748b !important; }

/* ---------- Admin panel and trainer panel (admin.html) ---------- */
html[data-theme="dark"] body:has(.site-header) { background-color:#0b1120; background-image:radial-gradient(circle at 50% 0%,rgba(250,204,21,.07),transparent 50%),radial-gradient(circle at 100% 20%,rgba(234,179,8,.05),transparent 40%); }
html[data-theme="dark"] a { color:#fcd34d; }
html[data-theme="dark"] a:hover { color:#fde68a; }
html[data-theme="dark"] :focus-visible { outline-color:#fbbf24; }
html[data-theme="dark"] .brand-bar { background:rgba(17,24,39,.92); border-color:var(--dm-border); box-shadow:0 4px 24px rgba(0,0,0,.35); }
html[data-theme="dark"] .brand-tag { color:#fde68a; background:rgba(251,191,36,.12); border-color:rgba(251,191,36,.35); }
html[data-theme="dark"] .card { background:rgba(17,24,39,.97); border-color:var(--dm-border); box-shadow:0 20px 60px rgba(0,0,0,.45); }
html[data-theme="dark"] .heading p,
html[data-theme="dark"] .toolbar p,
html[data-theme="dark"] .format-card p,
html[data-theme="dark"] .pagination p { color:#94a3b8; }
html[data-theme="dark"] input,
html[data-theme="dark"] select { color:#e5e7eb; background-color:#0f172a; border-color:rgba(251,191,36,.28); }
html[data-theme="dark"] input:disabled { background:#1e293b; color:#94a3b8; }
html[data-theme="dark"] input.bg-transparent,
html[data-theme="dark"] .input-wrap input { background-color:transparent; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter:invert(.85); }
html[data-theme="dark"] .field-error { color:#fca5a5; }
html[data-theme="dark"] .button { background:rgba(251,191,36,.1); color:#fde68a; border-color:rgba(251,191,36,.35); }
html[data-theme="dark"] .button:hover { background:rgba(251,191,36,.18); }
html[data-theme="dark"] .button.primary,
html[data-theme="dark"] .nav-button.active { background:linear-gradient(90deg,#fbbf24,#facc15,#f59e0b); color:#0f172a; border-color:#fcd34d; }
html[data-theme="dark"] .button.secondary { background:#1e293b; color:#cbd5e1; border-color:#334155; }
html[data-theme="dark"] .button.secondary:hover { background:#273449; }
html[data-theme="dark"] .course-switches .button.on,
html[data-theme="dark"] .reveal-time .button.on { background:rgba(251,191,36,.25); border-color:#f59e0b; }
html[data-theme="dark"] .notice { color:#fde68a; background:rgba(251,191,36,.08); border-color:rgba(251,191,36,.3); }
html[data-theme="dark"] .notice.error { color:#fecaca; background:rgba(220,38,38,.12); border-color:rgba(248,113,113,.35); }
html[data-theme="dark"] .notice.success { color:#bbf7d0; background:rgba(22,163,74,.12); border-color:rgba(74,222,128,.3); }
html[data-theme="dark"] .login-bottom,
html[data-theme="dark"] .active-admins { border-color:var(--dm-border); }
html[data-theme="dark"] .nav-label,
html[data-theme="dark"] .active-admins .devices,
html[data-theme="dark"] .reveal-time span,
html[data-theme="dark"] .reveal-time label,
html[data-theme="dark"] .stat-card p,
html[data-theme="dark"] .status-pending { color:#fcd34d; }
html[data-theme="dark"] .active-admins li,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .course-filter-bar { background:var(--dm-soft); border-color:var(--dm-border); }
html[data-theme="dark"] .course-filter-bar p { color:#fde68a; }
html[data-theme="dark"] .format-dialog { background:rgba(2,6,23,.7); }
html[data-theme="dark"] .format-card { background:#111827; border-color:var(--dm-border); }
html[data-theme="dark"] .reveal-time input { background:#0f172a; border-color:rgba(251,191,36,.3); }
html[data-theme="dark"] .mode-badge,
html[data-theme="dark"] .count,
html[data-theme="dark"] .course-group-count { color:#fde68a; background:rgba(251,191,36,.1); border-color:var(--dm-border); }
html[data-theme="dark"] .table-scroll { border-color:var(--dm-border); }
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color:rgba(251,191,36,.12); }
html[data-theme="dark"] thead th { background:#1a2233; color:#cbd5e1; }
html[data-theme="dark"] tbody tr:hover { background:rgba(251,191,36,.05); }
html[data-theme="dark"] .pending { color:#64748b; }
html[data-theme="dark"] .course-group-row { background:rgba(251,191,36,.12); }
html[data-theme="dark"] tbody tr.course-group-row:hover { background:rgba(251,191,36,.18); }
html[data-theme="dark"] .course-group-cell { color:#fde68a; border-color:var(--dm-border); }
html[data-theme="dark"] .status-accepted { color:#86efac; }
html[data-theme="dark"] .status-rejected { color:#fca5a5; }
html[data-theme="dark"] .site-footer { color:#94a3b8; background:rgba(17,24,39,.9); border-color:var(--dm-border); box-shadow:none; }

/* ---------- Trainer login (trainer-login.html) ---------- */
html[data-theme="dark"] body:has(.masthead) { background:radial-gradient(ellipse at 50% 40%,#151d2e 12%,#0f1522 54%,#0b1120 100%); }
html[data-theme="dark"] .masthead { background:#1e293b; border-color:rgba(251,191,36,.35); box-shadow:0 8px 30px rgba(0,0,0,.35); }
html[data-theme="dark"] .masthead .brand p { color:#94a3b8; }
html[data-theme="dark"] .login-card { background:radial-gradient(ellipse 180px 90px at 50% 0%,rgba(251,191,36,.08),transparent),#111827; box-shadow:0 12px 44px rgba(0,0,0,.45); }
html[data-theme="dark"] .portal-tag { background:rgba(251,191,36,.1); border-color:rgba(251,191,36,.35); }
html[data-theme="dark"] .input-wrap { background:#0f172a; border-color:#334155; }
html[data-theme="dark"] .input-wrap:focus-within { border-color:#fbbf24; }
html[data-theme="dark"] .eye { color:#94a3b8; }
html[data-theme="dark"] .eye:hover { color:#fcd34d; background:rgba(251,191,36,.08); }
html[data-theme="dark"] .remember { color:#cbd5e1; }
html[data-theme="dark"] .text-button { color:#fcd34d; }
html[data-theme="dark"] body:has(.masthead) > footer { background:rgba(17,24,39,.92); border-color:var(--dm-border); color:#94a3b8; }
html[data-theme="dark"] body:has(.masthead) > footer .name { background:rgba(251,191,36,.14); color:#fde68a; }
html[data-theme="dark"] dialog { background:#111827; color:#e5e7eb; }
html[data-theme="dark"] dialog p { color:#94a3b8; }

/* ---------- Results and registration pages (Tailwind) ---------- */
html[data-theme="dark"] .bg-canvas-pattern { background:#0b1120; background-image:radial-gradient(circle at 50% 0%,rgba(250,204,21,.07),transparent 50%),radial-gradient(circle at 100% 20%,rgba(234,179,8,.05),transparent 40%); }
html[data-theme="dark"] #main-header .header-bar { background-color:#1e293b; border-color:rgba(251,191,36,.35); }
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white\/95 { background-color:#111827; }
html[data-theme="dark"] .bg-white\/80 { background-color:rgba(17,24,39,.8); }
html[data-theme="dark"] .bg-amber-50,
html[data-theme="dark"] .bg-amber-50\/80 { background-color:rgba(251,191,36,.08); }
html[data-theme="dark"] .bg-amber-100 { background-color:rgba(251,191,36,.15); }
html[data-theme="dark"] .hover\:bg-amber-200:hover { background-color:rgba(251,191,36,.25); }
html[data-theme="dark"] .hover\:bg-amber-50\/60:hover { background-color:rgba(251,191,36,.06); }
html[data-theme="dark"] .hover\:bg-slate-100:hover { background-color:#273449; }
html[data-theme="dark"] .text-slate-950 { color:#0f172a; }
html[data-theme="dark"] .text-slate-900 { color:#f1f5f9; }
html[data-theme="dark"] .text-slate-800 { color:#e2e8f0; }
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .hover\:text-slate-900:hover,
html[data-theme="dark"] .hover\:text-slate-700:hover { color:#cbd5e1; }
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400 { color:#94a3b8; }
html[data-theme="dark"] .text-amber-900,
html[data-theme="dark"] .text-amber-950 { color:#fde68a; }
html[data-theme="dark"] .text-amber-700,
html[data-theme="dark"] .hover\:text-amber-700:hover { color:#fcd34d; }
html[data-theme="dark"] .border-amber-100,
html[data-theme="dark"] .border-amber-200,
html[data-theme="dark"] .border-amber-200\/80,
html[data-theme="dark"] .border-amber-300,
html[data-theme="dark"] .border-amber-300\/70,
html[data-theme="dark"] .border-amber-300\/80 { border-color:rgba(251,191,36,.28); }
html[data-theme="dark"] .border-slate-300 { border-color:#334155; }
html[data-theme="dark"] .divide-amber-100\/70 > :not([hidden]) ~ :not([hidden]) { border-color:rgba(251,191,36,.12); }
html[data-theme="dark"] .ring-amber-100,
html[data-theme="dark"] .ring-amber-50 { --tw-ring-color:rgba(251,191,36,.12); }
html[data-theme="dark"] .bg-amber-200\/30 { background-color:rgba(251,191,36,.08); }
html[data-theme="dark"] #registerForm input,
html[data-theme="dark"] #registerForm select { background-color:#0f172a; color:#e5e7eb; border-color:rgba(251,191,36,.28); }
html[data-theme="dark"] #formError { color:#fecaca; background:rgba(220,38,38,.12); border-color:rgba(248,113,113,.35); }
html[data-theme="dark"] #formSuccess { color:#bbf7d0; background:rgba(22,163,74,.12); border-color:rgba(74,222,128,.3); }
html[data-theme="dark"] #studentId[aria-invalid="true"],
html[data-theme="dark"] input[aria-invalid="true"] { color:#fca5a5; }
html[data-theme="dark"] .bg-slate-100 { background-color:rgba(148,163,184,.14); }
html[data-theme="dark"] .text-slate-600 { color:#cbd5e1; }
html[data-theme="dark"] .bg-emerald-100 { background-color:rgba(16,185,129,.15); }
html[data-theme="dark"] .text-emerald-800 { color:#6ee7b7; }
html[data-theme="dark"] .border-emerald-300 { border-color:rgba(52,211,153,.4); }
html[data-theme="dark"] .bg-sky-100 { background-color:rgba(14,165,233,.15); }
html[data-theme="dark"] .text-sky-800 { color:#7dd3fc; }
html[data-theme="dark"] .border-sky-300 { border-color:rgba(56,189,248,.4); }
html[data-theme="dark"] .bg-red-100 { background-color:rgba(239,68,68,.15); }
html[data-theme="dark"] .text-red-800 { color:#fca5a5; }
html[data-theme="dark"] .border-red-300 { border-color:rgba(248,113,113,.4); }
html[data-theme="dark"] .developers { color:#94a3b8; }
html[data-theme="dark"] .dev-name { color:#fde68a; background-color:rgba(251,191,36,.14); }

/* ---------- Privacy page ---------- */
html[data-theme="dark"] body.privacy { color:#e5e7eb; }
html[data-theme="dark"] body.privacy h1,
html[data-theme="dark"] body.privacy h2 { color:#fcd34d; }
