/* ==========================================================================
   BCESD — dark theme + extended public components (loaded after app.css)
   ========================================================================== */

/* Text on gold stays dark navy in both themes */
.strip, .tile.t4, .timeplan .p3, .chip.c-gold, .result-banner, .note-card, .important-box { color: var(--on-gold) !important; }
.result-banner h3, .note-card h3, .important-box h3 { color: var(--on-gold); }

/* ---------- Theme toggle ---------- */
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text-2); display: inline-grid; place-items: center; padding: 0; }
.theme-btn:hover { color: var(--ink); }
.theme-btn .bi-sun { display: none; }
[data-theme="dark"] .theme-btn .bi-sun { display: inline; }
[data-theme="dark"] .theme-btn .bi-moon-stars { display: none; }

/* ---------- Dark theme tokens ---------- */
[data-theme="dark"] {
  --surface: #0b1220;
  --surface-2: #172236;
  --surface-3: #111b2e;
  --card: #111b2e;
  --glass: rgba(17, 27, 46, 0.85);
  --border: rgba(51, 65, 85, 0.75);
  --border-strong: #334155;
  --text: #e2e8f0;
  --text-2: #cbd5e1;
  --text-soft: #94a3b8;
  --ink: #f1f5f9;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--surface); color: var(--text); }
[data-theme="dark"] .bg-grid { background-color: var(--surface); background-image: radial-gradient(rgba(148, 163, 184, 0.10) 1px, transparent 1px); }
[data-theme="dark"] .bg-mesh {
  background: radial-gradient(60% 60% at 85% 0%, rgba(36, 83, 216, 0.22) 0%, transparent 60%),
              radial-gradient(50% 50% at 0% 30%, rgba(20, 184, 166, 0.14) 0%, transparent 60%), var(--surface);
}
[data-theme="dark"] .site-nav { background: rgba(11, 18, 32, 0.6); }
[data-theme="dark"] .site-nav.scrolled { background: rgba(11, 18, 32, 0.92); }
[data-theme="dark"] .site-nav .nav-link:hover, [data-theme="dark"] .site-nav .nav-link.active { background: rgba(148, 163, 184, 0.1); }
[data-theme="dark"] .brand-logo { background: #fff; border-radius: 10px; padding: 2px 6px; }
[data-theme="dark"] .lang-toggle a.on { background: var(--card); color: var(--ink); }
[data-theme="dark"] .text-secondary { color: var(--text-2) !important; }
[data-theme="dark"] .btn-outline { color: var(--text); border-color: var(--border-strong); }
[data-theme="dark"] .btn-outline:hover { color: var(--ink); border-color: #64748b; }
[data-theme="dark"] .btn-navy { background: #2453d8; }
[data-theme="dark"] .btn-navy:hover { background: #3b6cf0; }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select, [data-theme="dark"] .input-group-text { background-color: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
[data-theme="dark"] .form-control::placeholder { color: #64748b; }
[data-theme="dark"] .pill-success { color: #4ade80; }
[data-theme="dark"] .pill-warning { color: #fbbf24; }
[data-theme="dark"] .pill-danger { color: #f87171; }
[data-theme="dark"] .pill-info { color: #93b4ff; }
[data-theme="dark"] .pill-muted { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .faq .accordion-button { background: var(--card); color: var(--ink); }
[data-theme="dark"] .faq .accordion-button::after { filter: invert(1); }
[data-theme="dark"] .modal-content { background: var(--card); color: var(--text); }
[data-theme="dark"] .btn-close { filter: invert(1); }
[data-theme="dark"] .rank-badge { color: #0b192c; }
[data-theme="dark"] .rank-badge:not(.r1):not(.r2):not(.r3) { background: var(--surface-2); color: var(--ink); }

/* ---------- Breadcrumbs ---------- */
.breadcrumb-x { font-size: .85rem; color: var(--text-soft); margin-bottom: .75rem; }
.breadcrumb-x a { color: var(--text-soft); }
.breadcrumb-x a:hover { color: var(--ink); }

/* ---------- Hero banner slider ---------- */
.slide { display: none; }
.slide.active { display: block; animation: fadeUp .5s ease; }
.slide-img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow-lg); }
.slider-dots { display: flex; gap: .4rem; margin-top: 1.4rem; }
.slider-dots button { width: 28px; height: 6px; border-radius: 6px; border: 0; background: var(--border-strong); padding: 0; transition: width .2s ease; }
.slider-dots button.on { background: var(--orange); width: 44px; }
.illus { width: 100%; max-width: 470px; height: auto; display: block; margin: 0 auto; }

/* ---------- Key dates ---------- */
.date-card { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); height: 100%; }
.date-card .ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.date-card small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); font-weight: 800; }
.date-card b { color: var(--ink); font-size: .95rem; }

/* ---------- Notices ---------- */
.notice-item { display: block; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); height: 100%; transition: transform .15s ease, border-color .15s ease; }
a.notice-item:hover { transform: translateY(-2px); border-color: var(--border-strong); color: var(--text); }
.notice-item time { font-size: .76rem; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .06em; }
.notice-item h3 { font-size: 1.02rem; font-weight: 800; color: var(--ink); margin: .3rem 0; }
.notice-item p { color: var(--text-soft); font-size: .9rem; margin: 0; }
.notice-body { font-size: 1.04rem; line-height: 1.8; color: var(--text-2); white-space: pre-line; }

/* ---------- Checklist ---------- */
.check-row { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 12px; cursor: pointer; transition: background .15s ease; margin: 0; }
.check-row:hover { background: var(--surface-3); }
.check-row input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; accent-color: var(--emerald-700); }
.check-row input:checked + span { color: var(--text-soft); text-decoration: line-through; }
.check-progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.check-progress div { height: 100%; background: var(--emerald-700); width: 0; transition: width .3s ease; }
.important-box { background: var(--gold); border-radius: var(--radius); padding: 1.3rem 1.5rem; display: flex; gap: 1rem; align-items: flex-start; }
.important-box .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--navy-900); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none; }

/* ---------- Session countdown / slots ---------- */
.countdown { display: flex; gap: .5rem; flex-wrap: wrap; }
.countdown span { min-width: 64px; text-align: center; padding: .55rem .4rem; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); }
.countdown b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown small { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); font-weight: 700; }
.slot-card { border: 1.5px solid var(--border-strong); border-radius: 14px; padding: .9rem 1rem; display: flex; gap: .8rem; align-items: center; background: var(--card); }
.slot-card.current { border-color: var(--emerald-700); background: rgba(0, 210, 106, .05); }
.btn-locked { background: var(--surface-2); color: var(--text-soft); border: 1px dashed var(--border-strong); cursor: not-allowed; }

/* ---------- Awards ---------- */
.pill-gold { background: rgba(245, 165, 36, .2); color: #8a5300; }
.pill-silver { background: rgba(148, 163, 184, .25); color: #334155; }
.pill-bronze { background: rgba(194, 120, 70, .2); color: #8a4a1c; }
[data-theme="dark"] .pill-gold { color: #fcd34d; }
[data-theme="dark"] .pill-silver { color: #e2e8f0; }
[data-theme="dark"] .pill-bronze { color: #f0a46e; }

/* ---------- Upload tiles (dashboard) ---------- */
.upload-tile { display: flex; gap: .8rem; align-items: center; padding: .8rem; border: 1px dashed var(--border-strong); border-radius: 12px; }
.upload-tile .thumb { width: 52px; height: 62px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--text-soft); flex: none; }
.upload-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Animated SVG illustrations ---------- */
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes bounce-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.illus .blink { transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
.illus .bounce { animation: bounce-y 2.6s ease-in-out infinite; }
.illus .bounce.d2 { animation-delay: .8s; }
.illus .spin { transform-box: fill-box; transform-origin: center; animation: spin-slow 16s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .illus *, .slide.active { animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-nav, .site-footer, .no-print, #loginModal { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card-x { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* Navbar: keep labels on one line at laptop widths */
.site-nav .nav-link { white-space: nowrap; }
@media (min-width: 1200px) and (max-width: 1399.98px) { .site-nav .nav-link { padding: .5rem .55rem !important; font-size: .88rem; } .brand-logo { height: 38px; } }

/* Status pill on the dark dashboard header */
.dash-head .pill { background: #fff; }

/* Logos have navy lettering: always sit on a white badge (both themes) */
[data-theme="dark"] .footer-logo { background: #ffffff !important; }
.site-footer .motto { color: #8fb0ff; }

/* ---- Dark-mode contrast fixes (landing pages) ---- */
[data-theme="dark"] .snapshot-row dt { color: #8fb0ff; }
[data-theme="dark"] .snapshot-row:nth-child(even) { background: rgba(148, 163, 184, .05); }
[data-theme="dark"] .snapshot-row { border-bottom-color: rgba(148, 163, 184, .1); }
[data-theme="dark"] .ic-blue { background: rgba(96, 140, 255, .16); color: #8fb0ff; }
[data-theme="dark"] .ic-teal { color: #2dd4bf; }
[data-theme="dark"] .breadcrumb-x, [data-theme="dark"] .breadcrumb-x a { color: #94a3b8; }
/* Headings on gold always dark navy */
.result-banner h2, .result-banner h3, .note-card h2, .note-card h3, .important-box h2, .important-box h3 { color: var(--on-gold) !important; }

/* ---- Card headings keep their small size (".section h2" must not enlarge them) ---- */
.section h2.h4 { font-size: 1.4rem; letter-spacing: -.01em; }
.section h2.h5 { font-size: 1.2rem; letter-spacing: -.01em; }
.section h2.h6 { font-size: .95rem; letter-spacing: .06em; }
.result-banner h2, .result-banner h3 { font-size: 1.15rem !important; }
