/* ==== Base ==== */
* { box-sizing: border-box; }
/* Safety net so no page can ever produce a horizontal scrollbar on any device. Uses
   overflow-x: clip, NOT hidden — "hidden" on one axis forces the browser to compute the
   other axis as auto (a CSS spec quirk), silently turning html/body into a scroll
   container, which breaks position:sticky (header, admin sidebar, etc. stick to that
   phantom container instead of the real viewport scroll). clip has no such side effect,
   and still doesn't affect intentional inner scrollers (.table-responsive, etc.), which
   scroll within their own container regardless. */
html { overflow-x: clip; width: 100%; }
/* Bootstrap's reboot default line-height (1.5) reads a bit cramped for real paragraph
   content — a slightly looser baseline makes body copy across the whole site easier to
   read without needing every individual content block to set its own line-height.
   font-size is explicit px (17px, +1px over the browser/Bootstrap 16px default) rather
   than rem, deliberately — a change to :root/html's rem basis would also rescale every
   rem-based size sitewide, including the blog module's own explicit rem sizes
   (.blog-article-content etc.), which must stay untouched. A plain body font-size only
   changes text that inherits it directly (most descriptive/body copy across the site);
   anything already given its own explicit font-size (blog, the typing engine, Bootstrap
   components) is unaffected either way. */
body { font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; font-size: 17px; line-height: 1.65; overflow-x: clip; width: 100%; }
img { max-width: 100%; height: auto; }

/* ==== Buttons (structural only — colors stay in themes.css) ==== */
.btn {
  --bs-btn-padding-y: .45rem; --bs-btn-padding-x: 1.1rem; --bs-btn-font-size: .9rem;
  --bs-btn-border-radius: .5rem; font-weight: 600; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { --bs-btn-padding-y: .6rem; --bs-btn-padding-x: 1.5rem; --bs-btn-font-size: 1.05rem; }
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: .4rem; }
.btn-primary:not(:disabled):hover { box-shadow: 0 4px 14px rgba(var(--accent-rgb), .35); }

/* ==== Impersonation banner ==== */
.impersonation-bar {
  background: #1f2937; color: #fff; display: flex; align-items: center; justify-content: center;
  gap: 1rem; padding: .5rem 1rem; font-size: .85rem; flex-wrap: wrap; text-align: center;
}
.impersonation-bar form { margin: 0; }

/* ==== Header ==== */
.site-header { background: var(--header-bg); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border-color); }
.site-logo-img { height: 34px; width: auto; display: block; }
.navbar-nav .nav-link {
  color: var(--text-primary); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em;
  padding: .5rem 1rem !important; border-radius: 999px; transition: background .15s ease, color .15s ease;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.show { background: rgba(var(--accent-rgb), .08); }
.navbar-nav .nav-link.active { color: #fff; background: var(--accent); }
.navbar-nav .nav-link.disabled { color: var(--text-muted) !important; opacity: .55; }
.header-actions { margin-left: .5rem; flex-wrap: wrap; }
.header-actions .dropdown { position: relative; }
.header-actions .dropdown-menu { z-index: 1050; }
.header-avatar-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* ==== Mobile navigation (< lg, where the navbar collapses into the toggler menu) ==== */
@media (max-width: 991.98px) {
  .navbar-collapse {
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: .75rem 0 1rem;
  }
  .navbar-nav { margin: 0 0 .5rem !important; }
  .navbar-nav .nav-link {
    padding: .7rem 1rem !important; border-radius: 10px; text-align: left;
  }
  .mega-dropdown .dropdown-menu.mega-menu {
    position: static !important; width: 100%; max-width: 100%; transform: none !important;
    box-shadow: none; border: none; background: var(--bg-surface-alt); margin-top: .25rem;
  }
  /* Theme picker (Light/Dark/Auto + accent color swatches) — same problem as the mega
     menu above: Popper's absolute positioning has nowhere sane to put a 260px-wide panel
     inside the narrow, auto-scrolling mobile nav collapse, so it rendered partly off-screen.
     Forcing it static/full-width like the mega menu keeps it inline and fully visible. */
  .theme-picker .dropdown-menu.theme-dropdown {
    position: static !important; width: 100%; max-width: 100%; transform: none !important;
    box-shadow: none; border: none; background: var(--bg-surface-alt); margin-top: .25rem;
  }
  .header-actions {
    width: 100%; margin-left: 0; padding-top: .75rem; margin-top: .5rem;
    border-top: 1px solid var(--border-color); justify-content: flex-start; gap: .6rem !important;
  }
  .header-actions .dropdown-menu {
    /* Cap width only — Bootstrap positions these via Popper assuming position: absolute,
       so forcing position: fixed here would fight Popper's computed offset and misplace them. */
    max-width: calc(100vw - 2rem);
  }
}

/* ==== User account dropdown ==== */
.user-menu { width: 260px; border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .5rem; background: var(--bg-surface); }
.user-menu-header { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem .75rem; }
.user-menu-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-menu-avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 700; }
.user-menu-name { display: block; font-weight: 700; font-size: .9rem; color: var(--text-primary); }
.user-menu-email { display: block; font-size: .76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.user-menu-item {
  display: flex; align-items: center; gap: .6rem; width: 100%; border: none; background: none; text-align: left;
  padding: .55rem .6rem; border-radius: 8px; font-size: .88rem; font-weight: 600; color: var(--text-primary); text-decoration: none;
}
.user-menu-item:hover { background: var(--bg-surface-alt); color: var(--accent); }
.user-menu-item-danger { color: #dc2626; }
.user-menu-item-danger:hover { background: rgba(220, 38, 38, .08); color: #dc2626; }
.user-menu-icon { width: 20px; text-align: center; font-size: 15px; }
.user-menu-divider { margin: .4rem 0; border-color: var(--border-color); }

.notif-dropdown { width: 320px; max-height: 380px; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-color); padding-bottom: .5rem; }
.notif-item { display: block; padding: .55rem .9rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border-color); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-surface-alt); }
.notif-item-title { font-size: .85rem; font-weight: 700; color: var(--text-primary); }
.notif-item-message { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.notif-item-time { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 1rem .9rem; font-size: .82rem; color: var(--text-muted); text-align: center; }

/* ==== Mega menu (Practice dropdown) ==== */
.mega-menu {
  width: 300px; max-width: calc(100vw - 2rem); border: 1px solid var(--border-color); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: .5rem; background: var(--bg-surface);
}
.mega-menu-item {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: 8px;
  color: var(--text-primary); text-decoration: none;
}
.mega-menu-item:hover { background: var(--bg-surface-alt); color: var(--accent); }
.mega-menu-icon {
  width: 34px; height: 34px; border-radius: 8px; background: rgba(var(--accent-rgb), .12); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.mega-menu-item-title { font-weight: 600; font-size: .88rem; margin: 0; }
.mega-menu-item-desc { font-size: .72rem; color: var(--text-muted); margin: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-primary); display: inline-flex;
  align-items: center; justify-content: center; text-decoration: none;
}
.icon-btn:disabled { opacity: .4; }
.theme-dropdown { width: 260px; background: var(--bg-surface); border: 1px solid var(--border-color); }

.announcement-bar { color: #fff; font-size: .875rem; }
.announcement-info { background: var(--accent); }
.announcement-success { background: #16a34a; }
.announcement-warning { background: #d97706; }
.announcement-danger { background: #dc2626; }

/* ==== Footer ==== */
.site-footer {
  background: var(--bg-surface-alt); border-top: 1px solid var(--border-color); margin-top: 3rem;
  color: var(--text-primary);
}
.footer-copyright { color: var(--text-muted); }
.footer-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 1rem; }
/* Guided-lesson chips (English/Hindi typing home) — small pill links instead of the plain
   arrow-list .footer-links style, which read too much like a sidebar/footer widget for a
   main-content card. */
.lesson-chip {
  display: inline-block; padding: .4rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  border: 1px solid rgba(var(--accent-rgb), .3); color: var(--accent); text-decoration: none;
  background: rgba(var(--accent-rgb), .07); transition: background .15s ease, color .15s ease, transform .15s ease;
}
.lesson-chip:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--text-primary); text-decoration: none; font-size: .9rem; }
.footer-links a:hover { color: var(--accent); }
.disabled-link { pointer-events: none; opacity: .5; }

.birthday-banner { border: 2px dashed var(--accent); background: rgba(var(--accent-rgb), .06); }

/* ==== Profile ==== */
.profile-avatar-img, .profile-avatar-placeholder { width: 72px; height: 72px; object-fit: cover; }
.profile-avatar-placeholder { font-size: 1.5rem; }
.auth-v2-icon-input .form-control:disabled { background: var(--bg-surface-alt); cursor: not-allowed; }

/* ==== Certificate ==== */
.certificate-card { max-width: 780px; }
.certificate-border {
  border: 3px double var(--accent); border-radius: 18px; padding: 3rem 2.5rem; text-align: center;
  background: var(--bg-surface); box-shadow: var(--shadow-lg);
}
.certificate-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; }
.certificate-logo-img { height: 40px; width: auto; }
.certificate-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--text-muted); font-weight: 700; margin-bottom: .5rem; }
.certificate-name { font-size: 2.25rem; font-weight: 800; color: var(--accent); margin-bottom: 1rem; font-family: Georgia, 'Times New Roman', serif; }
.certificate-body { color: var(--text-muted); max-width: 520px; margin: 0 auto 2rem; line-height: 1.8; }
.certificate-stats { display: flex; justify-content: center; gap: 3rem; margin-bottom: 2rem; }
.certificate-stat-num { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); }
.certificate-stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.certificate-date { font-size: .85rem; color: var(--text-muted); margin: 0; }
@media print {
  .site-header, .site-footer, .announcement-bar, .d-print-none { display: none !important; }
  .certificate-border { box-shadow: none; }
}

/* ==== FAQ ==== */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
.faq-item { border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-surface); overflow: hidden; transition: border-color .15s ease; }
.faq-item:has(.faq-question[aria-expanded="true"]) { border-color: var(--accent); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: none; text-align: left; padding: 1.1rem 1.4rem; font-weight: 700; font-size: .95rem; color: var(--text-primary);
}
.faq-toggle-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(var(--accent-rgb), .1);
  position: relative; font-size: 0; transition: transform .2s ease, background .2s ease;
}
/* Drawn as two exactly-centered bars instead of a '+' text glyph — a glyph's visual
   center rarely matches its box's geometric center once rotated, which is why the
   rotated "x" used to sit a couple pixels off from the circle's true center. */
.faq-toggle-icon::before, .faq-toggle-icon::after {
  content: ''; position: absolute; top: 50%; left: 50%; background: var(--accent); transition: background .2s ease;
}
.faq-toggle-icon::before { width: 12px; height: 2px; transform: translate(-50%, -50%); }
.faq-toggle-icon::after { width: 2px; height: 12px; transform: translate(-50%, -50%); }
.faq-question[aria-expanded="true"] .faq-toggle-icon { transform: rotate(45deg); background: var(--accent); }
.faq-question[aria-expanded="true"] .faq-toggle-icon::before,
.faq-question[aria-expanded="true"] .faq-toggle-icon::after { background: #fff; }
.faq-answer-wrap { border-top: 1px solid transparent; }
.faq-answer-wrap.show { border-top-color: var(--border-color); }
.faq-answer { padding: 1.1rem 1.4rem; color: var(--text-muted); line-height: 1.75; font-size: .92rem; }

/* ==== CTA banner ==== */
.cta-banner { background: linear-gradient(90deg, #0d9488, #2563eb); color: #fff; }
.cta-banner h2 { font-weight: 800; }

/* ==== Hero ==== */
.hero {
  padding: 2.25rem 0 4rem;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), .08), transparent 60%);
}
.hero h1 { font-weight: 800; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.15; }
.hero .lead { color: var(--text-muted); font-size: 1.15rem; }
.hero-cta-btn { font-weight: 600; font-size: .92rem; padding: .55rem 1.5rem; transition: transform .15s ease, box-shadow .15s ease; }
.hero-cta-btn:hover { transform: translateY(-2px); }
.btn-primary.hero-cta-btn { box-shadow: 0 8px 20px rgba(var(--accent-rgb), .3); }

/* ==== How It Works ==== */
.how-it-works-step { position: relative; text-align: center; padding: 0 .5rem; }
.how-it-works-num {
  position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem;
  margin: 0 auto 1rem;
}
.how-it-works-connector {
  position: absolute; top: 22px; left: 50%; width: 100%; height: 2px; z-index: 0;
  background: repeating-linear-gradient(90deg, var(--border-color) 0 6px, transparent 6px 12px);
}
.how-it-works-icon { font-size: 1.6rem; margin-bottom: .6rem; }

/* ==== Hero trust badge pill ==== */
.hero-badge-pill {
  display: inline-flex; align-items: center; gap: .5rem; background: rgba(var(--accent-rgb), .1);
  color: var(--accent); font-weight: 700; font-size: .82rem; padding: .5rem 1rem; border-radius: 999px;
}
.hero-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ==== Home page stats strip ==== */
.stats-strip {
  display: flex; flex-wrap: wrap; justify-content: center;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .08), var(--bg-surface-alt));
  border: 1px solid rgba(var(--accent-rgb), .18); border-radius: 18px; padding: 1.5rem 1rem;
}
.stats-strip-item {
  display: flex; align-items: center; gap: .85rem; padding: .5rem 1.75rem;
  border-right: 1px solid rgba(var(--accent-rgb), .18);
}
.stats-strip-item:last-child { border-right: none; }
.stats-strip-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface); box-shadow: var(--shadow-sm);
}
.stats-strip-value { font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stats-strip-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
@media (max-width: 767.98px) {
  .stats-strip-item { border-right: none; width: 50%; padding: .6rem; }
  .stats-strip-label { white-space: normal; }
}

/* ==== Hero hub diagram ==== */
.hero-hub { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1 / 1; margin: 0 auto; }
.hero-hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-line { stroke-width: .5; stroke-dasharray: 1.4 1.4; opacity: .6; animation: hubLineFlow 1.8s linear infinite; }
.hub-line-1 { stroke: #7c3aed; }
.hub-line-2 { stroke: #ea580c; animation-delay: -.3s; }
.hub-line-3 { stroke: #0d9488; animation-delay: -.6s; }
.hub-line-4 { stroke: #2563eb; animation-delay: -.9s; }
.hub-line-5 { stroke: #16a34a; animation-delay: -1.2s; }
.hub-line-6 { stroke: #db2777; animation-delay: -1.5s; }
@keyframes hubLineFlow { to { stroke-dashoffset: -2.8; } }

.hero-hub-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 28%; aspect-ratio: 1 / 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(var(--accent-rgb), .9), var(--accent));
  border: 1px solid var(--border-color);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .2rem; text-align: center; padding: .4rem; z-index: 2;
  animation: hubCenterPulse 2.6s ease-in-out infinite;
}
.hero-hub-center::before {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(var(--accent-rgb), .9) 12%, transparent 28%);
  animation: hubCenterSpin 3.5s linear infinite; z-index: -1;
}
@keyframes hubCenterPulse {
  0%, 100% { box-shadow: 0 16px 36px rgba(var(--accent-rgb), .35); }
  50% { box-shadow: 0 16px 46px rgba(var(--accent-rgb), .55), 0 0 0 10px rgba(var(--accent-rgb), .08); }
}
@keyframes hubCenterSpin { to { transform: rotate(360deg); } }
.hero-hub-center-icon { font-size: 1.4rem; }
.hero-hub-center-label { font-weight: 800; font-size: .56rem; letter-spacing: .01em; }

.hero-hub-node {
  position: absolute; transform: translate(-50%, -50%) scale(.7); width: 30%; min-width: 100px;
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 14px;
  padding: .65rem .5rem; text-align: center; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease; z-index: 1;
  opacity: 0; animation: hubNodeIn .5s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
.hero-hub-node:hover { transform: translate(-50%, -50%) translateY(-3px) scale(1); box-shadow: var(--shadow-lg); }
@keyframes hubNodeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.hero-hub-node-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--hub-color); color: #fff; font-weight: 700; font-size: .8rem; margin-bottom: .4rem;
}
.hero-hub-node span:last-child { display: block; font-size: .74rem; font-weight: 600; color: var(--text-primary); line-height: 1.25; }

.hero-hub-node-1 { top: 20%; left: 28%; animation-delay: .1s; }
.hero-hub-node-2 { top: 20%; left: 72%; animation-delay: .2s; }
.hero-hub-node-3 { top: 50%; left: 14%; animation-delay: .3s; }
.hero-hub-node-4 { top: 50%; left: 86%; animation-delay: .4s; }
.hero-hub-node-5 { top: 80%; left: 28%; animation-delay: .5s; }
.hero-hub-node-6 { top: 80%; left: 72%; animation-delay: .6s; }

@media (prefers-reduced-motion: reduce) {
  .hub-line, .hero-hub-center, .hero-hub-center::before, .hero-hub-node { animation: none; }
  .hero-hub-node { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ==== Cards ==== */
.surface-card {
  /* var(--border-color) alone (#e6e8ef in light mode) barely shows up against a white card —
     a slightly darker, higher-contrast border so it's actually visible as an outline. */
  background: var(--bg-surface); border: 1px solid var(--card-border-color, var(--border-color));
  border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.surface-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.module-card { padding: 1.75rem; height: 100%; }
.module-card .icon-wrap {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .12); color: var(--accent); font-size: 1.4rem; margin-bottom: 1rem;
}
.module-card .badge-soon {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; background: var(--bg-surface-alt);
  color: var(--text-muted); padding: .25rem .6rem; border-radius: 999px;
}

/* ==== Live Test badge (navbar + exam-category cards) ==== */
.live-test-badge {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(220, 38, 38, .12); color: #dc2626; padding: .25rem .7rem; border-radius: 999px; font-weight: 700;
}
.live-test-dot { width: 7px; height: 7px; border-radius: 50%; background: #dc2626; flex-shrink: 0; animation: liveTestPulse 1.4s ease-in-out infinite; }
@keyframes liveTestPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .live-test-dot { animation: none; } }

/* ==== Practice calendar (dashboard) ==== */
/* Capped max-width so cells stay compact (~44px) instead of stretching to the full width
   of a col-12 card, which made every day-cell balloon to 200px+ on wide screens. */
.practice-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; max-width: 360px; }
.practice-calendar-dow {
  text-align: center; font-size: .64rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .02em; color: var(--text-muted); padding-bottom: .25rem;
}
.practice-calendar-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: .74rem; font-weight: 600;
}
.practice-calendar-empty { visibility: hidden; }
.practice-calendar-met { background: #16a34a; color: #fff; }
.practice-calendar-miss { background: var(--bg-surface-alt); color: var(--text-muted); }
.practice-calendar-future { background: transparent; border: 1px dashed var(--border-color); color: var(--text-muted); opacity: .5; }
.practice-calendar-today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ==== Exam Progress (dashboard) ==== */
.exam-progress-section {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .08), var(--bg-surface) 55%);
  border: 1px solid rgba(var(--accent-rgb), .25);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.exam-progress-title-icon {
  width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .15); font-size: 1rem;
}
.exam-progress-toggle-chevron { display: inline-block; transition: transform .2s ease; color: var(--text-muted); }
#examProgressToggle.collapsed .exam-progress-toggle-chevron { transform: rotate(-90deg); }
.exam-progress-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem;
}
.exam-progress-item {
  display: block; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px;
  padding: 1rem; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.exam-progress-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(var(--accent-rgb), .4); color: inherit; }
.exam-progress-name { font-weight: 600; font-size: .88rem; }
.exam-progress-pct-badge {
  font-size: .72rem; font-weight: 700; color: var(--accent); background: rgba(var(--accent-rgb), .12);
  padding: .15rem .5rem; border-radius: 999px; flex-shrink: 0;
}
.exam-progress-diff-rows { display: flex; flex-direction: column; gap: .4rem; }
.exam-progress-diff-row { display: flex; align-items: center; gap: .5rem; }
.exam-progress-diff-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; width: 3.2rem; flex-shrink: 0; }
.exam-progress-diff-easy { color: #16a34a; }
.exam-progress-diff-medium { color: #d97706; }
.exam-progress-diff-hard { color: #dc2626; }
.exam-progress-diff-count { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }

/* ==== Dashboard (user) — everything except .exam-progress-section above, which keeps its
   own existing look and its collapse-by-default toggle. ==== */
.dash-profile-card {
  background: linear-gradient(120deg, rgba(var(--accent-rgb), .1), var(--bg-surface) 60%);
  border-color: rgba(var(--accent-rgb), .2) !important;
}
.dash-profile-avatar-ring {
  padding: 3px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #7c3aed));
}
.dash-profile-avatar-ring .profile-avatar-img, .dash-profile-avatar-ring .profile-avatar-placeholder {
  display: block; border: 3px solid var(--bg-surface);
}

.dash-stat-card {
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px;
  padding: 1.35rem 1rem; text-align: center; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.dash-stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dash-stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--dash-stat-color, var(--accent));
}
.dash-stat-icon {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--dash-stat-color, var(--accent)) 15%, transparent);
  color: var(--dash-stat-color, var(--accent)); font-size: 1.1rem; margin-bottom: .6rem;
}
.dash-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.dash-stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; margin-top: .15rem; }

.dash-mini-stat { display: flex; align-items: center; gap: .75rem; }
.dash-mini-stat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .12); color: var(--accent); font-size: 1.2rem; flex-shrink: 0;
}
.dash-mini-stat-value { font-size: 1.35rem; font-weight: 800; line-height: 1.15; color: var(--text-primary); }
.dash-mini-stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

.dash-card-header { display: flex; align-items: center; gap: .65rem; }
.dash-card-icon {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .13); color: var(--accent); font-size: 1.05rem; flex-shrink: 0;
}

.dash-achievement-badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; background: rgba(var(--accent-rgb), .12); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), .25);
}
.dash-achievement-badge.is-locked {
  background: var(--bg-surface-alt); color: var(--text-muted); border-color: var(--border-color); opacity: .6;
}
.dash-game-stat { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .88rem; }

.dash-search-wrap { position: relative; width: 200px; max-width: 100%; }
.dash-search-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; transition: color .15s ease;
}
.dash-search-wrap:focus-within .dash-search-icon { color: var(--accent); }
.dash-search-input {
  width: 100%; border-radius: 999px; padding: .4rem .8rem .4rem 2.1rem; font-size: .85rem;
  border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-primary);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dash-search-input::-webkit-search-cancel-button { display: none; }
.dash-search-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 .15rem rgba(var(--accent-rgb), .16);
}

.eyebrow-label {
  display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin-bottom: .5rem;
}
.section-title { font-weight: 800; margin-bottom: .5rem; }
.section-subtitle { color: var(--text-muted); margin-bottom: 2.5rem; }

/* Feature grid cards — top accent bar cycles through the same 4 colors used
   for finger-guidance keys in typing.css, kept independent of the user's
   accent color so the grid reads as a distinct set at a glance. */
.feature-card { position: relative; overflow: hidden; border-top: 3px solid transparent; }
.feature-accent-0 { border-top-color: #ef4444; }
.feature-accent-1 { border-top-color: #f59e0b; }
.feature-accent-2 { border-top-color: #10b981; }
.feature-accent-3 { border-top-color: #3b82f6; }
.feature-num {
  position: absolute; top: .5rem; right: 1rem; font-size: 2.5rem; font-weight: 800;
  color: var(--text-primary); opacity: .06; line-height: 1; user-select: none;
}


/* ==== Skeleton loaders ==== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-alt) 25%, var(--border-color) 37%, var(--bg-surface-alt) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==== Notice modal (e.g. home page exam-logo announcement) ==== */
.notice-modal-content { border: none; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); position: relative; }
.notice-modal-close { position: absolute; top: 1rem; right: 1rem; z-index: 2; }
.notice-modal-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1rem; font-size: 1.75rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .12); color: var(--accent);
}
.notice-modal-progress { height: 4px; background: var(--bg-surface-alt); }
.notice-modal-progress-bar {
  height: 100%; width: 100%; background: var(--accent); transform-origin: left;
  animation: noticeProgressShrink 20s linear forwards;
}
@keyframes noticeProgressShrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .notice-modal-progress-bar { animation: none; } }

/* Smaller footprint on phones — the bilingual (EN+HI) body text made this modal feel
   oversized on small screens, so shrink the icon/heading/text/padding together there. */
@media (max-width: 575.98px) {
  .notice-modal-content .modal-body { padding: 1.25rem !important; }
  .notice-modal-icon { width: 44px; height: 44px; font-size: 1.25rem; margin-bottom: .6rem; }
  .notice-modal-content h5 { font-size: 1rem; }
  .notice-modal-content p { font-size: .85rem; }
  .notice-modal-content .btn { padding-top: .4rem; padding-bottom: .4rem; font-size: .85rem; }
}

/* ==== Animations ==== */
.fade-in-up { animation: fadeInUp .6s ease both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in-up, .skeleton { animation: none; }
}

/* ==== Forms / Auth ==== */
.auth-card { max-width: 440px; margin: 0 auto; padding: 2.25rem !important; box-shadow: var(--shadow-md); }
.captcha-box img { border-radius: 8px; border: 1px solid var(--border-color); }
.auth-benefits { list-style: none; padding: 0; margin: 1.5rem 0; }
.auth-benefits li { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .85rem; color: var(--text-primary); }
.auth-benefits li .icon { color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ==== Auth v2 (card-style login/register) ====
   Deliberately styled away from the generic "pill tabs + icon inputs + arrow-emoji button"
   template look: the left panel reads as a terminal/editor window (brand-relevant for a
   typing site), feature cards are glass-on-gradient, tabs are underline-style, and the CTA
   is a pill button with a CSS-driven sliding arrow instead of an emoji prefix in the label. */
.auth-page-v2 { background: var(--bg-surface-alt); min-height: calc(100vh - 400px); padding: 3.5rem 0; }
.auth-card-v2 {
  max-width: 460px; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.auth-card-v2::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #7c3aed));
}
.auth-card-v2-wide { max-width: 900px; }
.auth-logo-img { height: 40px; width: auto; }
.auth-v2-icon-input { position: relative; }
.auth-v2-icon-input .auth-v2-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); pointer-events: none; font-size: .9rem; opacity: .8;
}
.auth-v2-icon-input .form-control { padding-left: 2.5rem; border-radius: 8px; }
.auth-v2-icon-input .auth-v2-toggle-pw {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px;
}

/* Live password requirement checklist (register.php) — each item starts neutral, turns
   green with a check once its rule is met, and only turns red once the student has typed
   something that fails it (an empty field isn't "wrong" yet, just not started). */
.pw-checklist {
  list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem .7rem;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .2s ease, opacity .2s ease, margin-top .2s ease;
}
.pw-checklist.is-visible { max-height: 4rem; opacity: 1; margin-top: .5rem; }
.pw-checklist-item { font-size: .76rem; color: var(--text-muted); padding-left: 1.1rem; position: relative; transition: color .15s ease; }
.pw-checklist-item::before { content: '\2022'; position: absolute; left: 0; top: 0; font-weight: 700; }
.pw-checklist-item.is-met { color: #16a34a; }
.pw-checklist-item.is-met::before { content: '\2713'; }
.pw-checklist-item.is-unmet { color: #dc2626; }
.pw-checklist-item.is-unmet::before { content: '\2715'; }

/* Live "do the two password fields match" feedback (register.php), shown only once the
   Confirm Password field has content — silent while empty rather than flashing red. */
.pw-match-msg { font-size: .78rem; margin-top: .4rem; min-height: 1.1em; font-weight: 600; }
.pw-match-msg.is-match { color: #16a34a; }
.pw-match-msg.is-mismatch { color: #dc2626; }
.auth-v2-cta-btn {
  width: 100%; border: none; border-radius: 999px; padding: .8rem 1.5rem; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 75%, #4338ca));
  display: flex; align-items: center; justify-content: center; gap: .5rem; letter-spacing: .01em;
  transition: box-shadow .15s ease, transform .15s ease;
}
.auth-v2-cta-btn::after {
  content: '\2192'; display: inline-block; transition: transform .15s ease; font-weight: 400;
}
.auth-v2-cta-btn:hover { color: #fff; box-shadow: 0 6px 18px rgba(var(--accent-rgb), .35); transform: translateY(-1px); }
.auth-v2-cta-btn:hover::after { transform: translateX(3px); }

/* Terminal/editor-window left panel — a typing-tool visual cue, not a generic gradient card */
.auth-v2-panel {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--bg-surface-alt)), var(--bg-surface-alt) 60%);
  border: 1px solid var(--border-color); border-radius: 14px; padding: 0; height: 100%; overflow: hidden;
}
.auth-v2-panel-chrome {
  display: flex; align-items: center; gap: 6px; padding: .7rem 1rem; border-bottom: 1px solid var(--border-color);
  background: rgba(0,0,0,.04);
}
.auth-v2-panel-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-color); }
.auth-v2-panel-dot:nth-child(1) { background: #ef4444; }
.auth-v2-panel-dot:nth-child(2) { background: #f59e0b; }
.auth-v2-panel-dot:nth-child(3) { background: #22c55e; }
.auth-v2-panel-path {
  margin-left: .5rem; font-family: 'Courier New', monospace; font-size: .75rem; color: var(--text-muted);
}
.auth-v2-panel-body { padding: 2.25rem 2.5rem 2.5rem; }
.auth-v2-typed-cursor {
  display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: text-bottom;
  margin-left: 2px; animation: authCursorBlink 1s step-end infinite;
}
@keyframes authCursorBlink { 50% { opacity: 0; } }
.auth-v2-feature-card {
  background: color-mix(in srgb, var(--bg-surface) 70%, transparent); backdrop-filter: blur(6px);
  border: 1px solid rgba(var(--accent-rgb), .18); border-radius: 10px; padding: 1rem;
}
.auth-v2-feature-icon {
  width: 34px; height: 34px; border-radius: 8px; background: rgba(var(--accent-rgb), .14); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: .6rem;
}
.auth-v2-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--border-color); margin-bottom: 1.75rem; }
.auth-v2-tab {
  padding: 0 0 .8rem; font-weight: 700; font-size: .92rem; color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease;
}
.auth-v2-tab:hover { color: var(--text-primary); }
.auth-v2-tab.is-active { color: var(--accent); border-color: var(--accent); }

.auth-v2-google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .65rem;
  padding: .65rem 1rem; border: 1px solid var(--border-color); border-radius: 10px;
  background: var(--bg-surface); color: var(--text-primary); font-weight: 600; font-size: .92rem;
  text-decoration: none; margin-bottom: 1.25rem; transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.auth-v2-google-btn:hover { background: var(--bg-surface-alt); color: var(--text-primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.auth-v2-divider {
  display: flex; align-items: center; gap: .75rem; text-align: center; color: var(--text-muted);
  font-size: .8rem; margin-bottom: 1.25rem;
}
.auth-v2-divider::before, .auth-v2-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }

/* Shared form-field polish for auth + contact forms */
.form-control, .form-select {
  border-color: var(--border-color); border-radius: .6rem; padding: .55rem .9rem;
  background-color: var(--bg-surface); color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .18);
  background-color: var(--bg-surface); color: var(--text-primary);
}
.form-label { font-weight: 600; font-size: .9rem; }
.visually-hidden-honeypot { position: absolute; left: -9999px; }

/* ==== FAQ ==== */
.accordion-button:not(.collapsed) { color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .25); }

/* ==== Utility ==== */
.error-page { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rounded-16 { border-radius: 16px; }

/* ==== Back to top ====
   Stacked above the floating Chat & Support button (also bottom-right, see chat.css
   .chat-widget) rather than sharing its exact position — they used to sit at identical
   fixed coordinates and render directly on top of each other. */
.back-to-top-btn {
  position: fixed; right: 1.5rem; bottom: 5.5rem; z-index: 1040;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.back-to-top-btn.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top-btn:hover { color: #fff; background: var(--accent); }
/* While the chat panel is open it expands upward from the same corner and would collide
   with this button too — hide it for that duration rather than fighting for the space. */
.chat-widget:has(#chatWidgetPanel:not(.d-none)) ~ .back-to-top-btn {
  opacity: 0; visibility: hidden; pointer-events: none;
}
@media (max-width: 576px) {
  .back-to-top-btn { right: 1rem; bottom: 4.5rem; width: 40px; height: 40px; font-size: 1.05rem; }
}
@media print {
  .back-to-top-btn { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top-btn { transition: none; }
}
