/* ── GOOGLE FONTS ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── DESIGN TOKENS ────────────────────────────────────────────────────────── */
:root {
  --bg:          oklch(0.95 0.003 250);
  --surface:     oklch(0.90 0.004 250);
  --elevated:    oklch(0.98 0.002 250);
  --fg:          oklch(0.18 0.03  250);
  --card:        oklch(0.98 0.002 250);
  --primary:     oklch(0.20 0.04  255);
  --primary-fg:  oklch(0.96 0.003 250);
  --primary-soft:oklch(0.82 0.02  250);
  --sec:         oklch(0.32 0.06  255);
  --sec-fg:      oklch(0.96 0.003 250);
  --sec-soft:    oklch(0.85 0.025 250);
  --accent:      oklch(0.72 0.13   75);
  --accent-fg:   oklch(0.18 0.03  250);
  --accent-soft: oklch(0.92 0.05   80);
  --muted:       oklch(0.90 0.004 250);
  --muted-fg:    oklch(0.42 0.02  250);
  --border:      oklch(0.86 0.004 250);
  --success:     oklch(0.62 0.15  155);
  --destruct:    oklch(0.58 0.21   27);
  --shad-soft:   0 4px  24px  -8px oklch(0.20 0.04 255 / 0.20);
  --shad-pop:    0 12px 32px -12px oklch(0.20 0.04 255 / 0.40);
}
.dark {
  --bg:          oklch(0.16 0.025 250);
  --surface:     oklch(0.22 0.04  250);
  --elevated:    oklch(0.28 0.05  250);
  --fg:          oklch(0.93 0.005 250);
  --card:        oklch(0.22 0.04  250);
  --primary:     oklch(0.66 0.13   75);
  --primary-fg:  oklch(0.14 0.02  250);
  --primary-soft:oklch(0.42 0.09   75);
  --sec:         oklch(0.569 0.116 249);
  --sec-fg:      oklch(0.93 0.005 250);
  --sec-soft:    oklch(0.26 0.05  250);
  --accent:      oklch(0.82 0      0);
  --accent-fg:   oklch(0.16 0.025 250);
  --accent-soft: oklch(0.38 0.02  250);
  --muted:       oklch(0.28 0.04  250);
  --muted-fg:    oklch(0.72 0.01  250);
  --border:      oklch(1    0      0 / 0.12);
  --success:     oklch(0.68 0.15  155);
  --destruct:    oklch(0.58 0.21   27);
  --shad-soft:   0 4px  24px  -8px oklch(0.08 0.02 250 / 0.60);
  --shad-pop:    0 12px 32px -12px oklch(0.66 0.13  75 / 0.45);
}

/* ── BASE ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
}
::-webkit-scrollbar { width: 0; height: 0; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, .font-display { font-family: 'Fraunces', Georgia, serif; letter-spacing: -0.02em; }

/* ── UTILITIES ────────────────────────────────────────────────────────────── */
.grain {
  background-image: radial-gradient(oklch(0.36 0.07 45 / 0.04) 1px, transparent 1px);
  background-size: 4px 4px;
}
.shadow-soft { box-shadow: var(--shad-soft); }
.shadow-pop  { box-shadow: var(--shad-pop); }
.gradient-warm { background: linear-gradient(135deg, var(--primary), var(--sec)); }
.gradient-cool { background: linear-gradient(135deg, var(--sec), var(--accent)); }

/* ── BACKGROUND COLORS ────────────────────────────────────────────────────── */
.c-bg-card        { background-color: var(--card); }
.c-bg-surface     { background-color: var(--surface); }
.c-bg-muted       { background-color: var(--muted); }
.c-bg-primary     { background-color: var(--primary); }
.c-bg-sec         { background-color: var(--sec); }
.c-bg-accent      { background-color: var(--accent); }
.c-bg-accent-soft { background-color: var(--accent-soft); }
.c-bg-sec-soft    { background-color: var(--sec-soft); }
.c-bg-prim-soft   { background-color: var(--primary-soft); }
.c-bg-success-10  { background-color: oklch(0.62 0.15 155 / 0.10); }
.c-bg-success-20  { background-color: oklch(0.62 0.15 155 / 0.20); }
.c-bg-destruct-10 { background-color: oklch(0.58 0.21  27 / 0.12); }
.dark .c-bg-destruct-10 { background-color: oklch(0.58 0.21 27 / 0.18); }
.c-bg-prim-30     { background-color: var(--primary); opacity: 0.30; }
.c-bg-prim-65     { background-color: var(--primary); opacity: 0.65; }
.c-bg-card-95     { background-color: var(--card); }
.c-bg-elevated    { background-color: var(--elevated); }

/* ── TEXT COLORS ──────────────────────────────────────────────────────────── */
.c-text-primary   { color: var(--primary); }
.c-text-sec       { color: var(--sec); }
.c-text-accent    { color: var(--accent); }
.c-text-accent-fg { color: var(--accent-fg); }
.c-text-prim-fg   { color: var(--primary-fg); }
.c-text-sec-fg    { color: var(--sec-fg); }
.c-text-muted-fg  { color: var(--muted-fg); }
.c-text-success   { color: var(--success); }
.c-text-destruct  { color: var(--destruct); }

/* ── BORDER COLORS ────────────────────────────────────────────────────────── */
/* c-border-60 follows the dark-mode-aware --border token so cards read
   correctly in both palettes. Original html-template's hardcoded 0.86 oklch
   was light-mode only. */
.c-border-60         { border-color: var(--border); }
.c-border-sec        { border-color: var(--sec); }
.c-border-success-30 { border-color: oklch(0.62 0.15 155 / 0.30); }
.c-border-accent-30  { border-color: oklch(0.72 0.13  75 / 0.30); }
.dark .c-border-success-30 { border-color: oklch(0.68 0.15 155 / 0.40); }
.dark .c-border-accent-30  { border-color: oklch(0.82 0    0    / 0.30); }

/* ── DASHBOARD: CONTINUE LEARNING CARD ────────────────────────────────────── */
/*
 * Self-contained card styling. All rules use !important to defeat any stale
 * cached CSS during development.
 */
.luux-continue-card {
	display: flex !important;
	align-items: stretch !important;
	overflow: hidden !important;
	border-radius: 1.5rem !important;
	text-decoration: none !important;
	color: inherit !important;
	max-width: 560px !important;
	width: 100% !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
.luux-continue-card:hover {
	transform: translateY(-1px) !important;
}

/* Image column — fixed square that drives the card height. */
.luux-continue-image {
	position: relative !important;
	flex-shrink: 0 !important;
	width: 112px !important;
	height: 112px !important;
	overflow: hidden !important;
}
.luux-continue-image img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}
.luux-continue-play {
	position: absolute !important;
	inset: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}
.luux-continue-play-dot {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 9999px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Content column — grows, vertically centered, has a chevron on the right. */
.luux-continue-content {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex !important;
	align-items: center !important;
	gap: 0.75rem !important;
	padding: 0.875rem 1rem !important;
}
.luux-continue-body {
	flex: 1 1 auto !important;
	min-width: 0 !important;
}
.luux-continue-title {
	font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sec);
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.luux-continue-progress-wrap {
	margin-top: 0.625rem;
}
.luux-continue-meta {
	font-size: 10px;
	color: var(--muted-fg);
	margin: 0.375rem 0 0 0;
}
.luux-continue-chevron {
	flex-shrink: 0 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.85;
}

/* ─ Desktop: bigger image, larger title, more generous padding, tighter cap ─ */
@media (min-width: 768px) {
	.luux-continue-card    { max-width: 640px !important; }
	.luux-continue-image   { width: 160px !important; height: 160px !important; }
	.luux-continue-content { padding: 1.25rem 1.5rem !important; gap: 1rem !important; }
	.luux-continue-title   {
		font-size: 15px;
		text-transform: none;
		letter-spacing: -0.01em;
		color: var(--fg);
		font-family: 'Fraunces', Georgia, serif;
		font-weight: 700;
	}
	.luux-continue-meta        { font-size: 12px; margin-top: 0.5rem; }
	.luux-continue-progress-wrap { margin-top: 0.875rem; }
}
@media (min-width: 1024px) {
	.luux-continue-card  { max-width: 680px !important; }
	.luux-continue-image { width: 180px !important; height: 180px !important; }
	.luux-continue-title { font-size: 17px; }
}

/* ── HEADER ───────────────────────────────────────────────────────────────── */
.header-glass {
  background-color: oklch(0.95 0.003 250 / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dark .header-glass { background-color: oklch(0.16 0.025 250 / 0.85); }
/* Administrators keep the WordPress toolbar. Hold the sticky header below it. */
body.admin-bar .header-glass { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .header-glass { top: 46px; }
}

/* ── TAB NAV ──────────────────────────────────────────────────────────────── */
/* REVERTED (August 2026): a previous pass added `mask-image` +
   `isolation: isolate` + `transform: translateZ(0)` here to work around a
   Safari-specific backdrop-filter/border-radius clipping bug. That caused
   a regression — nav text became invisible, almost certainly because the
   *unprefixed* `mask-image` property (which Chrome/Edge support natively,
   unlike the Safari-only bug it was meant to fix) rendered the
   radial-gradient mask differently than intended, masking out content
   instead of leaving it fully visible. Reverted to the plain
   background/box-shadow/backdrop-filter below — the original "orange
   sliver" bug this was chasing is still unconfirmed (never reproduced via
   live browser inspection), so a Safari-only fix (behind an `@supports`
   query, or scoped to `-webkit-mask-image` alone with no unprefixed
   `mask-image`) should be tried again ONLY after confirming the user is
   actually on Safari/iOS — see system_architecture.md. */
.tab-glass {
  background: linear-gradient(135deg, oklch(0.18 0.03 250 / 0.82), oklch(0.18 0.03 250 / 0.65));
  box-shadow: 0 16px 48px -12px oklch(0.18 0.03 250 / 0.60),
              inset 0 1px 0 0 oklch(1 0 0 / 0.35),
              inset 0 -1px 0 0 oklch(0 0 0 / 0.25);
  backdrop-filter: blur(24px) saturate(2);
  -webkit-backdrop-filter: blur(24px) saturate(2);
}
.tab-btn {
  display: flex; flex: 1; flex-direction: column;
  align-items: center; gap: 2px; padding: 8px 4px;
  border-radius: 1rem; font-size: 12px; font-weight: 600;
  /* Fixed near-white, NOT var(--primary-fg) — .tab-glass's background above
     is a hardcoded dark navy gradient that never changes between light and
     dark theme (it's designed as an always-dark floating dock), but
     --primary-fg DOES flip: it's near-white in light mode (fine, by
     coincidence) and near-black in dark mode (meant for text on top of
     dark mode's amber --primary, not for this dark bar) — that flip made
     all the inactive tab labels essentially invisible in dark mode
     (near-black text on a dark-navy bar). Hardcoding this to always match
     the bar's own fixed-dark background fixes it in both modes. */
  color: oklch(0.96 0.003 250); opacity: 0.70;
  transition: opacity 0.2s; position: relative; z-index: 10;
}
.tab-btn:hover { opacity: 0.90; }
.tab-btn.active {
  opacity: 1;
  background: linear-gradient(135deg, oklch(1 0 0 / 0.30), oklch(1 0 0 / 0.12));
  box-shadow: inset 0 1px 0 0 oklch(1 0 0 / 0.45),
              inset 0 -1px 0 0 oklch(0 0 0 / 0.20),
              0 6px 16px -8px oklch(0 0 0 / 0.40);
}
.tab-btn.active svg { color: var(--accent); }

/* Quiz pages are a full-bleed exam. The navy bars live in learndash-overrides.css. */
body.luux-quiz-focus .app-sidebar,
body.luux-quiz-focus #app-nav { display: none !important; }
body.luux-quiz-focus .app-main {
  max-width: none;
  padding-top: 0.75rem;
  padding-bottom: 4.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
@media (min-width: 1024px) {
  body.luux-quiz-focus .app-main {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* ── PROGRESS BAR ─────────────────────────────────────────────────────────── */
.pb-track { height: 8px; width: 100%; border-radius: 9999px; overflow: hidden; }
.pb-fill  { height: 100%; border-radius: 9999px; transition: width 0.4s ease; }
.pb-track.tone-primary   { background-color: var(--muted); }
.pb-track.tone-secondary { background-color: var(--sec-soft); }
.pb-track.tone-light     { background-color: oklch(1 0 0 / 0.20); }
.pb-fill.tone-primary    { background-color: var(--primary); }
.pb-fill.tone-secondary  { background-color: var(--sec); }
.pb-fill.tone-light      { background-color: var(--accent); }

/* ── INPUT ────────────────────────────────────────────────────────────────── */
.c-input {
  display: block; width: 100%;
  padding: 0.875rem 1rem; border-radius: 1rem;
  background-color: var(--card); border: 1px solid var(--border);
  font-size: 0.875rem; color: var(--fg); outline: none;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.c-input:focus { border-color: var(--sec); box-shadow: 0 0 0 4px oklch(0.32 0.06 255 / 0.15); }
.c-input::placeholder { color: var(--muted-fg); }

/* ── MODULE CARD ──────────────────────────────────────────────────────────── */
.module-card { display: flex; flex-direction: column; cursor: pointer; transition: transform 0.15s; }
.module-card:hover { transform: translateY(-2px); }
.module-card .card-img { aspect-ratio: 4/3; overflow: hidden; position: relative; }
.module-card .card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── LESSON ITEM ──────────────────────────────────────────────────────────── */
.lesson-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 1rem; border: 1px solid; transition: border-color 0.15s; }
.lesson-item.done     { background-color: oklch(0.62 0.15 155 / 0.12); border-color: oklch(0.62 0.15 155 / 0.30); }
.lesson-item.open     { background-color: var(--card); border-color: var(--border); }
.lesson-item.open:hover { border-color: var(--sec); }
.lesson-item.locked   { background-color: var(--muted); border-color: var(--border); opacity: 0.60; }
.dark .lesson-item.done { background-color: oklch(0.68 0.15 155 / 0.15); border-color: oklch(0.68 0.15 155 / 0.35); }
.lesson-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lesson-icon.done   { background-color: var(--success); color: white; }
.lesson-icon.open   { background-color: var(--sec); color: var(--sec-fg); }
.lesson-icon.locked { background-color: var(--muted); color: var(--muted-fg); }

/* ── QUIZ ANSWER BUTTON ───────────────────────────────────────────────────── */
.answer-btn {
  width: 100%; text-align: left; padding: 1rem;
  border-radius: 1rem; border: 2px solid var(--border);
  background-color: var(--card); color: var(--fg); cursor: pointer; display: flex;
  align-items: center; gap: 12px; transition: border-color 0.15s, background-color 0.15s;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 0.875rem;
}
.answer-btn:hover:not(:disabled) { border-color: var(--sec); }
.answer-btn.selected  { background-color: var(--sec-soft); border-color: var(--sec); }
.answer-btn.correct   { background-color: oklch(0.62 0.15 155 / 0.12); border-color: oklch(0.62 0.15 155 / 0.60); }
.answer-btn.wrong     { background-color: oklch(0.58 0.21 27 / 0.12); border-color: oklch(0.58 0.21 27 / 0.40); }
.answer-btn:disabled  { opacity: 0.70; cursor: default; }
.answer-letter {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; color: var(--muted-fg);
}
.answer-btn.selected .answer-letter { background-color: var(--sec); color: var(--sec-fg); border-color: transparent; }

/* ── BADGE ────────────────────────────────────────────────────────────────── */
.badge-gold   { background-color: #fef9c3; color: #854d0e; }
.badge-silver { background-color: #f1f5f9; color: #475569; }
.badge-bronze { background-color: #ffedd5; color: #9a3412; }
.dark .badge-gold   { background-color: rgba(254, 243, 148, 0.20); color: #fde68a; }
.dark .badge-silver { background-color: rgba(226, 232, 240, 0.14); color: #e2e8f0; }
.dark .badge-bronze { background-color: rgba(254, 215, 170, 0.18); color: #fed7aa; }

/* ── DARK MODE TOGGLE ─────────────────────────────────────────────────────── */
#dm-icon-moon { display: block; }
#dm-icon-sun  { display: none; }
.dark #dm-icon-moon { display: none; }
.dark #dm-icon-sun  { display: block; }

/* ── RESPONSIVE LAYOUT ────────────────────────────────────────────────────── */
.app-wrap    { display: flex; min-height: 100vh; }
.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Header inner — responsive max-width. Uses min-height so a taller logo can
   push the header down instead of overflowing. */
.app-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; min-height: 3.5rem;
  max-width: 480px; margin: 0 auto; width: 100%;
}

/* Main — responsive max-width + bottom clearance for tab nav */
.app-main {
  max-width: 480px; margin: 0 auto; width: 100%;
  padding-bottom: 6rem;
}

/* Tablet ≥ 768px */
@media (min-width: 768px) {
  .app-header-inner { max-width: 720px; }
  .app-main         { max-width: 720px; }
  .modules-grid     { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  .stats-grid       { display: grid !important; grid-template-columns: repeat(4, minmax(0,1fr)) !important; }
  /* Dashboard's stats row (Reeks/Punten/Examens) is 3 equal cards, not 4
     like page-progress.php's grid, which is what the .stats-grid rule
     above was written for — an earlier version of this section shared
     that class and inherited its forced 4-column count, which didn't
     match this row's actual item count at any point (2 cards, 3 cards,
     or 2 + a full-width one were all tried) and kept causing width
     mismatches. dashboard-stats-grid keeps this row at exactly 3 columns
     at every width instead, independent of that shared rule. */
  .dashboard-stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
}

/* Desktop ≥ 1024px */
@media (min-width: 1024px) {
  .app-header-inner { max-width: 100%; padding: 0 2rem; }
  .app-main         { max-width: 940px; padding-bottom: 2.5rem; }
  .modules-grid     { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  .stats-grid       { display: grid !important; grid-template-columns: repeat(4, minmax(0,1fr)) !important; }
  .dashboard-stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  #app-nav          { display: none !important; }
}

/* ── SIDEBAR ──────────────────────────────────────────────────────────────── */
.app-sidebar {
  display: none;
  width: 260px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  flex-direction: column;
  padding: 1.5rem 0.75rem;
  background: linear-gradient(180deg, oklch(0.16 0.025 250 / 0.98), oklch(0.18 0.03 250 / 0.95));
  border-right: 1px solid oklch(1 0 0 / 0.09);
  box-shadow: 4px 0 32px -8px oklch(0.08 0.02 250 / 0.50);
  gap: 0.25rem;
}
@media (min-width: 1024px) { .app-sidebar { display: flex; } }

.sidebar-logo {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 0.75rem; margin-bottom: 1.75rem;
}
.sidebar-logo-icon {
  height: 2rem; width: 2rem; border-radius: 0.625rem; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--sec));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shad-pop);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }

.sidebar-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.875rem; border-radius: 0.875rem;
  font-size: 0.875rem; font-weight: 600;
  color: oklch(0.93 0.005 250); opacity: 0.62;
  transition: opacity 0.15s, background-color 0.15s;
  text-decoration: none; cursor: pointer;
  border: none; background: none;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  width: 100%; text-align: left;
}
.sidebar-item:hover { opacity: 0.88; background-color: oklch(1 0 0 / 0.06); }
.sidebar-item.active {
  opacity: 1;
  background: linear-gradient(135deg, oklch(1 0 0 / 0.18), oklch(1 0 0 / 0.07));
  box-shadow: inset 0 1px 0 0 oklch(1 0 0 / 0.22), inset 0 -1px 0 0 oklch(0 0 0 / 0.18);
}
.sidebar-item.active svg { color: var(--accent); }
.sidebar-item svg { flex-shrink: 0; }

.sidebar-divider { height: 1px; background: oklch(1 0 0 / 0.08); margin: 0.625rem 0.5rem; }

.sidebar-pro {
  display: block; margin: 0 0.25rem 0.375rem;
  padding: 0.875rem; border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--sec));
  color: var(--primary-fg); text-decoration: none; cursor: pointer;
  transition: opacity 0.15s;
}
.sidebar-pro:hover { opacity: 0.90; }
.sidebar-pro.is-member { cursor: default; }
.sidebar-pro.is-member:hover { opacity: 1; }

.sidebar-user {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.75rem 0.875rem; border-radius: 0.875rem;
  text-decoration: none; color: oklch(0.93 0.005 250); cursor: pointer;
  transition: background-color 0.15s;
}
.sidebar-user:hover { background-color: oklch(1 0 0 / 0.06); }

.sidebar-avatar {
  width: 2rem; height: 2rem; border-radius: 50%; flex-shrink: 0;
  background-color: var(--sec); color: var(--sec-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 700;
}

/* ── PAYWALL responsive pricing grid ─────────────────────────────────────── */
/* Cards stretch to one row. The spacer grows so every plan button sits on
   the bottom edge, including plans that have no feature list. */
#pricing-grid > div {
  display: flex !important;
  flex-direction: column !important;
}
#pricing-grid .pricing-card-spacer {
  flex: 1 1 auto;
  min-height: 1.25rem;
}
/* Recommended plan leads the stack. Desktop keeps source order (middle column). */
@media (max-width: 767px) {
  #pricing-grid > .pricing-card-featured { order: -1; }
}
@media (min-width: 768px) {
  #pricing-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 1rem !important;
    align-items: stretch;
  }
  #pricing-grid > div {
    margin: 0 !important;
    height: 100%;
  }
}

/* ── LESSON / MODULE: constrain video + hero on desktop ──────────────────── */
@media (min-width: 768px) {
  .app-main > .aspect-video,
  .app-main > div[style*="aspect-ratio:16/9"],
  .app-main > div[style*="aspect-ratio:16/11"] {
    border-radius: 1.25rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
  }
}

/* ── PROFILE: widen card on desktop ──────────────────────────────────────── */
@media (min-width: 768px) {
  .auth-form-side .max-w-sm { max-width: 28rem; }
}

/* ── LEARNDASH: theme-aware overrides for plugin-injected content ────────── */
/*
 * LearnDash injects a lot of HTML into the topic/lesson/course content flow —
 * mark-complete buttons, "in this course" widget, progress bar, focus-mode
 * chrome. Its default stylesheet uses hard-coded light-mode colours (white
 * backgrounds, dark text, light borders). Force those to inherit our theme
 * tokens so dark mode reads correctly.
 */
.learndash-wrapper,
.learndash-wrapper .ld-focus-content,
.learndash-wrapper .ld-focus-header,
.learndash-wrapper .ld-focus-sidebar,
.learndash-wrapper .ld-course-navigation,
.learndash-wrapper .ld-course-status,
.learndash-wrapper .ld-course-status-content,
.learndash-wrapper .ld-item-list,
.learndash-wrapper .ld-item-list-item,
.learndash-wrapper .ld-item-list-actions,
.learndash-wrapper .ld-table-list,
.learndash-wrapper .ld-table-list-header,
.learndash-wrapper .ld-table-list-item,
.learndash-wrapper .ld-topic-list-item,
.learndash-wrapper .ld-lesson-list-item,
.learndash-wrapper .ld-lesson-item,
.learndash-wrapper .ld-topic-item,
.learndash-wrapper .ld-content-actions,
.learndash-wrapper .ld-status,
.learndash-wrapper .ld-lesson-status,
.learndash-wrapper .ld-topic-status,
.learndash-wrapper .ld-alert,
.learndash-wrapper .ld-progress,
.learndash-wrapper .ld-progress-heading,
.learndash-wrapper .ld-progress-bar,
.learndash-wrapper .ld-quiz-actions,
.learndash-wrapper .ld-primary-color,
.learndash-wrapper .ld-content-page,
.learndash-wrapper .bb-learndash-content,
.learndash-wrapper .ld-video,
.learndash-wrapper .ld-tabs,
.learndash-wrapper .ld-tab-content,
.learndash-wrapper .learndash_mark_complete_button,
.learndash-wrapper h1, .learndash-wrapper h2,
.learndash-wrapper h3, .learndash-wrapper h4,
.learndash-wrapper h5, .learndash-wrapper h6,
.learndash-wrapper p, .learndash-wrapper span,
.learndash-wrapper li, .learndash-wrapper label,
.learndash-wrapper div, .learndash-wrapper td,
.learndash-wrapper th { color: inherit; }

/* Backgrounds — plugin uses white/near-white; make cards use our card token */
.dark .learndash-wrapper .ld-item-list-item,
.dark .learndash-wrapper .ld-table-list-item,
.dark .learndash-wrapper .ld-topic-list-item,
.dark .learndash-wrapper .ld-lesson-list-item,
.dark .learndash-wrapper .ld-focus-content,
.dark .learndash-wrapper .ld-focus-header,
.dark .learndash-wrapper .ld-focus-sidebar,
.dark .learndash-wrapper .ld-course-navigation,
.dark .learndash-wrapper .ld-course-status,
.dark .learndash-wrapper .ld-tabs-navigation,
.dark .learndash-wrapper .ld-tab-content,
.dark .learndash-wrapper .ld-content-page,
.dark .learndash-wrapper .ld-alert {
	background-color: var(--card) !important;
	color: var(--fg) !important;
	border-color: var(--border) !important;
}

/* Progress bar */
.dark .learndash-wrapper .ld-progress-bar {
	background-color: var(--muted) !important;
}
.dark .learndash-wrapper .ld-progress-bar-percentage {
	background-color: var(--sec) !important;
}
.dark .learndash-wrapper .ld-progress-heading,
.dark .learndash-wrapper .ld-progress-stats {
	color: var(--muted-fg) !important;
}

/* Buttons */
.learndash-wrapper .learndash_mark_complete_button,
.learndash-wrapper .ld-button,
.learndash-wrapper .btn-blue,
.learndash-wrapper input[type="submit"] {
	background: var(--primary) !important;
	color: var(--primary-fg) !important;
	border: none !important;
	border-radius: 1rem !important;
	padding: 0.85rem 1.25rem !important;
	font-weight: 600 !important;
	box-shadow: var(--shad-soft) !important;
}
.learndash-wrapper .learndash_mark_complete_button:hover,
.learndash-wrapper .ld-button:hover {
	opacity: 0.92;
}

/* Alert cards */
.dark .learndash-wrapper .ld-alert-warning {
	background-color: oklch(0.72 0.13 75 / 0.15) !important;
	border-color: oklch(0.72 0.13 75 / 0.40) !important;
	color: var(--fg) !important;
}
.dark .learndash-wrapper .ld-alert-success {
	background-color: oklch(0.68 0.15 155 / 0.15) !important;
	border-color: oklch(0.68 0.15 155 / 0.40) !important;
	color: var(--fg) !important;
}

/* Links inside LD content */
.dark .learndash-wrapper a { color: var(--sec); }

/* Any raw white surface leaked through inline styles */
.dark .learndash-wrapper [style*="background: #fff"],
.dark .learndash-wrapper [style*="background:#fff"],
.dark .learndash-wrapper [style*="background-color: #fff"],
.dark .learndash-wrapper [style*="background-color:#fff"],
.dark .learndash-wrapper [style*="background: white"],
.dark .learndash-wrapper [style*="background-color: white"] {
	background: var(--card) !important;
}

/* ── LEARNDASH: force native quiz output to inherit dark-mode surface ────── */
.luux-quiz-wrap,
.luux-quiz-wrap .wpProQuiz_content,
.luux-quiz-wrap .wpProQuiz_quiz,
.luux-quiz-wrap .wpProQuiz_question,
.luux-quiz-wrap .wpProQuiz_questionListItem,
.luux-quiz-wrap .wpProQuiz_response,
.luux-quiz-wrap .learndash-wrapper,
.luux-quiz-wrap .ld-quiz-actions,
.luux-quiz-wrap .ld-content-page,
.luux-quiz-wrap p, .luux-quiz-wrap label, .luux-quiz-wrap span,
.luux-quiz-wrap li, .luux-quiz-wrap div { color: inherit; }
.luux-quiz-wrap input[type="text"],
.luux-quiz-wrap textarea {
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.5rem 0.75rem;
}
.dark .luux-quiz-wrap .wpProQuiz_button,
.dark .luux-quiz-wrap .learndash_mark_complete_button,
.dark .luux-quiz-wrap .wpProQuiz_button2 {
  background: var(--primary); color: var(--primary-fg); border: none;
  border-radius: 0.75rem; padding: 0.6rem 1rem;
}

/* ── QUIZ: cap answer area width on desktop ──────────────────────────────── */
@media (min-width: 768px) {
  #quiz-screen, #results-screen {
    max-width: 640px !important;
  }
}

/* ── BADGE CELEBRATION: full-viewport overlay shown on badge earn/upgrade ──
 * Deliberately a fixed, full-viewport overlay rather than anything inline —
 * it must never share layout flow with existing cards/grids (see the
 * dashboard stats-grid history above for why that matters). z-index sits
 * above the toast (z-index 60 via inline style) and everything else in the
 * theme. */
.luux-badge-celebration {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: oklch(0.1 0.02 250 / 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}
.luux-badge-celebration.is-visible { opacity: 1; }
.luux-badge-celebration.is-leaving { opacity: 0; }

.luux-badge-celebration__confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.luux-confetti-piece {
  position: absolute;
  top: -10%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation-name: luux-confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes luux-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.95; }
  100% { transform: translateY(110vh) rotate(420deg); opacity: 0; }
}

.luux-badge-celebration__card {
  position: relative;
  z-index: 1;
  max-width: 20rem;
  width: 100%;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: var(--shad-pop);
  padding: 2rem 1.5rem 1.5rem;
  cursor: default;
  transform: scale(0.85) translateY(12px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.luux-badge-celebration.is-visible .luux-badge-celebration__card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.luux-badge-celebration__icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 6px oklch(1 0 0 / 0.06);
  animation: luux-badge-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
.luux-badge-celebration__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@keyframes luux-badge-pop {
  0%   { transform: scale(0.4); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.luux-badge-celebration__heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.375rem;
}
.luux-badge-celebration__title {
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 0.625rem;
  line-height: 1.25;
}
.luux-badge-celebration__tier {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}
.luux-badge-celebration__hint {
  font-size: 0.75rem;
  color: var(--muted-fg);
  margin: 1rem 0 0;
}

/* Respect reduced-motion preferences: keep the fade but drop confetti and
   the springy pop/scale so the celebration doesn't trigger motion
   sensitivity, while still clearly announcing the badge. */
@media (prefers-reduced-motion: reduce) {
  .luux-confetti-piece { display: none; }
  .luux-badge-celebration__card { transition: opacity 0.3s ease; transform: none; }
  .luux-badge-celebration__icon { animation: none; }
}

/* ── DASHBOARD: fit the whole homepage on one mobile screen, no scroll ──────
 * User clarification: "we don't need scroll at homepage, keep 'Oefen je
 * fouten' [Practice Your Mistakes] at the bottom." The CTA itself didn't
 * move (see templates/page-dashboard.php) — instead everything ABOVE it
 * (greeting, overall-progress card, the Reeks/Punten/Examens stats grid,
 * the continue-learning card) is tightened so the full stack — greeting
 * through the CTA — fits inside a typical mobile viewport under the sticky
 * header and above the floating bottom tab nav, with nothing left over to
 * scroll to.
 *
 * Scoped to max-width:767px only. Tablet/desktop keep their original,
 * more generous spacing — `.app-main`'s layout never changes shape across
 * breakpoints (only its max-width grows), so those wider viewports already
 * had enough vertical room to show everything without scrolling; nothing
 * needed to change there.
 *
 * NOTE: these values were sized from measuring the markup's own padding/
 * font-size tokens, not from a live rendered screenshot (no browser tool
 * was available this session) — if anything still needs a sliver of
 * scroll on your actual phone, a screenshot showing what's cut off would
 * let this be tightened further with real numbers instead of estimates. */

/* BUG FIX (same day): wrapping the 5 sections in .luux-dashboard-flow took
   them out of .app-main's direct-children list, so the site-wide
   `space-y-6` rule (`.app-main > * + * { margin-top: 1.5rem }`) stopped
   reaching them entirely — at EVERY breakpoint, not just mobile. That's
   what caused the "no space between components" desktop regression: the
   mobile-only override below was the ONLY spacing rule this wrapper had.
   This restores the original 1.5rem gap as the default (all breakpoints),
   which the mobile-only media query then tightens to 0.75rem via
   !important, same as before. */
.luux-dashboard-flow > * + * { margin-top: 1.5rem; }

@media (max-width: 767px) {
  /* Tighter gaps between the 5 stacked sections (greeting → progress card →
     stats grid → continue-learning → CTA) than the 1.5rem default just
     above (which matches the site-wide space-y-6 gap `.app-main` uses
     elsewhere). */
  .luux-dashboard-flow > * + * { margin-top: 0.75rem !important; }

  /* Greeting: the name headline is the one big serif line here; the two
     text-sm lines above/below are already compact and stay as-is. */
  .luux-dashboard-greeting h1 { font-size: 1.5rem !important; line-height: 2rem !important; }

  /* Overall progress card: less padding, a smaller percentage number, and
     a tighter gap before the progress bar. */
  .luux-dashboard-progress > a { padding: 0.875rem !important; }
  .luux-dashboard-progress .text-4xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }
  .luux-dashboard-progress .mt-4 { margin-top: 0.625rem !important; }

  /* Stats grid: less padding and a tighter label gap in each of the 3
     cards — the icon/ring block itself stays exactly as-is (36-44px),
     that sizing was the subject of a previous, hard-won fix and isn't
     touched here. */
  .dashboard-stats-grid > div,
  .dashboard-license-grid > div { padding: 0.75rem !important; }
  .dashboard-stats-grid .mt-2,
  .dashboard-license-grid .mt-2 { margin-top: 0.375rem !important; }

  /* Continue-learning: smaller square image (this drives the whole card's
     row height), tighter content padding, and a smaller gap under the
     "Continue learning" heading. */
  .luux-continue-section .mb-3 { margin-bottom: 0.5rem !important; }
  .luux-continue-image   { width: 84px !important; height: 84px !important; }
  .luux-continue-content { padding: 0.625rem 0.75rem !important; }

  /* Practice-mistakes CTA: less vertical padding on the pill button. */
  .luux-dashboard-cta { padding: 0.75rem !important; }
}
