/* icaotest.org house style: navy header band, amber kicker, cream note boxes, ink body text. */
:root {
  --navy: #0b1f33;
  --amber: #ffb020;
  --cream: #f2e9d8;
  --ink: #1d3a55;
  --green: #1e8e52;
  --red: #c0392b;
  --line: #d9dee4;
  --page: #ffffff;
  --muted: #5b6f82;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}
a { color: var(--ink); }

.band { background: var(--navy); color: #fff; }
.band-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}
.kicker {
  font-family: "Courier New", Courier, monospace;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 14px;
}
.band-title { font-size: 16px; }
.band-nav { margin-left: auto; display: flex; gap: 14px; align-items: baseline; font-size: 15px; }
.band-nav a, .band-nav button { color: #fff; }
.band-nav form { display: inline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

.page { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; }
.page.wide { max-width: 1040px; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { max-width: 760px; margin: 0 auto; padding: 16px 20px; }

h1 { font-size: 28px; line-height: 1.2; margin: 4px 0 12px; color: var(--navy); }
h1:focus { outline: none; }
h2 { font-size: 19px; margin: 28px 0 8px; color: var(--navy); }
.note h2 { margin-top: 0; }
.eyebrow {
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  color: #8a5a00;
  margin: 0;
}
.lead { font-size: 19px; margin: 0 0 16px; }
.small { font-size: 15px; color: var(--muted); }
.kind { margin: -6px 0 8px; color: var(--muted); }

.note {
  background: var(--cream);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 16px 0;
}
.note ul { margin: 0; padding-left: 20px; }
.note li + li { margin-top: 4px; }
.note p { margin: 0 0 8px; }
.note p:last-child { margin-bottom: 0; }
.note audio { width: 100%; margin-top: 4px; }

.alert {
  background: #fdecea;
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 16px 0;
}
.alert p { margin: 0; }
.ok {
  background: #e8f5ee;
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 16px 0;
}
.resume { font-weight: 700; }

.task-list { padding-left: 22px; margin: 0 0 8px; }
.task-list li { margin: 6px 0; }
.t-title { font-weight: 700; display: block; }
.t-meta { color: var(--muted); font-size: 15px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn {
  appearance: none;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  padding: 13px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #163a5c; }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-small { padding: 6px 12px; min-height: 0; font-size: 15px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
@media (max-width: 520px) { .actions .btn { width: 100%; justify-content: center; } }

.meter { height: 12px; background: #e9edf1; border-radius: 6px; overflow: hidden; margin: 16px 0; }
.meter-bar { height: 100%; width: 0; background: var(--green); transition: width 80ms linear; }

.task-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.phase {
  font-weight: 700;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy);
}
.phase[data-phase="record"] { background: var(--red); color: #fff; }
.phase[data-phase="record"]::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  margin-right: 7px;
  animation: pulse 1.2s ease-in-out infinite;
}
.phase[data-phase="listen"] { background: var(--navy); color: #fff; }
@keyframes pulse { 50% { opacity: 0.25; } }

.timer {
  font-family: "Courier New", Courier, monospace;
  font-size: 52px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin: 8px 0 4px;
}
.timer-small { font-size: 32px; }
.phase-help { color: var(--muted); margin: 4px 0 12px; }
.prompt-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 12px 0;
  font-size: 19px;
}
.prompt-card p { margin: 0; white-space: pre-line; }
.prompt-card img { display: block; max-width: 100%; height: auto; margin-top: 14px; border-radius: 6px; }
.listen-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 18px; margin: 12px 0; }
.listen-box p { margin: 0 0 8px; font-weight: 700; }
.listen-box p:last-child { margin: 0; }
.listen-box .btn-secondary { border-color: #fff; }

.spinner {
  width: 44px;
  height: 44px;
  border: 5px solid #e9edf1;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 18px 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner, .phase[data-phase="record"]::before { animation: none; }
}

/* Admin */
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; }
.grid th, .grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { background: #f5f7f9; color: var(--navy); }
.grid audio { width: 260px; max-width: 100%; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #e9edf1; color: var(--navy); white-space: nowrap; }
.tag-submitted { background: #e8f5ee; color: var(--green); }
.tag-in_progress { background: var(--cream); color: #8a5a00; }
.tag-warn { background: #fdecea; color: var(--red); }
.form-grid { display: grid; gap: 14px; max-width: 520px; }
label { font-weight: 700; display: block; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #aab4bf;
  border-radius: 6px;
  color: var(--ink);
}
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 6px 0; }
.check input { margin-top: 5px; }
.hint { font-size: 14px; color: var(--muted); font-weight: 400; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkbox input { flex: 1 1 320px; font-family: "Courier New", Courier, monospace; font-size: 14px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
dl.facts dt { font-weight: 700; }
dl.facts dd { margin: 0; }
.events { font-size: 14px; color: var(--muted); padding-left: 18px; }

/* Free English check */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.steps { padding-left: 22px; margin: 0 0 8px; }
.steps li { margin: 4px 0; }
.grammar h2 { margin-top: 32px; padding-bottom: 6px; border-bottom: 2px solid var(--cream); }
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 10px; margin: 14px 0 0; }
.q legend { display: flex; gap: 12px; align-items: baseline; padding: 0; font-weight: 400; float: left; width: 100%; margin-bottom: 10px; }
.q legend + * { clear: both; }
.q-num {
  flex: none;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  color: var(--navy);
  min-width: 26px;
}
.q-stem { font-size: 18px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 38px; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  margin: 0;
  padding: 10px 14px;
  min-height: 48px;
  border: 1px solid #aab4bf;
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
}
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.choice:has(input:checked) { border: 2px solid var(--navy); background: #eef3f8; font-weight: 700; padding: 9px 13px; }
@media (max-width: 520px) {
  .choices { padding-left: 0; flex-direction: column; }
}
.tag-free { background: var(--cream); color: #8a5a00; }
.tag-needs_reply { background: var(--cream); color: #8a5a00; }
.tag-replied { background: #e8f5ee; color: var(--green); }
.wrong { color: var(--red); font-weight: 700; }
.right { color: var(--green); font-weight: 700; }
textarea.reply {
  width: 100%;
  min-height: 260px;
  font: inherit;
  font-size: 15px;
  padding: 12px;
  border: 1px solid #aab4bf;
  border-radius: 6px;
  color: var(--ink);
}
h3 { font-size: 17px; margin: 20px 0 6px; color: var(--navy); }
.wrong-list { padding-left: 26px; }
.wrong-list li { margin: 10px 0; }

.backup-line { margin: 0 0 16px; }
