/* ============================================================
   GermanForLife — Main Stylesheet
   Mobile-first, clean educational design
   ============================================================ */

:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --primary-light: #e3f2fd;
  --accent: #f57c00;
  --accent-light: #fff3e0;
  --text: #1a1a2e;
  --text-muted: #5a6270;
  --text-light: #9aa0aa;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-card: #ffffff;
  --border: #e0e0e0;
  --border-dark: #bdbdbd;
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --success-border: #a5d6a7;
  --error: #c62828;
  --error-bg: #ffebee;
  --error-border: #ef9a9a;
  --warning: #e65100;
  --warning-bg: #fff8e1;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.12);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --radius: 8px;
  --radius-lg: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1100px;
  --header-h: 64px;
  --transition: 0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.4em; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: var(--font); }
main { flex: 1; }

/* ── Typography ── */
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.4; }
h4 { font-size: 0.95rem; font-weight: 700; }
p { margin-bottom: 0.9em; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1.1rem; }
.section { padding: 3rem 0; }
.section--alt { background: var(--bg-alt); }
.section--blue { background: var(--primary-light); }

/* ── Header ── */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 1rem;
}
.site-logo {
  font-size: 1.25rem; font-weight: 800;
  color: var(--primary); letter-spacing: -0.03em;
  white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}
.site-logo span { color: var(--accent); }
.site-nav { display: none; gap: 0.1rem; align-items: center; }
.site-nav a {
  padding: 0.45rem 0.75rem; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600; color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--primary); background: var(--primary-light);
  text-decoration: none;
}
.nav-cta {
  background: var(--primary) !important; color: #fff !important;
  border-radius: var(--radius) !important;
  padding: 0.45rem 1rem !important;
}
.nav-cta:hover { background: var(--primary-dark) !important; }
.hamburger {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; padding: 4px; background: none; border-radius: var(--radius);
  transition: background var(--transition);
}
.hamburger:hover { background: var(--bg-alt); }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1); z-index: 99; padding: 1rem;
}
.mobile-nav.open { display: flex; flex-direction: column; gap: 0.2rem; }
.mobile-nav a {
  display: block; padding: 0.65rem 1rem; border-radius: var(--radius);
  font-weight: 600; color: var(--text); font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.mobile-nav a.mobile-cta {
  background: var(--primary); color: #fff; margin-top: 0.5rem; text-align: center;
}
.mobile-nav a.mobile-cta:hover { background: var(--primary-dark); }

@media (min-width: 800px) {
  .site-nav { display: flex; }
  .hamburger { display: none; }
}

/* ── Footer ── */
#site-footer {
  background: #1a1a2e; color: #ccc;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem; margin-bottom: 2rem;
}
.footer-col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.footer-col a { display: block; color: #999; font-size: 0.88rem; margin-bottom: 0.3rem; transition: color var(--transition); }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #2a2a3e; padding-top: 1.25rem;
  font-size: 0.8rem; color: #666; text-align: center; line-height: 1.6;
}
.footer-logo { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; display: block; }
.footer-logo span { color: var(--accent); }
@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-muted); padding: 0.75rem 0;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--text-light); }

/* ── Hero ── */
.hero { padding: 3.5rem 0 2.5rem; text-align: center; background: var(--bg-alt); }
.hero__eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  background: var(--primary-light); color: var(--primary);
  padding: 0.3rem 0.85rem; border-radius: 100px; margin-bottom: 1.1rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.hero__title { margin-bottom: 1rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.hero__title em { font-style: normal; color: var(--primary); }
.hero__subtitle {
  font-size: 1.05rem; color: var(--text-muted); max-width: 560px;
  margin: 0 auto 2rem; line-height: 1.7;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.hero--page { padding: 2.5rem 0 1.5rem; text-align: left; }
.hero--page .hero__eyebrow, .hero--page .hero__title, .hero--page .hero__subtitle {
  margin-left: 0; margin-right: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1.5rem; border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 700; transition: all var(--transition);
  white-space: nowrap; cursor: pointer; text-decoration: none; border: 2px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--outline:hover { background: var(--primary-light); }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: #e65100; border-color: #e65100; color: #fff; }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn--sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn--lg { padding: 0.9rem 2rem; font-size: 1.05rem; }
.btn--block { width: 100%; justify-content: center; }
.btn--success { background: var(--success); color: #fff; border-color: var(--success); }
.btn--danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Cards ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem;
  box-shadow: var(--shadow-card); transition: box-shadow var(--transition), transform var(--transition);
}
.card--link:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); cursor: pointer; }
.card__icon { font-size: 2rem; margin-bottom: 0.6rem; }
.card__title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--text); }
.card__desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0; }
.card__tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 100px;
  background: var(--primary-light); color: var(--primary);
  margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ── Trust Strip ── */
.trust-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem 2.5rem;
  padding: 1.5rem 0; background: var(--bg);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.trust-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; font-weight: 600; color: var(--text-muted);
}
.trust-item .icon { font-size: 1.1rem; }

/* ── Progress Bar ── */
.progress-bar {
  height: 8px; background: var(--border); border-radius: 100px; overflow: hidden;
}
.progress-bar__fill {
  height: 100%; border-radius: 100px; background: var(--primary);
  transition: width 0.4s ease; min-width: 0;
}
.progress-bar--sm { height: 5px; }
.progress-bar--accent .progress-bar__fill { background: var(--accent); }
.progress-bar--success .progress-bar__fill { background: var(--success); }
.progress-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.35rem; font-size: 0.82rem; color: var(--text-muted);
}
.progress-label strong { color: var(--text); }

/* ── Badges / Tags ── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.55rem;
  border-radius: 100px; white-space: nowrap;
}
.badge--blue { background: var(--primary-light); color: var(--primary); }
.badge--green { background: var(--success-bg); color: var(--success); }
.badge--orange { background: var(--accent-light); color: var(--warning); }
.badge--red { background: var(--error-bg); color: var(--error); }
.badge--gray { background: var(--bg-alt); color: var(--text-muted); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 1rem 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--bg-alt); font-weight: 700; text-align: left; padding: 0.65rem 1rem; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }
.de { font-weight: 700; color: var(--text); }
.en { color: var(--text-muted); }
.art-der { color: #1565c0; font-weight: 700; }
.art-die { color: #c62828; font-weight: 700; }
.art-das { color: #2e7d32; font-weight: 700; }

/* ── Grammar ── */
.grammar-box {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 1.2rem 0;
}
.grammar-box h3 { margin-bottom: 0.6rem; }
.grammar-box--rule {
  border-left: 4px solid var(--primary); background: var(--primary-light);
}
.grammar-example {
  font-size: 1.05rem; font-weight: 600; color: var(--primary);
  margin: 0.35rem 0; padding: 0.15rem 0;
}
.grammar-example em { font-style: normal; color: var(--accent); }
.explanation { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.25rem; }
.tip-box {
  background: var(--warning-bg); border: 1px solid #ffcc80;
  border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0;
  font-size: 0.9rem;
}
.tip-box strong { color: var(--warning); }

/* ── Flashcards ── */
.flashcard-area { margin: 1.5rem 0; }
.theme-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem;
}
.theme-btn {
  padding: 0.4rem 0.9rem; border-radius: 100px; border: 2px solid var(--border);
  font-size: 0.82rem; font-weight: 700; background: var(--bg);
  color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); }
.theme-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.flashcard-stage { perspective: 1000px; margin: 0 auto; max-width: 440px; }
.flashcard {
  width: 100%; aspect-ratio: 5/3; position: relative;
  transform-style: preserve-3d; transition: transform 0.5s ease;
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.fc-front, .fc-back {
  position: absolute; inset: 0; border-radius: var(--radius-lg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem; box-shadow: var(--shadow-card);
}
.fc-front { background: var(--bg); border: 2px solid var(--border); }
.fc-back { background: var(--primary); color: #fff; transform: rotateY(180deg); }
.fc-german { font-size: 2rem; font-weight: 800; margin-bottom: 0.3rem; }
.fc-article { font-size: 0.9rem; font-weight: 600; opacity: 0.7; margin-bottom: 0.5rem; }
.fc-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 0.5rem; }
.fc-english { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.fc-example { font-size: 0.85rem; opacity: 0.85; text-align: center; }
.flashcard-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-top: 1rem; max-width: 440px; margin-left: auto; margin-right: auto;
}
.fc-counter { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.fc-marks { display: flex; gap: 0.5rem; margin-top: 0.75rem; justify-content: center; }
.fc-progress { max-width: 440px; margin: 0 auto 1rem; }
.fc-stats { display: flex; gap: 1rem; justify-content: center; margin-top: 0.5rem; font-size: 0.82rem; }
.fc-stat { display: flex; align-items: center; gap: 0.3rem; }
.fc-stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.fc-stat .dot--green { background: var(--success); }
.fc-stat .dot--red { background: var(--error); }

/* ── Der/Die/Das Trainer ── */
.ddd-stage {
  max-width: 480px; margin: 0 auto; padding: 1.5rem;
  background: var(--bg-alt); border-radius: var(--radius-lg);
  border: 1px solid var(--border); text-align: center;
}
.ddd-noun { font-size: 2.5rem; font-weight: 800; margin: 1rem 0 0.25rem; min-height: 3.5rem; }
.ddd-english { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; min-height: 1.5rem; }
.ddd-btns { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 1rem; }
.ddd-btn {
  flex: 1; max-width: 120px; padding: 0.85rem 0.5rem;
  border-radius: var(--radius); font-size: 1.1rem; font-weight: 800;
  border: 2px solid var(--border); background: var(--bg); color: var(--text);
  cursor: pointer; transition: all var(--transition);
}
.ddd-btn:hover { border-color: currentColor; transform: translateY(-2px); box-shadow: var(--shadow); }
.ddd-btn--der:hover { color: #1565c0; border-color: #1565c0; background: #e3f2fd; }
.ddd-btn--die:hover { color: #c62828; border-color: #c62828; background: #ffebee; }
.ddd-btn--das:hover { color: #2e7d32; border-color: #2e7d32; background: #e8f5e9; }
.ddd-btn--der.selected { background: #1565c0; color: #fff; border-color: #1565c0; }
.ddd-btn--die.selected { background: #c62828; color: #fff; border-color: #c62828; }
.ddd-btn--das.selected { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.ddd-btn.correct { background: var(--success); color: #fff; border-color: var(--success); }
.ddd-btn.wrong { background: var(--error); color: #fff; border-color: var(--error); }
.ddd-feedback {
  padding: 0.65rem 1rem; border-radius: var(--radius);
  font-weight: 700; font-size: 0.95rem; min-height: 2.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.ddd-feedback.correct { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.ddd-feedback.wrong { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }
.ddd-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; min-height: 1.2rem; }
.ddd-scorecard {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ddd-score { text-align: center; }
.ddd-score__num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.ddd-score__label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ddd-score--correct .ddd-score__num { color: var(--success); }
.ddd-score--wrong .ddd-score__num { color: var(--error); }
.ddd-score--total .ddd-score__num { color: var(--primary); }
.ddd-progress-row { margin: 0.75rem 0; }

/* ── Sentence Builder ── */
.sb-stage {
  max-width: 600px; margin: 0 auto;
}
.sb-sentence-type {
  font-size: 0.78rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem;
}
.sb-english {
  font-size: 1.05rem; color: var(--text); margin-bottom: 1.25rem; font-style: italic;
}
.sb-drop-area {
  min-height: 56px; border: 2px dashed var(--border-dark);
  border-radius: var(--radius); padding: 0.6rem 0.75rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  background: var(--bg-alt); margin-bottom: 0.75rem;
  transition: border-color var(--transition), background var(--transition);
}
.sb-drop-area.active { border-color: var(--primary); background: var(--primary-light); }
.sb-drop-area.correct-final { border-color: var(--success); background: var(--success-bg); }
.sb-drop-area.wrong-final { border-color: var(--error); background: var(--error-bg); }
.sb-word-pool { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.sb-word {
  padding: 0.5rem 0.85rem; border-radius: var(--radius);
  border: 2px solid var(--border-dark); background: var(--bg);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition); user-select: none;
  color: var(--text);
}
.sb-word:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.sb-word.used { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.sb-word.in-answer {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.sb-controls { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sb-explanation {
  display: none; padding: 1rem 1.25rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem;
}
.sb-explanation.visible { display: block; }
.sb-explanation strong { color: var(--primary); }
.sb-counter { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ── Mock Exam ── */
.exam-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem;
}
.exam-section-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  padding: 1rem 1.4rem; background: var(--bg-alt); border-bottom: 1px solid var(--border);
}
.exam-section-title { font-weight: 800; font-size: 1.05rem; }
.exam-timer {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 700; color: var(--text-muted);
}
.exam-timer.urgent { color: var(--error); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.exam-body { padding: 1.4rem; }
.exam-question { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.exam-question:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.exam-q-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.4rem; }
.exam-q-text { font-size: 1rem; margin-bottom: 0.75rem; }
.exam-options { display: flex; flex-direction: column; gap: 0.5rem; }
.exam-option {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition); font-size: 0.92rem;
  background: var(--bg);
}
.exam-option:hover { border-color: var(--primary); background: var(--primary-light); }
.exam-option.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.exam-option.correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.exam-option.wrong { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.exam-option input[type="radio"] { accent-color: var(--primary); flex-shrink: 0; }
.exam-textarea {
  width: 100%; min-height: 100px; padding: 0.75rem 1rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 0.95rem; resize: vertical; transition: border var(--transition);
}
.exam-textarea:focus { outline: none; border-color: var(--primary); }
.exam-blank {
  display: inline-block; min-width: 80px; border-bottom: 2px solid var(--primary);
  margin: 0 0.25rem; text-align: center; font-weight: 700;
}
.model-answer {
  display: none; background: var(--success-bg); border: 1px solid var(--success-border);
  border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-top: 0.75rem;
  font-size: 0.9rem;
}
.model-answer.visible { display: block; }
.model-answer strong { color: var(--success); }
.exam-result {
  text-align: center; padding: 2rem; background: var(--bg-alt);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.exam-score-big { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; }

/* ── Daily Plan ── */
.day-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.6rem;
  transition: border-color var(--transition);
}
.day-card.completed { border-color: var(--success); background: var(--success-bg); }
.day-card__header {
  display: flex; align-items: center; gap: 0.75rem; cursor: pointer;
  user-select: none;
}
.day-num {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; background: var(--bg-alt); color: var(--text-muted);
}
.day-card.completed .day-num { background: var(--success); color: #fff; }
.day-card.today .day-num { background: var(--primary); color: #fff; }
.day-title { font-weight: 700; font-size: 0.95rem; flex: 1; }
.day-check {
  width: 22px; height: 22px; border: 2px solid var(--border-dark);
  border-radius: 4px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; transition: all var(--transition); cursor: pointer;
}
.day-card.completed .day-check { background: var(--success); border-color: var(--success); }
.day-tasks { display: none; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.day-tasks.open { display: block; }
.day-task { display: flex; gap: 0.5rem; font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--text-muted); }
.day-task::before { content: "→"; color: var(--primary); flex-shrink: 0; }
.plan-header-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.plan-stats { display: flex; gap: 1.5rem; }
.plan-stat { text-align: center; }
.plan-stat__num { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.plan-stat__label { font-size: 0.75rem; color: var(--text-muted); }

/* ── Germany Journey ── */
.phrase-card {
  background: var(--primary-light); border: 1px solid #bbdefb;
  border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-bottom: 0.6rem;
}
.phrase-de { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 0.15rem; }
.phrase-en { font-size: 0.88rem; color: var(--text-muted); }
.dialogue-box {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem; margin: 1.25rem 0;
}
.dialogue-line { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.dialogue-line:last-child { margin-bottom: 0; }
.dialogue-speaker {
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  min-width: 60px; padding-top: 0.1rem; flex-shrink: 0;
}
.dialogue-speaker--you { color: var(--primary); }
.dialogue-speaker--clerk { color: var(--accent); }
.dialogue-text { font-size: 0.92rem; }
.dialogue-text .de { display: block; font-weight: 600; margin-bottom: 0.1rem; }
.dialogue-text .en { font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
.vocab-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem; margin: 1rem 0;
}
.vocab-item {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.65rem 0.9rem; font-size: 0.88rem;
}
.vocab-item .de { font-weight: 700; color: var(--text); }
.vocab-item .en { color: var(--text-muted); font-size: 0.82rem; }
.fill-exercise { margin: 1.25rem 0; }
.fill-question {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.fill-input {
  border: 2px solid var(--border-dark); border-radius: 4px;
  padding: 0.25rem 0.5rem; font-size: 0.95rem; font-weight: 700;
  width: 130px; text-align: center; transition: border var(--transition);
}
.fill-input:focus { outline: none; border-color: var(--primary); }
.fill-input.correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.fill-input.wrong { border-color: var(--error); background: var(--error-bg); color: var(--error); }

/* ── Quiz ── */
.quiz-wrap { max-width: 560px; }
.quiz-question { margin-bottom: 1.25rem; }
.quiz-q-text { font-weight: 700; margin-bottom: 0.6rem; font-size: 0.97rem; }
.quiz-options { display: flex; flex-direction: column; gap: 0.4rem; }
.quiz-opt {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem;
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer;
  font-size: 0.9rem; transition: all var(--transition); background: var(--bg);
}
.quiz-opt:hover { border-color: var(--primary); background: var(--primary-light); }
.quiz-opt.correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.quiz-opt.wrong { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.quiz-opt input { accent-color: var(--primary); }
.quiz-feedback { margin-top: 0.5rem; font-size: 0.85rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); }
.quiz-result {
  padding: 1.5rem; background: var(--bg-alt); border-radius: var(--radius-lg);
  border: 1px solid var(--border); text-align: center; margin-top: 1.5rem;
}

/* ── Readiness Meter ── */
.readiness-meter {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem; margin: 1.5rem 0;
}
.readiness-percent {
  font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1;
  margin-bottom: 0.25rem;
}
.readiness-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ── Section headings ── */
.section-heading { margin-bottom: 1.5rem; }
.section-heading h2 { margin-bottom: 0.3rem; }
.section-heading p { font-size: 0.95rem; color: var(--text-muted); margin: 0; }
.section-heading--center { text-align: center; }

/* ── Alert / Info box ── */
.alert {
  padding: 0.85rem 1.1rem; border-radius: var(--radius);
  font-size: 0.9rem; margin: 1rem 0; display: flex; gap: 0.6rem; align-items: flex-start;
}
.alert--info { background: var(--primary-light); border: 1px solid #90caf9; color: var(--primary-dark); }
.alert--success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert--warn { background: var(--warning-bg); border: 1px solid #ffcc80; color: var(--warning); }
.alert-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── About / static pages ── */
.prose h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.prose h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose ul, .prose ol { margin-bottom: 1rem; }
.prose li { margin-bottom: 0.25rem; }
.prose a { font-weight: 600; }

/* ── Related pages ── */
.related-pages { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related-pages h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.related-grid {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.related-link {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.88rem; font-weight: 600;
  color: var(--text); transition: all var(--transition);
}
.related-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); text-decoration: none; }

/* ── Module hub / A1 hub ── */
.module-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.4rem; border-radius: var(--radius-lg);
  background: var(--bg); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); transition: all var(--transition);
  text-decoration: none; color: var(--text);
}
.module-card:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.module-card__top { display: flex; align-items: center; justify-content: space-between; }
.module-card__icon { font-size: 1.8rem; }
.module-card__status { font-size: 0.75rem; }
.module-card__title { font-weight: 800; font-size: 1rem; }
.module-card__desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.module-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ── Weak area panel ── */
.weak-panel {
  background: var(--error-bg); border: 1px solid var(--error-border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.weak-panel h3 { color: var(--error); margin-bottom: 0.5rem; font-size: 0.95rem; }
.weak-tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--error); color: #fff; border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; margin: 0.2rem;
}

/* ── Utilities ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── Loading state ── */
.loader {
  text-align: center; padding: 2rem;
  color: var(--text-muted); font-size: 0.95rem;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 0 auto 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg {
  text-align: center; padding: 2rem; color: var(--error);
  background: var(--error-bg); border-radius: var(--radius);
}

/* ── Responsive tweaks ── */
@media (max-width: 600px) {
  .hero { padding: 2rem 0 1.5rem; }
  .section { padding: 2rem 0; }
  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { text-align: center; justify-content: center; }
  .ddd-btns { gap: 0.5rem; }
  .ddd-btn { font-size: 0.95rem; padding: 0.75rem 0.5rem; }
  .ddd-noun { font-size: 2rem; }
  .fc-german { font-size: 1.6rem; }
  h1 { font-size: 1.6rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  table { font-size: 0.82rem; }
  td, th { padding: 0.5rem 0.75rem; }
}

@media (min-width: 768px) {
  .hero { padding: 5rem 0 3.5rem; }
  .flashcard-stage { max-width: 500px; }
}

.table-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--text);
  background: var(--bg);
}

.search-input:focus {
  outline: 2px solid var(--primary-light);
  border-color: var(--primary);
}

.vocab-table th,
.vocab-table td {
  vertical-align: top;
}

.vocab-table td:first-child {
  font-weight: 700;
  color: var(--text);
}

.vocab-table td:nth-child(2) {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .table-actions {
    align-items: stretch;
  }

  .table-actions .btn,
  .search-input {
    width: 100%;
  }
}

@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
  }

  header,
  nav,
  footer,
  .site-header,
  .site-footer,
  .navbar,
  .breadcrumb,
  .filters,
  .tool-section,
  .flashcard,
  .flashcard-controls,
  .table-actions,
  .related-pages,
  .cta-section,
  .progress-card,
  .btn {
    display: none !important;
  }

  .section,
  .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .section-heading {
    margin-bottom: 16px !important;
  }

  .section-heading h2 {
    font-size: 24px !important;
    margin-bottom: 6px !important;
  }

  .section-heading p {
    font-size: 12px !important;
    color: #374151 !important;
  }

  .table-wrap {
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
  }

  .vocab-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10px !important;
  }

  .vocab-table th,
  .vocab-table td {
    border: 1px solid #d1d5db !important;
    padding: 6px !important;
    text-align: left !important;
    vertical-align: top !important;
  }

  .vocab-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    font-weight: 700 !important;
  }

  .vocab-table td:first-child {
    font-weight: 700 !important;
  }

  .vocab-table td:nth-child(2) {
    font-weight: 700 !important;
    color: #111827 !important;
  }

  .vocab-table small {
    display: block !important;
    color: #4b5563 !important;
    margin-top: 3px !important;
    font-size: 9px !important;
  }

  @page {
    size: A4;
    margin: 12mm;
  }
}