/* ==========================================================================
   eTutor.my — Portal Set Soalan Interaktif Harian
   Design System: ui-ux-pro-max (#179 LMS + #121 Quiz Leaderboard)
   Modern Web Standards: 100dvh, @container, :user-invalid, <progress>, <dialog>
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&family=Lexend:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --icon-check: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'></polyline></svg>");

  /* Brand & Semantic Tokens (WCAG AA >= 4.5:1) */
  --logo-royal: #1d49c9;
  --logo-navy: #121e48;
  --brand-navy: #0f172a;
  --brand-primary: #1e3a8a;
  --brand-accent: #2563eb;
  --brand-accent-hover: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;

  --grade-emerald: #047857;
  --grade-emerald-fill: #059669;
  --grade-emerald-soft: #ecfdf5;
  --grade-emerald-border: #a7f3d0;

  --grade-gold: #b45309;
  --grade-gold-fill: #d97706;
  --grade-gold-soft: #fffbeb;
  --grade-gold-border: #fde68a;

  --status-danger: #b91c1c;
  --status-danger-soft: #fef2f2;
  --status-danger-border: #fecaca;

  --surface-page: #f8fafc;
  --surface-card: #ffffff;
  --surface-subtle: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --focus-ring: #2563eb;

  /* Typography */
  --font-heading: 'Lexend', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing Rhythm (4px / 8px) & Radii */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow-sm: 0 2px 6px -1px rgb(15 23 42 / 0.07), 0 1px 3px -1px rgb(15 23 42 / 0.05);
  --shadow-md: 0 10px 24px -6px rgb(15 23 42 / 0.09), 0 4px 10px -4px rgb(15 23 42 / 0.05);

  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 150ms;

  /* Enable native CSS transitions to intrinsic keywords (auto) for FAQ disclosures */
  interpolate-size: allow-keywords;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface-page);
  color: var(--text-primary);
  line-height: 1.55;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Visible Accessibility Focus */
:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* SVG Vector Icon Sizing Tokens */
.icon {
  inline-size: 20px;
  block-size: 20px;
  flex-shrink: 0;
  stroke-width: 1.85;
}
.icon-sm {
  inline-size: 16px;
  block-size: 16px;
}
.icon-lg {
  inline-size: 24px;
  block-size: 24px;
}

/* ==========================================================================
   BUTTONS & INTERACTIVE CHIPS (>= 44px Touch Target, Zero Layout Shift)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: 44px;
  padding-inline: var(--space-4);
  padding-block: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              opacity var(--duration-fast) var(--ease-standard);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--brand-accent);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-accent-hover);
}

.btn-emerald {
  background-color: var(--grade-emerald-fill);
  color: #ffffff;
}
.btn-emerald:hover:not(:disabled) {
  background-color: var(--grade-emerald);
}

.btn-outline {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-outline:hover:not(:disabled) {
  background-color: var(--surface-subtle);
  border-color: var(--text-muted);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--surface-subtle);
  color: var(--text-primary);
}

.btn-sm {
  min-block-size: 40px;
  padding-inline: var(--space-3);
  font-size: 0.85rem;
}

/* ==========================================================================
   LOGIN VIEW (:user-invalid & Hints Above Input)
   ========================================================================== */
.login-shell {
  position: relative;
  overflow: hidden;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background:
    radial-gradient(circle at 12% 15%, rgb(37 99 235 / 0.09), transparent 40%),
    radial-gradient(circle at 88% 85%, rgb(5 150 105 / 0.08), transparent 40%),
    var(--surface-page);
}

.login-bg-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
  will-change: transform;
}

.login-bg-orbs .orb-blue {
  inline-size: 320px;
  block-size: 320px;
  inset-block-start: -80px;
  inset-inline-start: -60px;
  background: rgb(37 99 235 / 0.22);
}

.login-bg-orbs .orb-emerald {
  inline-size: 280px;
  block-size: 280px;
  inset-block-end: -70px;
  inset-inline-end: -50px;
  background: rgb(5 150 105 / 0.2);
}

.login-bg-orbs .orb-gold {
  inline-size: 220px;
  block-size: 220px;
  inset-block-end: 18%;
  inset-inline-start: 14%;
  background: rgb(245 158 11 / 0.14);
}

.login-card {
  position: relative;
  z-index: 1;
  inline-size: min(100%, 450px);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 5vw, 36px);
}

/* Official eTutor.my Two-Tone Brand Emblem & Wordmark Lockup */
.etutor-svg-sprite {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
  pointer-events: none;
}

.etutor-logo-lockup {
  --emblem-blue: var(--logo-royal);
  --emblem-navy: var(--logo-navy);
  --emblem-cutout: #ffffff;
  --logo-etutor-color: var(--logo-royal);
  --logo-dotmy-color: var(--logo-navy);
  --logo-tagline-color: #172554;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.etutor-emblem-svg {
  flex-shrink: 0;
  display: block;
}

.etutor-logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.etutor-wordmark {
  font-family: var(--font-sans);
  font-size: 1.34rem;
  line-height: 1.04;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.etutor-wordmark .wm-etutor {
  font-weight: 800;
  color: var(--logo-etutor-color);
}

.etutor-wordmark .wm-dotmy {
  font-weight: 400;
  color: var(--logo-dotmy-color);
}

.etutor-tagline {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--logo-tagline-color);
  margin-block-start: 2px;
}

.etutor-logo-lg {
  gap: 14px;
}

.etutor-logo-lg .etutor-wordmark {
  font-size: clamp(1.65rem, 1.4rem + 0.9vw, 2.02rem);
}

.etutor-logo-lg .etutor-tagline {
  font-size: 0.82rem;
  margin-block-start: 3px;
}

.etutor-logo-sm {
  gap: 9px;
}

.etutor-logo-sm .etutor-wordmark {
  font-size: 1.15rem;
}

.etutor-logo-on-dark {
  --emblem-blue: #3b82f6;
  --emblem-navy: #f1f5f9;
  --emblem-cutout: var(--brand-navy);
  --logo-etutor-color: #60a5fa;
  --logo-dotmy-color: #ffffff;
  --logo-tagline-color: #cbd5e1;
}

.login-brand-header {
  display: flex;
  justify-content: center;
  padding-block-end: var(--space-4);
  margin-block-end: var(--space-5);
  border-block-end: 1px solid var(--border-subtle);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}

.brand-logo-box {
  inline-size: 46px;
  block-size: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.login-card h1 {
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.65rem);
  color: var(--text-primary);
  margin-block-end: var(--space-2);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-block-end: var(--space-6);
}

.form-field {
  margin-block-end: var(--space-5);
}

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-block-end: 2px;
}

.field-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-block-end: var(--space-2);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.text-input {
  inline-size: 100%;
  min-block-size: 46px;
  padding-inline: var(--space-4);
  padding-block: 10px;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  color: var(--text-primary);
  background-color: var(--surface-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard);
}

.text-input.has-trailing-btn {
  padding-inline-end: 52px;
}

.pin-toggle-btn {
  position: absolute;
  inset-inline-end: 2px;
  inline-size: 44px;
  block-size: 42px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pin-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-subtle);
}

.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  margin-block-start: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--status-danger);
}

/* Validate-input-after-interaction (:user-invalid + fallback) */
.text-input:user-invalid,
.text-input.user-invalid-fallback {
  border-color: var(--status-danger);
  background-color: var(--status-danger-soft);
}

.form-field:has(.text-input:user-invalid) .field-error,
.form-field:has(.text-input.user-invalid-fallback) .field-error {
  display: flex;
}

.text-input:user-valid {
  border-color: var(--grade-emerald-fill);
}

.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-block-end: var(--space-4);
}
.alert-danger {
  background: var(--status-danger-soft);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

/* ==========================================================================
   ADMIN SUBSCRIPTION & ACCESS CONTROL PANEL (#admin)
   ========================================================================== */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.admin-upsert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-4);
}

.admin-users-table {
  --adm-label-2: "PIN";
  --adm-label-3: "Pakej";
  --adm-label-4: "Status";
  --adm-label-5: "Peranti";
  --adm-label-6: "Akses Terakhir";
  --adm-label-7: "Tindakan";
}

.admin-logs-table {
  --log-label-2: "ID Pengguna";
  --log-label-3: "Peristiwa";
  --log-label-4: "Peranti";
  --log-label-5: "Butiran";
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-xs {
  min-block-size: 36px;
  padding-inline: 10px;
  padding-block: 4px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

@container (width < 680px) {
  .admin-users-table,
  .admin-users-table thead,
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table th,
  .admin-users-table td,
  .admin-logs-table,
  .admin-logs-table thead,
  .admin-logs-table tbody,
  .admin-logs-table tr,
  .admin-logs-table th,
  .admin-logs-table td {
    display: block;
  }
  .admin-users-table thead,
  .admin-logs-table thead {
    display: none;
  }
  .admin-users-table td:nth-child(2)::before { content: var(--adm-label-2) ": "; color: var(--text-muted); }
  .admin-users-table td:nth-child(3)::before { content: var(--adm-label-3) ": "; color: var(--text-muted); }
  .admin-users-table td:nth-child(4)::before { content: var(--adm-label-4) ": "; color: var(--text-muted); }
  .admin-users-table td:nth-child(5)::before { content: var(--adm-label-5) ": "; color: var(--text-muted); }
  .admin-users-table td:nth-child(6)::before { content: var(--adm-label-6) ": "; color: var(--text-muted); }
  .admin-users-table td:nth-child(7)::before { content: var(--adm-label-7) ": "; color: var(--text-muted); }

  .admin-logs-table td:nth-child(2)::before { content: var(--log-label-2) ": "; color: var(--text-muted); }
  .admin-logs-table td:nth-child(3)::before { content: var(--log-label-3) ": "; color: var(--text-muted); }
  .admin-logs-table td:nth-child(4)::before { content: var(--log-label-4) ": "; color: var(--text-muted); }
  .admin-logs-table td:nth-child(5)::before { content: var(--log-label-5) ": "; color: var(--text-muted); }
}

/* ==========================================================================
   TOP NAVIGATION BAR (Authenticated Dashboard)
   ========================================================================== */
.portal-topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-inline-size: 1320px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 32px);
  min-block-size: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text-primary);
}
.topbar-brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-user-area {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   DASHBOARD CONTAINER & SECTION HEADINGS
   ========================================================================== */
.dashboard-main {
  max-inline-size: 1320px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 32px);
  padding-block: var(--space-6) var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-block-end: var(--space-4);
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title {
  font-size: clamp(1.12rem, 1.02rem + 0.5vw, 1.35rem);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ==========================================================================
   1. CONTINUE PROGRESS HERO CARD
   ========================================================================== */
.continue-section {
  container-type: inline-size;
}

.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: var(--space-4);
}

.continue-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
}

.continue-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.continue-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.16);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.continue-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-block-start: var(--space-2);
  color: #ffffff;
}

.continue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 0.84rem;
  color: #cbd5e1;
}

.continue-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.continue-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.continue-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.btn-continue-white {
  background: #ffffff;
  color: var(--brand-primary);
  font-weight: 700;
}
.btn-continue-white:hover {
  background: #eff6ff;
}

.btn-continue-subtle {
  background: rgb(255 255 255 / 0.12);
  color: #f8fafc;
  border-color: rgb(255 255 255 / 0.25);
}
.btn-continue-subtle:hover {
  background: rgb(255 255 255 / 0.2);
}

/* ==========================================================================
   NATIVE <progress> STYLING (Separate -webkit & -moz rules per specification)
   ========================================================================== */
progress.etutor-progress {
  appearance: none;
  border: 0 solid;
  overflow: clip;
  inline-size: 100%;
  block-size: 10px;
  --progress-bar-radius: 9999px;
  border-radius: var(--progress-bar-radius);
  background: var(--progress-track, var(--surface-subtle));
}

progress.etutor-progress.on-dark {
  --progress-track: rgb(255 255 255 / 0.2);
  --progress-fill: #34d399;
}

progress.etutor-progress::-webkit-progress-bar {
  background: transparent;
}

progress.etutor-progress::-webkit-progress-value {
  background: var(--progress-fill, var(--brand-accent));
  border-radius: var(--progress-bar-radius);
  transition: inline-size 0.3s var(--ease-standard);
}

progress.etutor-progress::-moz-progress-bar {
  background: var(--progress-fill, var(--brand-accent));
  border-radius: var(--progress-bar-radius);
  transition: inline-size 0.3s var(--ease-standard);
}

/* ==========================================================================
   2. BENTO PROGRESS OVERVIEW (Progress Ring + KPIs + Subject Bars + Weak Topics)
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}

.bento-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.bento-completion {
  grid-column: span 4;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.bento-kpis {
  grid-column: span 4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.bento-subjects {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bento-weak-topics {
  grid-column: span 12;
}

@media (max-width: 1060px) {
  .bento-completion,
  .bento-kpis,
  .bento-subjects {
    grid-column: span 6;
  }
  .bento-subjects {
    grid-column: span 12;
  }
}

@media (max-width: 680px) {
  .bento-completion,
  .bento-kpis,
  .bento-subjects,
  .bento-weak-topics {
    grid-column: span 12;
  }
}

/* Conic Progress Ring (Semantic <progress> + @property + mask-image fallback) */
@property --ring-pct {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.progress-ring-wrapper {
  position: relative;
  inline-size: 96px;
  block-size: 96px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

progress.progress-ring {
  --ring-pct: 0;
  --thickness: 11px;
  appearance: none;
  inline-size: 96px;
  block-size: 96px;
  border-radius: 50%;
  background: conic-gradient(
    var(--grade-emerald-fill) calc(var(--ring-pct) * 1%),
    var(--surface-subtle) 0
  );
  background-clip: border-area;
  border: var(--thickness) solid transparent;
  background-origin: border-box;
  transition: --ring-pct 0s ease-in-out;
}

@media (prefers-reduced-motion: no-preference) {
  progress.progress-ring {
    transition-duration: 0.4s;
  }
}

@supports not (background-clip: border-area) {
  progress.progress-ring {
    mask-image: radial-gradient(
      transparent calc(50% - var(--thickness)),
      black calc(50% - var(--thickness) + 0.5px)
    );
    -webkit-mask-image: radial-gradient(
      transparent calc(50% - var(--thickness)),
      black calc(50% - var(--thickness) + 0.5px)
    );
    border: 0;
  }
}

progress.progress-ring::-webkit-progress-bar {
  display: none;
  background: none;
}
progress.progress-ring::-webkit-progress-value {
  display: none;
  background: none;
}
progress.progress-ring::-moz-progress-bar {
  display: none;
  background: none;
}

.progress-ring-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.progress-ring-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.progress-ring-caption {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-tile {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.subject-bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-block-size: 165px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.subject-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subject-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.weak-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-2);
}

.weak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--grade-gold-soft);
  border: 1px solid var(--grade-gold-border);
  color: var(--grade-gold);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ==========================================================================
   3. LEADERBOARD SECTION (Top 3 Podium + @container Responsive Table)
   ========================================================================== */
.leaderboard-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-xs);
}

.leaderboard-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.tab-chip {
  min-block-size: 44px;
  padding-inline: 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.tab-chip[aria-pressed="true"] {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.select-control {
  min-block-size: 44px;
  padding-inline: 12px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-card);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}

.podium-tile {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  background: var(--surface-page);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.podium-tile.rank-1 {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
}
.podium-tile.rank-2 {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
}
.podium-tile.rank-3 {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
}

.podium-medal {
  inline-size: 42px;
  block-size: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}
.rank-1 .podium-medal { background: #f59e0b; color: #ffffff; }
.rank-2 .podium-medal { background: #64748b; color: #ffffff; }
.rank-3 .podium-medal { background: #ea580c; color: #ffffff; }

.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.lb-table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  --label-2: "Set Selesai";
  --label-3: "Purata Markah";
  --label-4: "Gred";
  --label-5: "Mata XP";
}

.lb-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: var(--surface-subtle);
}

.lb-table th,
.lb-table td {
  padding: 12px 16px;
  text-align: start;
  border-block-end: 1px solid var(--border-subtle);
}

.lb-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

.lb-table tbody tr:last-child th,
.lb-table tbody tr:last-child td {
  border-block-end: 0;
}

.lb-table tbody tr {
  background-color: var(--surface-card);
}

.lb-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background-color: inherit;
}

.lb-table tbody tr.is-me {
  background-color: var(--brand-soft);
}

.you-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-inline-start: 6px;
  border-radius: var(--radius-pill);
  background: var(--brand-accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.my-standing-footer {
  margin-block-start: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--brand-primary);
  font-weight: 600;
}

@container (width < 580px) {
  .lb-table,
  .lb-table thead,
  .lb-table tbody,
  .lb-table tr,
  .lb-table th,
  .lb-table td {
    display: block;
  }
  .lb-table thead {
    display: none;
  }
  .lb-table tbody tr {
    padding: 10px 14px;
    border-block-end: 1px solid var(--border-subtle);
  }
  .lb-table tbody th,
  .lb-table tbody td {
    padding: 4px 0;
    border: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .lb-table tbody th {
    font-size: 0.95rem;
    padding-block-end: 6px;
    border-block-end: 1px dashed var(--border-subtle);
    margin-block-end: 4px;
  }
  .lb-table td:nth-child(2)::before { content: var(--label-2) ": "; color: var(--text-muted); font-weight: 500; }
  .lb-table td:nth-child(3)::before { content: var(--label-3) ": "; color: var(--text-muted); font-weight: 500; }
  .lb-table td:nth-child(4)::before { content: var(--label-4) ": "; color: var(--text-muted); font-weight: 500; }
  .lb-table td:nth-child(5)::before { content: var(--label-5) ": "; color: var(--text-muted); font-weight: 500; }
}

/* ==========================================================================
   4. QUESTION BANK CATALOG & FILTERS
   ========================================================================== */
.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}

.search-and-status-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .icon {
  position: absolute;
  inset-inline-start: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  inline-size: 100%;
  min-block-size: 44px;
  padding-inline: 42px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.chip-scroll-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: var(--space-4);
}

.quiz-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              transform 200ms var(--ease-standard);
}
.quiz-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .quiz-card:hover {
    transform: translateY(-2px);
  }
}

.quiz-card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
}
.badge-subject {
  background: var(--brand-soft);
  color: var(--brand-primary);
}
.badge-done {
  background: var(--grade-emerald-soft);
  color: var(--grade-emerald);
  border: 1px solid var(--grade-emerald-border);
}
.badge-progress {
  background: var(--grade-gold-soft);
  color: var(--grade-gold);
  border: 1px solid var(--grade-gold-border);
}
.badge-new {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.quiz-card-title {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-block-start: var(--space-2);
}

.quiz-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-block-start: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quiz-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--border-subtle);
}

.quiz-card-footer .btn {
  flex: 1;
}

/* ==========================================================================
   FULL-SCREEN EXAM VIEW (100dvh + <iframe srcdoc>)
   ========================================================================== */
.exam-stage {
  position: fixed;
  inset: 0;
  z-index: 60;
  inline-size: 100vw;
  block-size: 100vh;
  block-size: 100dvh;
  background: var(--surface-page);
  display: flex;
  flex-direction: column;
}

.exam-stage-bar {
  min-block-size: 54px;
  padding-inline: var(--space-4);
  padding-block: 6px;
  background: var(--brand-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
}

.exam-stage-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 0;
}

.exam-stage-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-stage-back {
  background: rgb(255 255 255 / 0.12);
  color: #ffffff;
  border-color: rgb(255 255 255 / 0.2);
}
.btn-stage-back:hover {
  background: rgb(255 255 255 / 0.22);
}

.sync-indicator {
  font-size: 0.76rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exam-iframe {
  flex: 1;
  inline-size: 100%;
  border: 0;
  background: #f8fafc;
}

/* ==========================================================================
   OFFICIAL RESULT SLIP <dialog>, TOP-LAYER MOTION & PRINT ISOLATION
   ========================================================================== */
dialog.slip-dialog {
  margin: auto;
  inline-size: min(94vw, 600px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 0;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: scale(0.94) translateY(8px);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.26s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog.slip-dialog::backdrop {
  background-color: rgb(15 23 42 / 0);
  backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.26s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(dialog.slip-dialog[open]):where(:not([data-closing])) {
  opacity: 1;
  transform: scale(1) translateY(0);

  @starting-style {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }

  &::backdrop {
    background-color: rgb(15 23 42 / 0.62);
    backdrop-filter: blur(3px);

    @starting-style {
      background-color: rgb(15 23 42 / 0);
      backdrop-filter: blur(0px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.slip-dialog {
    transform: none;
    transition-duration: 0.1s;
  }
  :is(dialog.slip-dialog[open]):where(:not([data-closing])) {
    transform: none;
    @starting-style {
      transform: none;
    }
  }
}

/* Confetti Burst Layer (GPU-Composited Quiz Completion Celebration) */
.confetti-burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}

.confetti-dot {
  position: absolute;
  inline-size: 8px;
  block-size: 8px;
  margin-inline-start: -4px;
  margin-block-start: -4px;
  border-radius: 2px;
  will-change: transform, opacity;
}

.slip-paper {
  padding: var(--space-6);
}

.slip-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding-block-end: var(--space-4);
  border-block-end: 2px solid var(--brand-primary);
  margin-block-end: var(--space-5);
}

.slip-score-banner {
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  margin-block-bottom: var(--space-5);
  margin-block-end: var(--space-5);
}

.slip-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  font-size: 0.88rem;
  margin-block-end: var(--space-4);
}

.slip-actions {
  padding: var(--space-4) var(--space-6);
  background: var(--surface-subtle);
  border-block-start: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Toast Notification */
.toast-banner {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 90;
  background: var(--brand-navy);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 500;
  max-inline-size: 360px;
}

/* ==========================================================================
   5. HIGH-CONVERSION SALES & CREDIBILITY LANDING PAGE (ui-ux-pro-max)
   ========================================================================== */

.lp-shell {
  background: var(--surface-page);
  color: var(--text-primary);
  overflow-x: clip;
}

.lp-shell section[id] {
  scroll-margin-block-start: 88px;
}

/* Below-the-fold rendering deferral (modern-web-guidance: defer-rendering-heavy-content) */
.lp-deferred-section {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 520px;
}

.lp-container {
  max-inline-size: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* Sticky Conversion Header */
.lp-navbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 60;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border-subtle);
}

.lp-navbar-inner {
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 12px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.lp-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.lp-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
}

.lp-nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 4px;
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--duration-fast) ease;
}

.lp-nav-links a:hover {
  color: var(--brand-accent);
}

.lp-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 920px) {
  .lp-nav-links {
    display: none;
  }
}

@media (max-width: 520px) {
  .lp-nav-actions .lp-hide-xs {
    display: none;
  }
}

/* Hero Section (Above the Fold — Never apply content-visibility: auto here) */
.lp-hero {
  position: relative;
  padding-block: clamp(36px, 6vw, 76px) clamp(40px, 6vw, 72px);
  background:
    radial-gradient(circle at 12% 18%, rgb(37 99 235 / 0.09), transparent 42%),
    radial-gradient(circle at 88% 22%, rgb(5 150 105 / 0.08), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-block-end: 1px solid var(--border-subtle);
}

.lp-hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(28px, 4.5vw, 56px);
  align-items: center;
}

@media (max-width: 960px) {
  .lp-hero-grid {
    grid-template-columns: 1fr;
  }
}

.lp-trust-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand-primary);
  font-size: 0.8rem;
  font-weight: 700;
  margin-block-end: var(--space-4);
}

.lp-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 1.35rem + 2.15vw, 3.05rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--brand-navy);
  text-wrap: balance;
  margin-block-end: var(--space-4);
}

.lp-text-highlight {
  color: var(--brand-accent);
}

.lp-hero-lead {
  font-size: clamp(0.98rem, 0.94rem + 0.25vw, 1.1rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-inline-size: 62ch;
  margin-block-end: var(--space-6);
}

.lp-hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-end: var(--space-5);
}

.btn-lg {
  min-block-size: 50px;
  padding: 12px 24px;
  font-size: 0.98rem;
  font-weight: 700;
}

.btn-emerald {
  background: var(--grade-emerald);
  color: #ffffff;
  border: 1px solid var(--grade-emerald);
  box-shadow: 0 6px 18px -4px rgb(4 120 87 / 0.35);
}

.btn-emerald:hover {
  background: #065f46;
  border-color: #065f46;
}

.lp-micro-guarantees {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.lp-micro-guarantees li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lp-micro-guarantees svg {
  color: var(--grade-emerald);
  flex-shrink: 0;
}

/* Authentic Live Portal UI Preview Frame */
.lp-browser-frame {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 22px 48px -12px rgb(15 23 42 / 0.14), 0 4px 14px -4px rgb(15 23 42 / 0.06);
  overflow: hidden;
}

.lp-browser-bar {
  background: var(--surface-subtle);
  border-block-end: 1px solid var(--border-subtle);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lp-browser-dots {
  display: flex;
  gap: 6px;
}

.lp-browser-dots span {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.lp-browser-url {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--grade-emerald);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.lp-preview-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-preview-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.lp-mini-ring {
  inline-size: 68px;
  block-size: 68px;
  border-radius: 50%;
  background: conic-gradient(var(--grade-emerald-fill) 88%, var(--border-subtle) 0);
  display: grid;
  place-items: center;
}

.lp-mini-ring-inner {
  inline-size: 50px;
  block-size: 50px;
  border-radius: 50%;
  background: var(--surface-card);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lp-preview-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lp-preview-kpi {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.lp-preview-kpi-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.lp-preview-kpi-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-block-start: 2px;
}

.lp-preview-resume {
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Credibility Metrics Strip */
.lp-trust-strip {
  background: var(--brand-navy);
  color: #ffffff;
  padding-block: 26px;
}

.lp-trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

@media (max-width: 860px) {
  .lp-trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .lp-trust-grid {
    grid-template-columns: 1fr;
  }
}

.lp-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lp-trust-icon {
  inline-size: 40px;
  block-size: 40px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.1);
  color: #93c5fd;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lp-trust-num {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.lp-trust-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-block-start: 2px;
}

/* Generic Landing Section Spacing & Headings */
.lp-section {
  padding-block: clamp(48px, 6.5vw, 84px);
}

.lp-section-alt {
  background: var(--surface-card);
  border-block: 1px solid var(--border-subtle);
}

.lp-section-head {
  text-align: center;
  max-inline-size: 720px;
  margin-inline: auto;
  margin-block-end: clamp(28px, 4vw, 44px);
}

.lp-section-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent);
  margin-block-end: 8px;
}

.lp-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2.15rem);
  color: var(--brand-navy);
  line-height: 1.22;
  text-wrap: balance;
  margin-block-end: 10px;
}

.lp-section-sub {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Interactive Mini-Quiz Sandbox (#demo-interaktif) */
.lp-demo-card {
  max-inline-size: 880px;
  margin-inline: auto;
  background: var(--surface-card);
  border: 2px solid var(--brand-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.lp-demo-topbar {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lp-demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface-subtle);
  border-block-end: 1px solid var(--border-subtle);
}

.lp-demo-tab {
  min-block-size: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.lp-demo-tab[aria-selected="true"] {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #ffffff;
}

.lp-demo-body {
  padding: clamp(18px, 3.5vw, 28px);
}

.lp-demo-q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-block-end: 10px;
}

.lp-demo-question {
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  margin-block-end: 18px;
}

.lp-demo-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .lp-demo-options {
    grid-template-columns: 1fr;
  }
}

.lp-demo-opt {
  min-block-size: 50px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: start;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.lp-demo-opt:hover {
  border-color: var(--brand-accent);
  background: var(--brand-soft);
}

.lp-demo-opt-letter {
  inline-size: 28px;
  block-size: 28px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.lp-demo-opt.is-correct {
  background: var(--grade-emerald-soft);
  border-color: var(--grade-emerald-fill);
  color: var(--grade-emerald);
}

.lp-demo-opt.is-correct .lp-demo-opt-letter {
  background: var(--grade-emerald);
  border-color: var(--grade-emerald);
  color: #ffffff;
}

.lp-demo-opt.is-wrong {
  background: var(--status-danger-soft);
  border-color: var(--status-danger);
  color: var(--status-danger);
}

.lp-demo-explain {
  margin-block-start: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--grade-emerald-soft);
  border: 1px solid var(--grade-emerald-border);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.lp-demo-explain.is-wrong-box {
  background: var(--grade-gold-soft);
  border-color: var(--grade-gold-border);
}

/* Comparison Table (@container) */
.lp-compare-container {
  container-type: inline-size;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.lp-compare-table {
  inline-size: 100%;
  border-collapse: collapse;
  min-inline-size: 620px;
}

.lp-compare-table th,
.lp-compare-table td {
  padding: 16px 20px;
  border-block-end: 1px solid var(--border-subtle);
  text-align: start;
  font-size: 0.92rem;
  vertical-align: middle;
}

.lp-compare-table thead th {
  background: var(--surface-subtle);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--brand-navy);
}

.lp-compare-table .col-etutor {
  background: var(--brand-soft);
  font-weight: 600;
  color: var(--brand-navy);
}

.lp-compare-table thead .col-etutor {
  background: var(--brand-primary);
  color: #ffffff;
}

.lp-check-yes,
.lp-check-no {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lp-check-yes svg {
  color: var(--grade-emerald);
  flex-shrink: 0;
}

.lp-check-no svg {
  color: var(--status-danger);
  flex-shrink: 0;
}

/* 6-Card Feature Bento Showcase & Subject Chips */
.lp-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 920px) {
  .lp-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .lp-features-grid {
    grid-template-columns: 1fr;
  }
}

.lp-feature-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.lp-feature-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-md);
}

.lp-feature-icon {
  inline-size: 44px;
  block-size: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand-accent);
  display: grid;
  place-items: center;
}

.lp-feature-card h3 {
  font-size: 1.05rem;
  color: var(--brand-navy);
}

.lp-feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.58;
}

.lp-subject-showcase {
  margin-block-start: var(--space-8);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  text-align: center;
}

.lp-subject-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-block-start: 14px;
  list-style: none;
}

.lp-subject-pills li {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-primary);
}

/* 3-Step Funnel */
.lp-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 820px) {
  .lp-steps-grid {
    grid-template-columns: 1fr;
  }
}

.lp-step-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
}

.lp-step-num {
  inline-size: 36px;
  block-size: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  display: grid;
  place-items: center;
  margin-block-end: 14px;
}

/* Credibility Testimonials (<figure> + <blockquote> + <figcaption>) */
.lp-quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 920px) {
  .lp-quotes-grid {
    grid-template-columns: 1fr;
  }
}

.lp-quote-card {
  background: var(--surface-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
}

.lp-stars {
  display: inline-flex;
  gap: 3px;
  color: var(--grade-gold-fill);
}

.lp-quote-card blockquote p {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.62;
}

.lp-quote-author {
  border-block-start: 1px solid var(--border-subtle);
  padding-block-start: 12px;
  font-size: 0.84rem;
}

.lp-quote-author strong {
  display: block;
  color: var(--brand-navy);
}

.lp-quote-author span {
  color: var(--text-muted);
}

/* Pricing Cards (#pakej) */
.lp-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  align-items: stretch;
}

@media (max-width: 940px) {
  .lp-pricing-grid {
    grid-template-columns: 1fr;
    max-inline-size: 520px;
    margin-inline: auto;
  }
}

.lp-price-card {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-5);
  box-shadow: var(--shadow-xs);
  position: relative;
}

.lp-price-card.is-featured {
  border: 2.5px solid var(--brand-accent);
  box-shadow: 0 20px 42px -12px rgb(37 99 235 / 0.2);
}

.lp-popular-ribbon {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lp-price-amount {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.1;
  margin-block-top: 8px;
  margin-block-start: 8px;
}

.lp-price-strike {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-inline-end: 8px;
  font-weight: 500;
}

.lp-price-period {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-block-start: 4px;
}

.lp-price-perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-block-start: var(--space-4);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.lp-price-perks li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.lp-price-perks svg {
  color: var(--grade-emerald);
  flex-shrink: 0;
  margin-block-start: 2px;
}

/* Native Exclusive FAQ Accordion (<details name="etutor-faq">) */
.lp-faq-list {
  max-inline-size: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lp-faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lp-faq-item[open] {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-xs);
}

.lp-faq-summary {
  list-style: none;
  min-block-size: 54px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--brand-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lp-faq-summary::-webkit-details-marker {
  display: none;
}

.lp-faq-chevron {
  flex-shrink: 0;
  color: var(--brand-accent);
  transition: transform 0.25s ease;
}

.lp-faq-item[open] .lp-faq-chevron {
  transform: rotate(180deg);
}

.lp-faq-item::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}

.lp-faq-item[open]::details-content {
  block-size: auto;
}

.lp-faq-answer {
  padding: 0 20px 18px 20px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* Final CTA Banner & Footer */
.lp-final-cta {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-primary) 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: clamp(32px, 5vw, 52px);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.lp-final-cta h2 {
  color: #ffffff;
  font-size: clamp(1.45rem, 1.2rem + 1.2vw, 2.1rem);
  margin-block-end: 12px;
  text-wrap: balance;
}

.lp-final-cta p {
  color: #dbeafe;
  max-inline-size: 58ch;
  margin-inline: auto;
  margin-block-end: 24px;
}

.lp-footer {
  background: var(--brand-navy);
  color: #cbd5e1;
  padding-block: 44px 36px;
  border-block-start: 1px solid rgb(255 255 255 / 0.08);
}

.lp-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.lp-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
}

.lp-footer-links a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
}

.lp-footer-links a:hover {
  color: #93c5fd;
}

/* Admin Subject Multi-Select Fieldset & Accessible Custom Checkboxes (modern-web-guidance) */
.adm-subject-fieldset {
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 4px 0 0 0;
}

.adm-subject-legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary);
  padding-inline: 6px;
}

.adm-subject-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 10px;
}

.adm-subject-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
}

.adm-subject-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.adm-subject-pill:hover {
  border-color: var(--brand-accent);
}

.adm-subject-pill.is-checked,
.adm-subject-pill:has(.adm-subject-cb:checked) {
  border-color: var(--brand-accent);
  background: #eff6ff;
  color: var(--brand-primary);
}

.adm-subject-cb {
  --checkbox-size: 1.15em;
  --checkbox-icon-size: 0.72em;
  appearance: none;
  display: inline-grid;
  place-content: center;
  inline-size: var(--checkbox-size);
  aspect-ratio: 1;
  flex-shrink: 0;
  margin: 0;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  background: #ffffff;
  color: #ffffff;
  cursor: pointer;
}

.adm-subject-cb::before {
  content: "";
  inline-size: var(--checkbox-icon-size);
  aspect-ratio: 1;
  background-color: currentColor;
  -webkit-mask: var(--icon-check) no-repeat center / contain;
  mask: var(--icon-check) no-repeat center / contain;
  scale: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .adm-subject-cb::before {
    transition: scale 150ms ease;
  }
}

@media (forced-colors: active) {
  .adm-subject-cb::before {
    background-color: CanvasText;
  }
}

.adm-subject-cb:checked {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

.adm-subject-cb:checked::before {
  scale: 1;
}

.adm-subject-cb:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Mobile Sticky Bottom Bar (Safe-Area Compliant) */
.lp-mobile-cta-bar {
  display: none;
}

@media (max-width: 720px) {
  .lp-footer {
    padding-block-end: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .lp-mobile-cta-bar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 55;
    background: rgb(255 255 255 / 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-block-start: 1px solid var(--border-strong);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 -6px 20px rgb(15 23 42 / 0.08);
  }
}

/* Targeted Reduced-Motion Dampening (Case-by-case per component) */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .text-input,
  .quiz-card,
  .lp-feature-card,
  .lp-demo-tab,
  .lp-demo-opt,
  .lp-faq-chevron,
  progress.etutor-progress::-webkit-progress-value,
  progress.etutor-progress::-moz-progress-bar {
    transition-duration: 0s;
  }
  .lp-faq-item::details-content {
    transition: none !important;
  }
  .login-bg-orbs .orb {
    will-change: auto;
  }
}

/* PRINT RULE: Block printing everywhere EXCEPT when Official Result Slip Dialog is open */
@media print {
  body > *:not(#resultSlipDialog, .etutor-svg-sprite) {
    display: none !important;
  }
  body:not(.printing-official-slip) {
    display: none !important;
  }
  dialog#resultSlipDialog {
    position: static !important;
    display: block !important;
    inline-size: 100% !important;
    max-inline-size: 100% !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }
  .slip-actions {
    display: none !important;
  }
}
