/* ============================================================
   Citizenship Practice — shared stylesheet (v3 Design Refresh)

   Design principles:
   - Adult ESOL and citizenship learners: calm, professional,
     welcoming. Think public library or community college, not
     government form or children's app.
   - Warm cream background — easier on the eyes than pure white,
     especially on phones in variable lighting.
   - Patina Green accent — trustworthy, warm, consistent with homepage.
   - Layered shadow system for visual depth.
   - 56px minimum tap targets throughout.
   - All color pairings meet WCAG AA contrast.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;600&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
  /* Surface colors */
  --bg:           #f5f2eb;    /* warm cream */
  --bg-card:      #ffffff;

  /* Text */
  --ink:          #1c1c1e;    /* near-black */
  --ink-soft:     #6b6358;    /* warm medium gray */

  /* Primary accent — Patina Green */
  --accent:       #2D7A5E;
  --accent-dark:  #1F5741;
  --accent-soft:  #E8F2EE;    /* Patina Tint */
  --accent-mid:   #AACFC0;    /* border-green */

  /* Feedback */
  --warn-bg:      #fff8ee;
  --warn-border:  #b87200;
  --good-bg:      #eaf5ee;
  --good-border:  #27834f;

  /* Structure */
  --border:       #ddd6c8;    /* warm border */

  /* Shadows — layered for depth */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow:    0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);

  /* Typography */
  --font-display: 'Lora', Georgia, serif;
  --font-body:    'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius:    14px;
  --radius-sm: 8px;
  --tap:       56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  /* Green-tint → warm cream gradient, echoing patinaeducation.com's hero.
     Length-anchored (not background-attachment:fixed, which janks on mobile)
     so the green band sits at the top of the page and fades into cream. */
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 520px);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 18px 52px;
}

/* ----------------------------------------------------------------
   Header
---------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .home-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-header a.home-link { color: var(--ink); }

.site-header .back-link {
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 10px 12px;
  margin-left: -12px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.site-header .back-link:active { background: var(--accent-soft); }

/* Language selector — auto-injected into .site-header by js/i18n.js */
.site-header .lang-select {
  font-family: var(--font-base, inherit);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 40px;
  max-width: 44vw;
  cursor: pointer;
  -webkit-appearance: menulist;
  appearance: menulist;
}
.site-header .lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ----------------------------------------------------------------
   Typography
---------------------------------------------------------------- */
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.22;
  margin: 12px 0 6px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 28px 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.lead {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 28px;
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   Homepage — module groups and section headings
---------------------------------------------------------------- */
.module-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.section-heading {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-soft);
  margin: 20px 0 0;
  padding: 0 2px;
}

.module-section:first-child .section-heading { margin-top: 4px; }

/* ----------------------------------------------------------------
   Homepage — module list and cards
---------------------------------------------------------------- */
.module-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 16px 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
  min-height: var(--tap);
}

/* Highlight on hover / tap: card turns green, icon flips to green-on-white */
.module-card:active {
  background: var(--accent-soft);
  border-color: var(--accent-mid);
}
.module-card:active .module-icon {
  background: var(--accent);
  color: #ffffff;
}

@media (hover: hover) {
  .module-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent-mid);
    box-shadow: var(--shadow-md);
  }
  .module-card:hover .module-icon {
    background: var(--accent);
    color: #ffffff;
  }
}

/* Icon container */
.module-card .module-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

/* Text area */
.module-card .module-body {
  flex: 1;
  min-width: 0;
}

/* "Recommended" badge */
.module-card .module-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-mid);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 5px;
}

.module-card .title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  display: block;
  margin-bottom: 2px;
  line-height: 1.3;
  color: var(--ink);
}

.module-card .desc {
  font-size: 14px;
  color: var(--ink-soft);
  display: block;
  line-height: 1.4;
}

.module-card .desc-es {
  font-size: 13px;
  color: var(--ink-soft);
  display: none;
  margin-top: 2px;
  font-style: italic;
}

/* Right-side arrow */
.module-card .module-arrow {
  flex-shrink: 0;
  color: #c8c0b4;
  display: flex;
  align-items: center;
  transition: color 0.12s;
}
.module-card:hover .module-arrow,
.module-card:active .module-arrow { color: var(--accent); }

/* Featured card — elevated, tinted, top border */
.module-card.featured {
  background: linear-gradient(140deg, #e8f2ee 0%, #f2f8f5 55%, #ffffff 100%);
  border: 1.5px solid var(--accent-mid);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.module-card.featured .module-icon {
  background: var(--accent);
  color: #ffffff;
}

.module-card.featured .title {
  font-size: 17px;
  color: var(--accent-dark);
}

@media (hover: hover) {
  .module-card.featured:hover {
    box-shadow: var(--shadow-md), 0 0 0 2px var(--accent-mid);
  }
}

/* ----------------------------------------------------------------
   Practice card (shared across all practice pages)
---------------------------------------------------------------- */
.practice-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

.section-label {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--accent-mid);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  font-weight: 700;
}

.question-text {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.38;
  margin: 0 0 20px;
  min-height: 60px;
  letter-spacing: -0.01em;
}

.question-text.hidden {
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--font-body);
  font-size: 17px;
}

/* ----------------------------------------------------------------
   Buttons
---------------------------------------------------------------- */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > .btn { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 22px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  text-align: center;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(45,122,94,0.28);
}
.btn-primary:active {
  background: var(--accent-dark);
  box-shadow: none;
}
@media (hover: hover) {
  .btn-primary:hover {
    background: #1F5741;
    box-shadow: 0 4px 12px rgba(45,122,94,0.35);
  }
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent-mid);
}
.btn-secondary:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn-ghost:active { background: var(--border); }

.btn-good {
  background: var(--good-bg);
  color: var(--good-border);
  border-color: var(--good-border);
}
.btn-good:active { filter: brightness(0.95); }

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

.btn.speaking {
  background: var(--accent-dark);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.82; }
}

.btn .icon {
  margin-right: 8px;
  font-size: 18px;
  line-height: 1;
}

/* ----------------------------------------------------------------
   Callout panels (Spanish, sensitive, step note, frame)
---------------------------------------------------------------- */
.es-panel {
  margin-top: 14px;
  padding: 14px 16px;
  background: #f8f2e4;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--ink);
}
.es-panel .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-dark);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.sensitive-note {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--ink);
}
.sensitive-note .label {
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.step-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f8f2e4;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--ink-soft);
}
.step-note em { color: var(--ink-soft); }

.frame-note {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  border-left: 3px solid var(--accent);
}
.frame-note .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-dark);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

/* ----------------------------------------------------------------
   Inline Listen button (Maria Easy Practice)
---------------------------------------------------------------- */
.btn-listen-inline {
  width: 100%;
  margin-top: -4px;
  margin-bottom: 16px;
}

/* ----------------------------------------------------------------
   Writing dictation — need-help inline reveal
---------------------------------------------------------------- */
.writing-help {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.writing-help .label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 4px;
}
.writing-help #writing-help-text {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.4;
  color: var(--ink);
}
.writing-help .help-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.writing-help .help-note em { font-style: italic; }

/* ----------------------------------------------------------------
   Multiple-choice block (Easy Practice)
---------------------------------------------------------------- */
.mc-block { margin-top: 16px; }

.mc-prompt {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warn-border);
}
.mc-prompt em {
  display: block;
  font-style: italic;
  margin-top: 2px;
}

.mc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mc-option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  min-height: var(--tap);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

@media (hover: hover) {
  .mc-option:hover {
    border-color: var(--accent-mid);
    box-shadow: var(--shadow-sm);
  }
}
.mc-option:active { background: var(--accent-soft); }
.mc-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-mid);
}
.mc-option.correct {
  border-color: var(--good-border);
  background: var(--good-bg);
}
.mc-option.incorrect {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}
.mc-option.not-correct { opacity: 0.55; }
.mc-option:disabled { cursor: default; }

/* Global [hidden] enforcement */
[hidden] { display: none !important; }

/* ----------------------------------------------------------------
   N-400 task header
---------------------------------------------------------------- */
.task-header {
  margin: 0 0 14px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--ink);
}
.task-header em {
  display: block;
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 4px;
}

.question-text[hidden] { display: none; }

/* ----------------------------------------------------------------
   N-400 Form Excerpt
   Deliberately document-like — the student should feel like they
   are reading a real form.
---------------------------------------------------------------- */
.form-excerpt {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 18px;
  margin-top: 14px;
  font-size: 15px;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: var(--shadow-sm);
}

.form-excerpt .form-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.form-excerpt .fictional-stamp {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warn-border);
  border: 1px solid var(--warn-border);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-weight: 700;
}

.form-excerpt .part-header {
  background: var(--accent-soft);
  font-weight: 700;
  font-size: 14px;
  padding: 7px 12px 7px 9px;
  margin: 14px -16px 0;
  color: var(--accent-dark);
  letter-spacing: 0.02em;
  border-left: 3px solid var(--accent);
  border-top: 1px solid var(--accent-mid);
}
.form-excerpt .part-header:first-of-type { margin-top: 0; border-top: none; }
.form-excerpt .part-header .part-num { color: var(--accent); }

.form-excerpt .item-block {
  margin: 10px 0 0;
  padding: 8px 0 10px;
  border-bottom: 1px solid #ccc3b5;
}
.form-excerpt .item-block:last-child { border-bottom: none; }

.form-excerpt .item-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-excerpt .item-label .item-num {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

.form-excerpt .field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  align-items: baseline;
}
.form-excerpt .field-label {
  font-size: 15px;
  color: var(--ink-soft);
  flex: 0 0 42%;
}
.form-excerpt .field-value {
  font-family: 'Source Sans 3', monospace;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  word-break: break-word;
}
.form-excerpt .field-value.empty {
  color: var(--ink-soft);
  font-weight: 400;
  font-style: italic;
}
.form-excerpt .field-row.highlight {
  background: #fff3cc;
  border-radius: 4px;
  padding: 4px 7px;
  margin: 2px -7px 6px;
}

/* ----------------------------------------------------------------
   Answer textbox + check status
---------------------------------------------------------------- */
.answer-block { margin-top: 16px; }

.answer-block label.privacy-note {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  padding: 8px 12px;
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warn-border);
}
.answer-block label.privacy-note em {
  display: block;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 2px;
}

.answer-input {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--ink);
  resize: vertical;
  margin-top: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.answer-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,122,94,0.18);
}

.check-status {
  font-size: 15px;
  margin-top: 8px;
  min-height: 22px;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------
   Reveal panel (after Check / Show Sample)
---------------------------------------------------------------- */
.reveal-panel {
  margin-top: 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.reveal-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.reveal-row:last-child { border-bottom: none; }

.reveal-row .reveal-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.reveal-row.from-form  { background: #f8f2e4; }
.reveal-row.expected   { background: var(--accent-soft); }
.reveal-row.spoken     { background: var(--good-bg); }
.reveal-row.correct    { background: var(--good-bg); }
.reveal-row.incorrect  { background: var(--warn-bg); }

.reveal-row .citation {
  font-family: monospace;
  font-size: 13px;
  color: var(--ink-soft);
}

.reveal-row .value {
  font-family: 'Source Sans 3', monospace;
  font-weight: 700;
  color: var(--ink);
  font-size: 16px;
}

.reveal-row .spoken-text {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
}

/* ----------------------------------------------------------------
   Sample answer + expected answer (civics)
---------------------------------------------------------------- */
.sample-answer {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--good-bg);
  border-left: 3px solid var(--good-border);
  border-radius: var(--radius-sm);
}
.sample-answer .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--good-border);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.sample-answer .text {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.4;
}

.expected-answer {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 17px;
}
.expected-answer .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-dark);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

/* ----------------------------------------------------------------
   Progress bar — Patina transformation style
   Copper (#8A6A30) → Copper Light (#FAC775) → Light Patina (#9FE1CB) → Patina Green (#2D7A5E)
   The fill always spans 100% of the track. clip-path reveals the
   left portion only, so early progress shows copper and the bar
   shifts toward green as the student advances.
   JS sets --progress (e.g. "42%") instead of width.
---------------------------------------------------------------- */
.progress-wrap { margin: 6px 0 16px; }

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(to right,
    #8A6A30  0%,
    #FAC775  45%,
    #9FE1CB  72%,
    #2D7A5E  100%
  );
  clip-path: inset(0 calc(100% - var(--progress, 0%)) 0 0 round 999px);
  transition: clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

/* Shimmer — soft light sweeping across the filled portion */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 35%;
  background: linear-gradient(
    90deg,
    transparent      0%,
    rgba(255,255,255,0.26) 50%,
    transparent      100%
  );
  animation: patina-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes patina-shimmer {
  0%   { transform: translateX(-200%); }
  55%  { transform: translateX(380%); }
  100% { transform: translateX(380%); }
}

.progress-text {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ----------------------------------------------------------------
   Speed toggle
---------------------------------------------------------------- */
.speed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 6px;
  padding: 8px 0;
}
.speed-toggle input { width: 20px; height: 20px; }

/* ----------------------------------------------------------------
   Text input (writing practice)
---------------------------------------------------------------- */
.user-input {
  width: 100%;
  min-height: 90px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.user-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,122,94,0.18);
}

/* ----------------------------------------------------------------
   Intro / end screen cards
---------------------------------------------------------------- */
.screen-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-top: 16px;
  box-shadow: var(--shadow);
  position: relative;    /* anchor for .confetti-container */
}
.screen-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.screen-card p {
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.screen-card .btn-group { text-align: left; }

/* ----------------------------------------------------------------
   Completion / end-screen components
---------------------------------------------------------------- */

/* Zero-height anchor so confetti pieces fall out of the card top */
.confetti-container {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

@keyframes confetti-fall {
  0%   { transform: translateX(0) translateY(-2px) rotate(var(--rot, 0deg)); opacity: 1; }
  65%  { opacity: 1; }
  100% { transform: translateX(var(--drift, 0px)) translateY(var(--drop, 160px)) rotate(var(--rot-end, 270deg)); opacity: 0; }
}

/* Header row: circular check icon + h2 */
.completion-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.completion-header h2 { margin: 0; }

.completion-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--good-bg);
  border: 2px solid var(--good-border);
  color: var(--good-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.completion-icon.neutral {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-border);
}

/* Large score number block */
.completion-score-block {
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-mid);
  border-radius: var(--radius);
  padding: 18px 20px 14px;
  margin: 0 0 16px;
  text-align: center;
}
.score-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  color: var(--accent-dark);
  line-height: 1;
  display: block;
  letter-spacing: -0.02em;
}
.score-sublabel {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 5px;
  display: block;
}
.score-percent {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 10px;
  display: block;
  letter-spacing: -0.01em;
}

/* Warm encouraging message */
.completion-message {
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.6;
}
.completion-message em {
  display: block;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.5;
}

/* Small footer note */
.completion-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  line-height: 1.55;
}

/* ----------------------------------------------------------------
   Profile picker (intro screen)
---------------------------------------------------------------- */
.profile-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.profile-picker button {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.12s, background 0.12s;
}
.profile-picker button:active { background: var(--accent-soft); }
.profile-picker button.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-mid);
}
.profile-picker button .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.profile-picker button .summary {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------
   Audio hint banner
---------------------------------------------------------------- */
.audio-hint {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-soft);
  animation: hint-fade 6s ease forwards;
}

@keyframes hint-fade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* ----------------------------------------------------------------
   Disclaimer
---------------------------------------------------------------- */
.disclaimer-mini {
  margin-top: 40px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
  border-top: 1px solid var(--border);
  line-height: 1.65;
}
.disclaimer-mini a { color: var(--accent); }

/* ----------------------------------------------------------------
   Status line
---------------------------------------------------------------- */
.status-line {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 10px;
  min-height: 22px;
}

/* ----------------------------------------------------------------
   Responsive
---------------------------------------------------------------- */
@media (max-width: 360px) {
  body { font-size: 17px; }
  .question-text { font-size: 20px; }
  h1 { font-size: 25px; }
  .module-card .module-icon { width: 38px; height: 38px; }
}

@media (min-width: 700px) {
  .container { padding: 36px 24px 60px; }
  h1 { font-size: 32px; }
  .module-card { padding: 18px 20px 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn.speaking { animation: none; }
  .progress-fill { transition: none; }
  .progress-fill::after { animation: none; display: none; }
  * { transition: none !important; }
}

/* ----------------------------------------------------------------
   Focus styles (keyboard navigation)
---------------------------------------------------------------- */
.btn:focus-visible,
.user-input:focus-visible,
.answer-input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Patina "hover" interaction for module cards (matches patinaeducation.com) ==
   On hover the card background AND its icon sweep copper -> verdigris in tandem
   (~1.5s); the chip stays WHITE so the green icon never bleeds into the green card.
   Reduced-motion / touch keeps the static green hover above. Canonical spec in
   patina-activities-proto/BRAND_TRANSFORMATION.md ("the patina hover"). */
.module-card .module-icon { background: #fff; box-shadow: 0 1px 4px rgba(28,28,30,.10); }
@keyframes patinaCardBg    { from { background-color:#EAD7C2; border-color:#DCC0A0; } to { background-color:#E3F0EA; border-color:#AACFC0; } }
@keyframes patinaIconColor { from { color:#A35E2C; } to { color:#1F5741; } }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .module-card:hover { animation: patinaCardBg 1.5s ease both; }
  .module-card:hover .module-icon { background: #fff; animation: patinaIconColor 1.5s ease both; }
}
