/* ═══════════════════════════════════════════════════════
   IELTS Mock Room — "Neon Trainer / Daylight" design system
   Bright · pastel gradient mesh · vivid accents · readable
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --paper: #FAFAFF;             /* page bg */
  --paper-deep: #F0EFFA;        /* raised layer */
  --card: #FFFFFF;
  --ink: #1B1B2F;               /* main text — high contrast */
  --ink-soft: #4E4E68;
  --ink-faint: #9493AC;
  --rule: #E7E6F2;
  --crimson: #DB2777;           /* hot accent (legacy var name) */
  --crimson-soft: #FCE7F3;
  --violet: #7C3AED;
  --cyan: #0891B2;
  --sage: #4D7C0F;              /* success text */
  --sage-soft: #ECFCCB;
  --gold: #CA8A04;
  --grad: linear-gradient(93deg, #7C3AED 0%, #DB2777 52%, #0891B2 100%);
  --grad-btn: linear-gradient(93deg, #7C3AED, #EC4899);
  --serif: 'Plus Jakarta Sans', system-ui, sans-serif;
  --display: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --shadow-card: 0 1px 2px rgba(27,27,47,.05), 0 16px 40px -20px rgba(124,58,237,.18);
  --glow-pink: 0 0 22px rgba(219,39,119,.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* pastel gradient mesh */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 440px at 10% -8%, rgba(124,58,237,.12), transparent 65%),
    radial-gradient(680px 480px at 98% 6%, rgba(236,72,153,.10), transparent 65%),
    radial-gradient(720px 540px at 55% 115%, rgba(8,145,178,.08), transparent 65%);
}

main, header.site { position: relative; z-index: 1; }

/* ── Site header ─────────────────────────── */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark {
  font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }

.timer-chip {
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid rgba(124,58,237,.45);
  background: rgba(124,58,237,.08); color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.timer-chip.warning { border-color: var(--crimson); color: var(--crimson); box-shadow: var(--glow-pink); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { background: var(--crimson-soft); } }

/* ── Typography ─────────────────────────── */
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -.5px; }
h1 { font-size: clamp(34px, 5.4vw, 56px); font-weight: 800; }
h2 { font-size: 25px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.kicker {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--violet);
}

/* ── Cards & buttons ─────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.btn {
  font-family: var(--mono); font-size: 13.5px; font-weight: 700;
  letter-spacing: .04em; cursor: pointer;
  padding: 13px 28px; border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink); color: #fff;
  transition: transform .14s cubic-bezier(.2,.7,.3,1.4), box-shadow .14s, filter .14s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 24px -10px rgba(27,27,47,.4); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.crimson {
  background: var(--grad-btn); border-color: transparent; color: #fff;
  box-shadow: 0 10px 26px -10px rgba(236,72,153,.55);
}
.btn.ghost { background: transparent; border-color: var(--rule); color: var(--ink-soft); }
.btn.ghost:hover { background: var(--paper-deep); color: var(--ink); box-shadow: none; }
.btn.ctrl { padding: 8px 16px; font-size: 12.5px; }

/* ── Question elements ───────────────────── */
.qnum {
  font-family: var(--mono); font-weight: 700; font-size: 12.5px;
  color: var(--violet); min-width: 28px; display: inline-block;
}
.q-block { padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.q-block:last-child { border-bottom: 0; }

input[type="text"].gap {
  font-family: var(--mono); font-size: 15px;
  border: none; border-bottom: 2px solid var(--ink-faint);
  background: transparent; padding: 2px 8px; width: 180px;
  color: var(--violet); text-align: center; caret-color: var(--crimson);
}
input[type="text"].gap:focus { outline: none; border-bottom-color: var(--crimson); }

.opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 12px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.opt:hover { background: var(--paper-deep); }
.opt input { margin-top: 7px; accent-color: #EC4899; }

select.answer-select {
  font-family: var(--mono); font-size: 13.5px; padding: 8px 12px;
  border: 1.5px solid var(--rule); border-radius: 12px;
  background: #fff; color: var(--ink);
}
select.answer-select:focus { outline: 2px solid rgba(124,58,237,.45); }

textarea.essay {
  width: 100%; min-height: 380px; resize: vertical;
  font-family: var(--serif); font-size: 17px; line-height: 1.8;
  padding: 22px; border: 1.5px solid var(--rule); border-radius: 16px;
  background: #fff; color: var(--ink);
}
textarea.essay:focus { outline: none; border-color: rgba(124,58,237,.6); box-shadow: 0 0 0 4px rgba(124,58,237,.12); }

/* ── Band seal → gradient score ring ─────── */
.band-seal {
  width: 132px; height: 132px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box;
  border: 5px solid transparent;
  box-shadow: 0 12px 36px -12px rgba(124,58,237,.4);
  font-family: var(--display);
  animation: sealPop .6s cubic-bezier(.2,.9,.3,1.4) both;
}
@keyframes sealPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.band-seal .score {
  font-size: 44px; font-weight: 800; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.band-seal .label { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }

/* ── Result rows ─────────────────────────── */
.result-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--rule); font-size: 15px; }
.result-row .correct { color: var(--sage); font-weight: 700; }
.result-row .wrong { color: var(--crimson); font-weight: 700; }

.tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; border: 1px solid currentColor;
}
.tag.sage { color: var(--sage); background: var(--sage-soft); }
.tag.crimson { color: var(--crimson); background: var(--crimson-soft); }

/* ── Waveform + audio controls ───────────── */
.wave {
  height: 40px; width: 100%; display: block;
  color: var(--crimson);
}
.progress-track {
  height: 6px; border-radius: 999px; background: var(--rule);
  overflow: hidden; margin-top: 6px;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--grad); transition: width .4s linear;
}

.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.eq span { width: 3px; background: var(--crimson); border-radius: 2px; animation: eq .7s ease-in-out infinite alternate; }
.eq span:nth-child(2) { animation-delay: .2s; } .eq span:nth-child(3) { animation-delay: .4s; }
@keyframes eq { from { height: 4px; } to { height: 16px; } }

/* last-score badge on start gates */
.last-score {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid rgba(77,124,15,.35); background: var(--sage-soft); color: var(--sage);
}

/* reveal animation */
.reveal { animation: rise .55s cubic-bezier(.2,.8,.3,1.2) both; }
.reveal:nth-child(2) { animation-delay: .06s; } .reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .18s; } .reveal:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

::selection { background: #EC4899; color: #fff; }
