@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CUSTOM VARIABLES --- */
:root {
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Colors */
  --bg-main: #f9fafb;
  --bg-gradient: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.07) 0%, rgba(249, 250, 251, 0) 65%), #f9fafb;
  --bg-card: #ffffff;
  --border-color: rgba(0, 0, 0, 0.06);
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.15);
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: rgba(16, 185, 129, 0.2);
  --success-glow: rgba(16, 185, 129, 0.15);
  
  --error: #ef4444;
  --error-bg: #fff1f2;
  --error-border: rgba(239, 68, 68, 0.2);
  --error-glow: rgba(239, 68, 68, 0.15);
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  /* Layout */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-width: 800px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* --- APP LAYOUT --- */
header.site-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 70px;
  display: flex;
  align-items: center;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.brand span.logo-mark {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  color: white;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-wordmark {
  height: 22px;
  width: auto;
  display: block;
}

/* --- AUTH (header sign-in) --- */
.auth-area {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-btn:hover {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.google-g {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.7rem;
  color: #4285F4;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 5px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.04);
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-link {
  background: none;
  border: none;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 999px;
  transition: var(--transition);
}

.auth-link:hover {
  color: var(--text-primary);
  background: rgba(17, 24, 39, 0.06);
}

/* Positioned out of the header's flex row so it can't disturb the layout —
   .site-header is sticky, which establishes the containing block. */
.auth-error {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px 24px 10px;
  font-size: 0.82rem;
  color: var(--error);
  text-align: center;
  background: var(--error-bg);
  border-bottom: 1px solid var(--error-border);
}

.request-access-btn {
  margin-left: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--error-border);
  background: #ffffff;
  color: var(--error);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.request-access-btn:hover:not(:disabled) {
  background: var(--error);
  color: #ffffff;
}

.request-access-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

@media (max-width: 560px) {
  .user-name { max-width: 90px; }
  .auth-btn { padding: 8px 12px; }
}

/* --- UTILITY CLASSES --- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
  transition: var(--transition);
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.02);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* --- VIEWS --- */
main.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 48px 0;
  position: relative;
}

.view {
  width: 100%;
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- HOME VIEW (Dashboard) --- */
.portal-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 55vh;
  width: 100%;
}

.portal-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 48px;
  width: 100%;
  max-width: 600px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  outline: none;
  text-decoration: none;
}

.portal-btn:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(0, 0, 0, 0.01);
}

.portal-btn-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(199, 70, 52, 0.08);
  color: #c74634;
  border: 1px solid rgba(199, 70, 52, 0.15);
}

.portal-btn-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.portal-btn-action {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  transition: var(--transition);
}

.portal-btn:hover .portal-btn-action {
  color: var(--primary-hover);
  transform: translateX(4px);
}

/* --- CERT HUB VIEW (Learn / Exam Prep) --- */
.hub-header {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
}

.hub-header h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.02em;
}

.hub-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 8px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

/* Certification-selection grid on the home screen: card count varies as
   certs are added, so center them via flex-wrap instead of a fixed grid
   that would leave empty, left-aligned column slots. */
#home-cert-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

#home-cert-grid .hub-card {
  flex: 0 1 300px;
}

/* Cert hub now has a variable card count (Learn / Exam Prep / History,
   which is hidden until sign-in / HCM Explorer) — center via flex-wrap
   instead of a fixed-column grid that would strand an odd card on its own
   left-aligned row. */
#view-cert-hub .hub-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 700px;
}

#view-cert-hub .hub-card {
  flex: 0 1 310px;
}

@media (max-width: 900px) {
  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* --- EXAM SIMULATION MODE --- */
.exam-timer {
  margin-left: auto;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: #111827;
  color: #ffffff;
  letter-spacing: 0.04em;
}

/* Under 10 minutes remaining. */
.exam-timer.warning { background: #B45309; }
/* Under 2 minutes remaining. */
.exam-timer.critical { background: var(--error); animation: timerPulse 1s infinite; }

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  padding: 14px;
  background: rgba(17, 24, 39, 0.03);
  border-radius: var(--radius-sm);
}

.qnav-btn {
  width: 34px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.qnav-btn:hover { border-color: var(--primary); color: var(--primary); }
/* Answered */
.qnav-btn.answered { background: var(--primary); border-color: var(--primary); color: #ffffff; }
/* Currently viewing */
.qnav-btn.current { outline: 2px solid var(--primary); outline-offset: 1px; }
/* Flagged for review — amber dot, works alongside answered state */
.qnav-btn.flagged::after {
  content: "";
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #D97706;
  border: 1px solid #ffffff;
}

.question-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.question-head h2 { flex: 1; }

.flag-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.flag-btn:hover { border-color: #D97706; color: #D97706; }
.flag-btn.flagged { background: #FEF3C7; border-color: #D97706; color: #B45309; }

.pass-verdict {
  display: inline-block;
  margin: 8px auto 0;
  padding: 10px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pass-verdict.passed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.pass-verdict.failed {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

@media (max-width: 560px) {
  .qnav-btn { width: 30px; height: 27px; font-size: 0.7rem; }
  .exam-timer { font-size: 0.85rem; padding: 5px 10px; }
}

/* --- DIFFICULTY TOGGLE (segmented control) --- */
.difficulty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 28px;
}

.diff-eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.difficulty-toggle {
  display: flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px;
  gap: 4px;
  background: rgba(17, 24, 39, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

.diff-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.diff-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.diff-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.10);
}

/* Content tier labels — ORGANISATIONAL ONLY, not access control.
   Every question ships in questions.js regardless of tier. */
.tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
}

.tier-free {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.tier-premium {
  background: rgba(217, 119, 6, 0.14);
  color: #B45309;
}

.quiz-tier-badge {
  margin-left: 8px;
  vertical-align: middle;
}

@media (max-width: 480px) {
  .tier-pill { display: none; }
}

.diff-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  transition: var(--transition);
}

.diff-btn.active .diff-count {
  background: var(--primary);
  color: #ffffff;
}

.diff-caption {
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 14px auto 0;
  max-width: 560px;
}

@media (max-width: 480px) {
  .diff-btn {
    padding: 9px 14px;
    font-size: 0.82rem;
    gap: 7px;
  }
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
}

.hub-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(0, 0, 0, 0.01);
}

.hub-card-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.hub-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hub-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.hub-card-cta {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}

/* --- TOPICS LIST VIEW (Learn) --- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

@media (max-width: 620px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--topic-color, var(--primary));
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.topic-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.topic-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.topic-card-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-card-meta .q-count {
  color: var(--topic-color, var(--primary));
}

/* --- TOPIC BREAKDOWN (Results) --- */
.topic-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-breakdown-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.topic-breakdown-row .tb-name {
  flex: 0 0 200px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topic-breakdown-row .tb-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.topic-breakdown-row .tb-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--success);
}

.topic-breakdown-row.weak .tb-fill {
  background: var(--error);
}

.topic-breakdown-row .tb-pct {
  flex: 0 0 48px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .topic-breakdown-row .tb-name {
    flex: 0 0 110px;
    font-size: 0.78rem;
  }
}

/* --- QUIZ VIEW (Simulator) --- */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.quit-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.quit-link:hover {
  color: var(--text-primary);
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: right;
}

.question-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 28px;
  color: var(--text-primary);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.option-btn {
  background: rgba(0, 0, 0, 0.005);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  outline: none;
}

.option-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%; /* circular = single-select (radio-style) */
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: var(--transition);
}

.option-btn.multi .option-key {
  border-radius: 6px; /* square = multi-select (checkbox-style) */
}

.multi-hint {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 3px 10px;
  border-radius: 20px;
  vertical-align: middle;
}

.option-btn:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateX(4px);
}

.option-btn:hover .option-key {
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
}

/* Selected state (before verification) */
.option-btn.selected {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.08);
}

.option-btn.selected .option-key {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Correct state */
.option-btn.correct {
  background: var(--success-bg);
  border-color: var(--success);
}

.option-btn.correct .option-key {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

/* Incorrect state */
.option-btn.incorrect {
  background: var(--error-bg);
  border-color: var(--error);
}

.option-btn.incorrect .option-key {
  background: var(--error);
  border-color: var(--error);
  color: #ffffff;
}

/* Disabled state once answered */
.option-btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.option-btn.correct.disabled, 
.option-btn.incorrect.disabled {
  opacity: 1;
}

/* Explanation card */
.explanation-card {
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.01);
  border-radius: var(--radius-sm);
  padding: 20px;
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.explanation-card.correct-exp {
  border-left-color: var(--success);
  background: rgba(16, 185, 129, 0.02);
}

.explanation-card.incorrect-exp {
  border-left-color: var(--error);
  background: rgba(239, 68, 68, 0.02);
}

.explanation-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- DEEP DIVE (related topic concepts) --- */
.deepdive-card {
  margin-top: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.01) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.deepdive-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  text-align: left;
}

.deepdive-header:hover {
  background: rgba(99, 102, 241, 0.04);
}

.deepdive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--primary);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  transition: var(--transition);
}

.deepdive-body {
  padding: 6px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deepdive-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.25s ease;
}

.deepdive-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.dd-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.dd-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(1.08);
}

.dd-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.dd-counter {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}

.deepdive-item .dd-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.deepdive-q {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.deepdive-a {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 36px;
}

.deepdive-a strong {
  color: var(--text-primary);
  font-weight: 700;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* --- RESULTS VIEW --- */
.results-card {
  text-align: center;
}

.results-card h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.score-visualization {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 32px auto;
}

.score-circle {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.04);
  stroke-width: 8px;
}

.circle-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8px;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-percentage {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.score-fraction {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.metrics-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.metric-box {
  background: rgba(0, 0, 0, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 4px;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* Milestone Sharing Bar */
.share-score-box {
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.share-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.share-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.share-linkedin {
  background: #0a66c2;
  color: #ffffff;
}

.share-linkedin:hover {
  background: #084e96;
}

.share-whatsapp {
  background: #25d366;
  color: #ffffff;
}

.share-whatsapp:hover {
  background: #1eb857;
}

.share-copy {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.share-copy:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.share-toast {
  font-size: 0.78rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: 999px;
  animation: fadeIn 0.2s ease;
}

/* Detailed review list */
.review-header {
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.review-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.review-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.review-q-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.review-status-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
}

.status-correct {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-incorrect {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

.status-skipped {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.review-q-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.review-answers-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.review-ans-row {
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.01);
  border: 1px solid var(--border-color);
}

.review-ans-row.your-correct {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}

.review-ans-row.your-incorrect {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.review-ans-row.actual-correct {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}

.review-explanation {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--text-muted);
  padding-left: 12px;
  margin-top: 12px;
}

/* --- FOOTER --- */
footer.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Trademark / non-affiliation notice. Deliberately smaller and dimmer than the
   copyright line — it needs to be present and legible, not prominent. */
.footer-disclaimer {
  max-width: 720px;
  margin: 10px auto 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Support contact. Sits between the copyright and the disclaimer: more
   prominent than the trademark notice, because a paying customer who can't
   reach us is a refund request waiting to happen. */
.footer-contact {
  margin: 12px auto 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-contact a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.footer-contact .footer-sla {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Reassurance inside the payment modal, shown before the customer pays so the
   2–4 hour window is never a surprise discovered after handing over money. */
.upgrade-support-note {
  margin: 10px auto 0;
  max-width: 420px;
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
}

.upgrade-support-note a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Study-guide entry point on the home view. Real markup, not JS-rendered, so
   the home page has indexable text and a crawl path to /guides/. */
.home-guides {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.home-guides h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.home-guides-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.home-guides-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  max-width: 720px;
}

.home-guides-list a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.home-guides-list a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.home-guides-all {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--primary);
  text-decoration: none;
}

.home-guides-all:hover { text-decoration: underline; }

.footer-guides {
  display: block;
  margin-top: 4px;
}

.footer-guides a {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.78rem;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 600px) {
  .hero-section h1 {
    font-size: 2.1rem;
  }
  
  .glass-card {
    padding: 24px 16px;
  }
  
  .metrics-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .btn {
    width: 100%;
  }
  
  .results-actions {
    flex-direction: column;
    gap: 12px;
  }
}

/* --- REVIEW LIST: attempted-only default --- */
.review-note {
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.18);
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.review-note strong { color: var(--text-primary); }

.review-toggle {
  padding: 8px 16px;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ==========================================================================
   MONETIZATION, VIDEO AD CHECKPOINTS & UPGRADE MODALS
   ========================================================================== */

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ad-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ad-modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  margin: auto;
  animation: adModalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adModalPop {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ad-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ad-sponsor-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  flex-wrap: wrap;
}

.ad-sponsor-icon {
  font-size: 1.1rem;
}

.ad-seq-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #6366f1;
  border: 1px solid #e0e7ff;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.ad-timer-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #1e293b;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.ad-timer-pill strong {
  color: #4f46e5;
  font-size: 0.88rem;
}

.ad-video-screen {
  background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%);
  color: #ffffff;
  padding: 36px 24px;
  text-align: center;
  position: relative;
}

.ad-video-graphic {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.ad-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--sponsor-accent, #6366f1);
  opacity: 0.6;
  animation: adRingPulse 2s infinite ease-out;
}

@keyframes adRingPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.ad-graphic-icon {
  font-size: 1.8rem;
}

.ad-video-title {
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.ad-video-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto 20px;
}

.ad-unlock-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(165, 180, 252, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.ad-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.ad-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.3s ease;
}

.ad-modal-footer {
  padding: 20px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.ad-action-btn {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  transition: all 0.2s ease;
}

.ad-action-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.ad-action-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.ad-upsell-strip {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ad-upsell-link {
  background: none;
  border: none;
  padding: 0;
  color: #4f46e5;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8rem;
}

.ad-upsell-link:hover {
  color: #3730a3;
}

/* --- UPGRADE MODAL STYLES --- */
.upgrade-card {
  max-width: 540px;
  background: #ffffff;
}

.upgrade-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.upgrade-content {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.upgrade-title {
  font-family: var(--font-display, inherit);
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.upgrade-sub {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.45;
}

/* --- URGENCY 5-DAY LAUNCH STRIP --- */
.urgency-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.urgency-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  animation: flamePulse 1.5s infinite alternate;
}

@keyframes flamePulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

.urgency-text {
  font-size: 0.78rem;
  color: #991b1b;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.urgency-text strong {
  color: #7f1d1d;
  font-weight: 800;
}

.launch-countdown-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #ea580c;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(234, 88, 12, 0.3);
  margin-top: 2px;
  width: fit-content;
}

.plan-original-cost {
  font-size: 0.85rem;
  font-weight: normal;
  color: #94a3b8;
  margin-right: 4px;
  text-decoration: line-through;
}

/* --- PLAN SELECTOR CARDS --- */
.plan-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  position: relative;
  display: block;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 12px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.plan-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.plan-card.active {
  border-color: #6366f1;
  background: #f5f3ff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
}

.plan-duration {
  font-size: 0.72rem;
  color: #64748b;
}

.plan-cost {
  font-size: 1.3rem;
  font-weight: 900;
  color: #4f46e5;
  margin-top: 6px;
  letter-spacing: -0.02em;
}

.upgrade-perks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.perk-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.perk-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.perk-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perk-text strong {
  font-size: 0.88rem;
  color: #1e293b;
  font-weight: 700;
}

.perk-text span {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.upgrade-cta-box {
  background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  color: #ffffff;
}

.pricing-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.price-val {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.price-period {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
}

.upgrade-primary-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
}

.upgrade-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.upgrade-guarantee {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

/* --- LOCKED STATES ON QUIZ NAV & CARDS --- */
.qnav-btn.locked {
  opacity: 0.75;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
  position: relative;
}

.qnav-btn.locked:hover {
  border-color: #6366f1;
  color: #4f46e5;
  background: #eef2ff;
}

.hub-card.locked-card {
  position: relative;
}

.hub-card.locked-card .tier-pill {
  margin-left: 6px;
  vertical-align: middle;
}

/* --- UPI SCAN & PAY MODAL STYLES --- */
.upi-modal-card {
  max-width: 480px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
}

.upi-modal-content {
  padding: 24px;
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.upi-order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.upi-plan-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
}

.upi-plan-amount {
  font-weight: 900;
  font-size: 1.15rem;
  color: #4f46e5;
}

.upi-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.upi-qr-frame {
  background: #ffffff;
  padding: 14px;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upi-qr-frame img {
  display: block;
  border-radius: 8px;
}

.upi-merchant-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.upi-scan-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  font-weight: 600;
}

.upi-intent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.upi-intent-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.upi-activation-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  text-align: left;
}

.upi-utr-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.upi-utr-row {
  display: flex;
  gap: 8px;
}

.upi-utr-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: monospace;
  letter-spacing: 0.05em;
  background: #ffffff;
  color: #0f172a;
}

.upi-utr-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.upi-verify-btn {
  padding: 10px 18px;
  background: #4f46e5;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.upi-verify-btn:hover {
  background: #4338ca;
}

.upi-guarantee-note {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 10px 0 0;
  text-align: center;
}

/* --- MOBILE RESPONSIVE MODAL ADAPTATIONS --- */
@media (max-width: 600px) {
  .modal-overlay {
    padding: 8px;
    align-items: center;
  }

  .ad-modal-card {
    max-height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 16px;
    margin: auto;
    width: 100%;
  }

  .upgrade-modal-header {
    padding: 12px 16px;
  }

  .upgrade-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  .upgrade-content {
    padding: 16px 14px;
  }

  .upgrade-title {
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .upgrade-sub {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .urgency-strip {
    padding: 8px 10px;
    margin-bottom: 12px;
    gap: 8px;
  }

  .urgency-icon {
    font-size: 1.1rem;
  }

  .urgency-text {
    font-size: 0.74rem;
  }

  .plan-selector-grid {
    gap: 8px;
    margin-bottom: 12px;
  }

  .plan-card {
    padding: 10px 8px;
    border-radius: 10px;
  }

  .plan-name {
    font-size: 0.82rem;
  }

  .plan-duration {
    font-size: 0.68rem;
  }

  .plan-cost {
    font-size: 1.1rem;
    margin-top: 4px;
  }

  .upgrade-perks {
    gap: 8px;
    margin-bottom: 14px;
  }

  .perk-item {
    padding: 8px 10px;
    gap: 8px;
    border-radius: 10px;
  }

  .perk-icon {
    font-size: 1.05rem;
  }

  .perk-text strong {
    font-size: 0.8rem;
  }

  .perk-text span {
    font-size: 0.72rem;
  }

  .upgrade-cta-box {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .upgrade-primary-btn {
    padding: 12px 14px;
    font-size: 0.92rem;
    border-radius: 10px;
  }

  .upgrade-guarantee {
    font-size: 0.7rem;
    margin-top: 6px;
  }

  .upi-modal-content {
    padding: 16px 14px;
  }

  .ad-video-screen {
    padding: 24px 16px;
  }

  .ad-modal-footer {
    padding: 14px 16px;
    gap: 10px;
  }
}

/* Study Pass indicator in the header. Deliberately understated — it is
   reassurance that the pass is live, not an advert. */
.pass-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(168,85,247,.10));
  border: 1px solid rgba(79,70,229,.25);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .pass-badge { font-size: 0.66rem; padding: 4px 9px; margin-right: 6px; }
}
