/* Shared app theme - the study side of the app (everything except the exam player,
   which deliberately keeps the official IELTS look). Tokens taken from the Figma design. */
:root {
  --ink:        #171717;
  --ink-2:      #404040;
  --ink-3:      #525252;
  --muted:      #737373;
  --line:       #e5e5e5;
  --surface:    #ffffff;
  --canvas:     #ffffff;   /* white ground throughout */

  /* Brand, pinned by the brief: IELTS red primary, purple secondary, white ground. */
  --red:        #e31837;
  --red-dark:   #b81129;
  --red-wash:   #fdeef1;
  --purple:     #5900c1;
  --purple-dark:#45009a;
  --purple-wash:#f3ecff;

  /* legacy names kept pointing at the new brand so no page is left on the old palette */
  --teal:       var(--red);
  --teal-soft:  var(--red-wash);
  --teal-wash:  var(--red-wash);
  --lavender:   var(--purple-wash);
  --yellow:     #fff4d6;
  --pink:       var(--red-wash);
  --crimson:    var(--red);

  /* Square, black-stroked, flat - the official IELTS house style, pinned by the brief.
     Radii are zeroed at the token so all twelve pages follow without touching each. */
  --r-sm: 0; --r-md: 0; --r-lg: 0; --r-pill: 0;
  --stroke: #171717;
  --shadow: none;
  --shadow-lg: none;   /* flat: contrast lifts things, not blur */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Raleway, "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 15px;            /* the body step; keeps unstyled text on the scale */
  color: var(--ink-2); background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { display: block; }

/* ---------- app shell: fixed rail + top bar ---------- */
.app { display: flex; min-height: 100vh; }

.rail {
  flex: 0 0 76px; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 26px;
  padding: 22px 0 20px; position: sticky; top: 0; height: 100vh;
}
.rail a {
  text-decoration: none; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; gap: 5px; width: 60px; padding: 4px 0; border-radius: 0;
}
.rail a span { font-size: 12px; font-weight: 600; letter-spacing: .1px; }
.rail a svg { width: 22px; height: 22px; fill: currentColor; }
.rail a:hover { color: var(--ink); background: #f5f5f5; }
.rail a.on { color: var(--red); }
.rail .spacer { flex: 1; }
.rail .badge {
  position: absolute; top: -5px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--crimson); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
}
.rail .iconbtn { position: relative; }

.main { flex: 1; min-width: 0; max-width: 100%; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 12px 26px; position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand b { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.brand b span { font-weight: 500; color: var(--ink-3); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.countdown {
  display: flex; align-items: baseline; gap: 8px; background: var(--teal-wash);
  border: 2px solid var(--stroke); border-radius: 0; padding: 6px 16px; cursor: pointer;
}
.countdown b { font-size: 15px; font-weight: 700; color: #046d61; }
.countdown span { font-size: 12px; color: #2f7d72; font-weight: 600; }

.ghostbtn {
  border: 2px solid var(--stroke); background: var(--surface); border-radius: 0;
  padding: 8px 16px; font: 700 12px Raleway, Arial; color: var(--ink); cursor: pointer; text-decoration: none;
}
.ghostbtn:hover { background: var(--ink); color: #fff; }

.page { padding: 24px 26px 70px; max-width: 1240px; width: 100%; }
h1.title { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
h2.sec { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }

/* ---------- shared surfaces ---------- */
.card { background: var(--surface); border: 2px solid var(--stroke); border-radius: 0; }
.pillbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 0; padding: 12px 22px; font: 700 15px Raleway, Arial;
  text-decoration: none; border: 2px solid var(--stroke); cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.pillbtn.light { background: #fff; color: var(--ink); }
.pillbtn.light:hover { background: var(--ink); color: #fff; }
.pillbtn.dark  { background: var(--ink); color: #fff; }
.pillbtn.dark:hover { background: #fff; color: var(--ink); }
.pillbtn.teal  { background: var(--teal); color: #fff; }
.pillbtn.teal:hover { background: var(--ink); color: #fff; }

@media (max-width: 820px) {
  /* the phone is the narrow constraint: nothing may set a min-width wider than it */
  html, body { max-width: 100%; overflow-x: hidden; }
  .countdown { padding: 5px 11px; gap: 6px; }
  .countdown b { font-size: 12px; }
  .countdown span { font-size: 12px; }
  .topbar .right { gap: 8px; }
  .rail {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: 58px; width: 100%;
    flex: none; flex-direction: row; justify-content: space-around; gap: 0;
    padding: 5px 4px; border-right: 0; border-top: 1px solid var(--line); z-index: 40;
  }
  .rail .spacer, .rail .deskonly { display: none; }
  .rail a { width: auto; flex: 1; gap: 2px; }
  .rail a span { font-size: 12px; }
  .app { flex-direction: column-reverse; }
  .page { padding: 16px 14px 86px; }
  .topbar { padding: 10px 14px; }
  .brand b { font-size: 19px; }
  .brand b span { display: none; }
  .brand img { height: 22px; }
  h1.title { font-size: 19px; }
  h2.sec { font-size: 19px; }
}

@media (max-width: 400px) {
  .countdown #cdClock { display: none; }
  .ghostbtn { padding: 6px 11px; font-size: 12px; }
}
