*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue:    #1a3a5c;
  --gold:    #c9a227;
  --gold-lt: #f5e6b0;
  --teal:    #2b7a78;
  --red:     #c0392b;
  --green:   #27ae60;
  --bg:      #f7f9fc;
  --card:    #ffffff;
  --text:    #1d2b3a;
  --muted:   #6b7a8d;
  --border:  #dce3ec;
  --radius:  12px;
  --shadow:  0 2px 16px rgba(26,58,92,.1);
  --font:    'Segoe UI', system-ui, sans-serif;
}
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; padding-bottom: 3rem; }

/* ── Header ── */
.app-header { background: var(--blue); color: #fff; padding: 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.25rem; gap: 1rem; }
.header-logo { font-size: .8rem; font-weight: 700; color: var(--gold); text-decoration: none; white-space: nowrap; }
.header-meta { font-size: .78rem; text-align: right; opacity: .9; }
.header-meta strong { display: block; color: var(--gold); }
.progress-track { height: 6px; background: rgba(255,255,255,.2); }
.progress-fill { height: 100%; background: var(--gold); transition: width .4s ease; width: 0%; }

/* ── Step navigation ── */
.step-nav { display: none; gap: .4rem; padding: .6rem 1rem; background: #f0f3f8; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.step-nav.show { display: flex; }
.step-nav-btn { border: 1.5px solid var(--border); background: #fff; color: var(--muted); font-family: var(--font); font-size: .78rem; font-weight: 600; padding: .3rem .7rem; border-radius: 20px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.step-nav-btn.visited { border-color: var(--blue); color: var(--blue); cursor: pointer; }
.step-nav-btn.current { background: var(--blue); border-color: var(--blue); color: #fff; cursor: default; }
.step-nav-btn.locked { opacity: .45; cursor: not-allowed; }

/* ── Steps ── */
.step { display: none; }
.step.active { display: block; }
.step-inner { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }

/* ── Exercise labels ── */
.ex-badge { display: inline-block; background: var(--gold); color: var(--blue); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .25rem .7rem; border-radius: 20px; margin-bottom: .75rem; }
.ex-title { font-size: 1.5rem; font-weight: 700; color: var(--blue); margin-bottom: .4rem; }
.ex-subtitle { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }

/* ── Cards ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 600; color: var(--blue); margin-bottom: .75rem; }

/* ── Reading text ── */
.reading-text { font-size: .93rem; line-height: 1.85; color: var(--text); }
.reading-text p { margin-bottom: .85rem; }
.reading-text p:last-child { margin-bottom: 0; }
.speaker { font-weight: 700; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--blue); margin-bottom: .4rem; }
.form-input, .form-textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  padding: .65rem .85rem; font-family: var(--font); font-size: .92rem;
  color: var(--text); background: #fff; transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--blue); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* ── Gap-fill (dropdown) ── */
.gap-text { font-size: .93rem; line-height: 2.6; color: var(--text); }
.gap-select {
  display: inline-block; border: 1.5px solid var(--gold); border-radius: 6px;
  padding: .18rem .45rem; font-family: var(--font); font-size: .82rem;
  background: var(--gold-lt); color: var(--blue); cursor: pointer;
  vertical-align: middle; margin: 0 2px; max-width: 200px;
}
.gap-select:focus { outline: none; border-color: var(--blue); }
.gap-correct { background: #d4edda; border-color: var(--green); color: #155724; }
.gap-wrong   { background: #fde8e8; border-color: var(--red);   color: #721c24; }
.gap-num { font-size: .68rem; color: var(--muted); vertical-align: super; margin-right: 1px; }

/* ── Word bank ── */
.word-bank { background: var(--gold-lt); border: 1.5px solid var(--gold); border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1.25rem; }
.word-bank strong { display: block; color: var(--blue); margin-bottom: .5rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.word-bank span { display: inline-block; margin: .2rem .3rem; background: var(--blue); color: #fff; border-radius: 4px; padding: .18rem .55rem; font-size: .8rem; font-weight: 600; }

/* ── Sentence transformation ── */
.transform-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .85rem; background: #fafbfc; }
.transform-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--blue); font-size: .75rem; font-weight: 800; flex-shrink: 0; margin-bottom: .5rem; }
.transform-original { font-size: .9rem; color: var(--text); font-style: italic; margin-bottom: .65rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.transform-hint { font-size: .75rem; color: var(--muted); margin-top: .3rem; }

/* ── Feedback banners ── */
.feedback { padding: .8rem 1rem; border-radius: 8px; font-size: .88rem; font-weight: 500; margin-top: 1rem; display: none; }
.feedback.show { display: block; }
.feedback.ok   { background: #d4edda; color: #155724; }
.feedback.warn { background: #fff3cd; color: #856404; }
.feedback.err  { background: #fde8e8; color: #721c24; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.5rem; border-radius: 8px; font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(26,58,92,.3); }
.btn-primary:hover { background: #15304f; }
.btn-gold { background: var(--gold); color: var(--blue); box-shadow: 0 2px 8px rgba(201,162,39,.3); }
.btn-gold:hover { background: #b8911f; }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-sm { padding: .5rem 1rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; margin-top: 1.25rem; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ── Welcome screen ── */
.welcome-hero { text-align: center; padding: 2.5rem 1rem 2rem; }
.welcome-flag { font-size: 3rem; margin-bottom: 1rem; }
.welcome-title { font-size: 1.8rem; font-weight: 700; color: var(--blue); margin-bottom: .5rem; }
.welcome-sub { font-size: 1rem; color: var(--muted); margin-bottom: 2rem; max-width: 440px; margin-left: auto; margin-right: auto; }
.exercise-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 2rem; }
.ov-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 10px; padding: .85rem 1rem; font-size: .82rem; }
.ov-card strong { display: block; color: var(--blue); margin-bottom: .2rem; font-size: .88rem; }
.ov-card.locked { opacity: .5; }
.ov-icon { font-size: 1.1rem; margin-bottom: .3rem; }

/* ── Submit / summary ── */
.submit-summary { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.summary-row { border-bottom: 1px solid var(--border); padding: .75rem 0; font-size: .875rem; }
.summary-row:last-child { border-bottom: none; }
.summary-ex { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); margin-bottom: .2rem; }
.summary-q  { font-weight: 600; color: var(--blue); margin-bottom: .3rem; }
.summary-a  { color: var(--text); white-space: pre-wrap; }

@media (max-width: 480px) {
  .ex-title { font-size: 1.25rem; }
  .btn { padding: .65rem 1.1rem; }
  .welcome-title { font-size: 1.4rem; }
  .gap-select { max-width: 150px; font-size: .75rem; }
}
