/* =========================================================================================
   Course selection v3 + "Which IELTS test are you taking?" (Cassi's approved designs, 17 Nov 2026)
   Templates: Layout/CourseSelectionPage.ss (.cs3) and Layout/CourseSelectionHolderPage.ss (.ts3),
   rendered only in staff preview mode (?preview=on) until approved. Values follow the build
   handovers' specification tables; colours are declared once as tokens below.
   ========================================================================================= */
@font-face {
  font-family: "Manrope";
  src: url("/fd-assets/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"),
       url("/fd-assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

.cs3, .ts3 {
  --s3-navy: #09234B;
  --s3-text: #F5F8FF;
  --s3-muted: #C8D8EE;
  --s3-line: #4C6992;
  --s3-blue: #2BB8FF;
  --s3-mint: #35EDC3;
  --s3-purple: #C286F4;
  --s3-silver: #B2B6BE;
  --s3-pale: #A8CCFF;
  --s3-pale-hover: #E5F1FF;
  --s3-card-a: #142B4C;
  --s3-card-b: #0B203D;
  --s3-card-line: #6386B4;
  --s3-focus: #FFFFFF;

  /* full-bleed: one continuous navy background across the window, inside the site's header/footer */
  width: 100vw; margin-inline: calc(50% - 50vw);
  background: linear-gradient(155deg, #081A35 10%, #102E55 55%, #0B2342 100%);
  color: var(--s3-text);
  font: 500 1rem/1.6 "Manrope", system-ui, sans-serif;
}
html:has(.cs3), html:has(.ts3) { overflow-x: clip; }
/* the page's own top/bottom padding would show light bands around the navy: keep only the fixed bar's height */
main.main-content:has(> .cs3), main.main-content:has(> .ts3) { padding-top: 0 !important; padding-bottom: 0 !important; }   /* the body already reserves the fixed bar */
@media (prefers-reduced-motion: no-preference) { html:has(.cs3) { scroll-behavior: smooth; } }
.cs3 :where(*, *::before, *::after), .ts3 :where(*, *::before, *::after) { box-sizing: border-box; }
.cs3 :where(p, h1, h2, h3, figure), .ts3 :where(p, h1, h2, h3) { margin: 0; }
.cs3 :where(a), .ts3 :where(a) { color: inherit; text-underline-offset: .22em; }
.cs3 :focus-visible, .ts3 :focus-visible { outline: 3px solid var(--s3-focus); outline-offset: 4px; }
.cs3 .cs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* headings: the site's global h1-h3 rules carry !important colour/font, so these are restated here, scoped */
html body :is(.cs3.cs3, .ts3.ts3) :is(h1, h2, h3) {
  font-family: "Manrope", system-ui, sans-serif !important; color: var(--s3-text) !important;
  line-height: 1.13 !important; letter-spacing: -.025em; text-transform: none !important; margin: 0 !important;
}

/* =============================== test selector (.ts3) =============================== */
.ts3-wrap { width: min(1180px, calc(100% - 80px)); margin-inline: auto; padding-block: clamp(30px, 5vw, 68px); }
html body .ts3.ts3 h1 { max-width: 24ch; font-size: clamp(2.15rem, 4.5vw, 3.75rem) !important; font-weight: 700 !important; text-wrap: balance; color: #FFFFFF !important; }
.ts3 .ts3-lead { margin-top: 14px; color: var(--s3-muted); font-size: clamp(1rem, 1.7vw, 1.19rem); max-width: 74ch; text-wrap: pretty; }
/* Thinner, taller cards (Cassi, 19 Nov 2026: "too wide"): two centred columns of at most 400px. */
.ts3-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 400px)); justify-content: start; /* left edge lines up with the text above (Cassi, 19 Nov 2026) */ gap: 24px; margin-top: 32px; }
.ts3-choice {
  display: flex; flex-direction: column; align-items: start; gap: 12px; min-width: 0;
  min-height: 360px; padding: clamp(24px, 3vw, 36px) clamp(20px, 2.6vw, 30px); border: 2px solid var(--s3-card-line); border-radius: 17px;
  background: linear-gradient(145deg, var(--s3-card-a), var(--s3-card-b));
  transition: transform 250ms ease-out, box-shadow 250ms ease-out, border-color 250ms ease-out;
}
html body .ts3.ts3 h2 { font-size: clamp(1.42rem, 2.6vw, 2rem) !important; font-weight: 700 !important; line-height: 1.18 !important; color: #FFFFFF !important; }
.ts3-choice p { color: var(--s3-muted); font-weight: 400; max-width: 44ch; }
.ts3-choice .ts3-action { margin-top: auto; }
.ts3 .ts3-action {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 46px; padding: 9px 16px;
  border-radius: 26px; background: var(--s3-pale); color: var(--s3-navy) !important; text-decoration: none !important;
  text-align: center; font-size: .92rem; line-height: 1.3; font-weight: 800;
}
.ts3 .ts3-action:hover { background: var(--s3-pale-hover); }
.ts3-arrow { flex: none; font-size: 1.25rem; line-height: 1; }
.ts3 .ts3-help { color: var(--s3-muted); margin-top: clamp(32px, 4vw, 48px); max-width: 86ch; font-size: .9rem; }
.ts3-help strong { display: block; margin-bottom: 4px; color: var(--s3-text); }
@media (hover: hover) and (pointer: fine) {
  .ts3-choice:hover { transform: translateY(-4px); box-shadow: 0 12px 24px #01091999; border-color: var(--s3-pale); }
}
@media (max-width: 730px) {
  .ts3-wrap { width: calc(100% - 32px); }
  .ts3-choices { grid-template-columns: minmax(0, 440px); gap: 14px; margin-top: 22px; }
  .ts3-choice { min-height: 0; }
  .ts3-choice .ts3-action { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .ts3-choice { transition: none; }
  .ts3-choice:hover { transform: none; box-shadow: none; }
}

/* =============================== course selection (.cs3) =============================== */
.cs3-wrap { width: min(1180px, calc(100% - 80px)); margin-inline: auto; padding: 18px 0 38px; }
.cs3-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--s3-line); border-radius: 25px; background: #081A35; }
.cs3 .cs3-switch a { display: flex; align-items: center; min-height: 44px; padding: 5px 15px; border-radius: 22px; text-decoration: none !important; font-weight: 800; font-size: .82rem; white-space: nowrap; color: var(--s3-text) !important; }
.cs3 .cs3-switch a[aria-current=page] { background: var(--s3-mint); color: var(--s3-navy) !important; }
.cs3 .cs3-switch a:hover:not([aria-current]) { background: #20436C; }

.cs3-hero { padding: 26px 0 32px; }
html body .cs3.cs3 h1 { font-size: clamp(2.25rem, 4.5vw, 3.75rem) !important; font-weight: 700 !important; max-width: 23ch; text-wrap: balance; }
.cs3-accent { color: #B7D8FF; }
.cs3 p { color: var(--s3-muted); }
.cs3 .cs3-lead { max-width: 65ch; margin-top: 14px; font-size: clamp(1rem, 1.7vw, 1.19rem); }
.cs3-test-name { white-space: nowrap; }
html body .cs3.cs3 .cs3-start { margin-top: 28px !important; font-size: 1.15rem !important; font-weight: 800 !important; }
.cs3-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 60px); margin-top: 12px; }
.cs3-path {
  display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 8px; justify-items: start;
  padding-top: 16px; border-top: 1px solid var(--s3-line);
  --path-ink: #E1E5ED;
}
.cs3-path + .cs3-path { --path-ink: #A8CCFF; }
html body .cs3.cs3 .cs3-path h3 { font-size: clamp(1.5rem, 3vw, 2rem) !important; font-weight: 700 !important; letter-spacing: normal; }
html body .cs3.cs3 .cs3-path h3 span { color: var(--path-ink) !important; }
.cs3 .cs3-path p { max-width: 48ch; margin-bottom: 4px; font-size: 1.0625rem; font-weight: 400; }

.cs3 .cs3-btn {
  display: inline-flex; align-items: center; justify-content: center; align-self: end; gap: .7em;
  min-height: 46px; padding: 9px 16px; border: 1px solid var(--accent, var(--s3-silver)); border-radius: 26px;
  text-align: center; text-decoration: none !important; font-size: .91rem; font-weight: 800; line-height: 1.3;
  color: var(--s3-navy) !important; background: var(--accent, var(--s3-silver)); transition: background-color .2s, color .2s;
}
.cs3 .cs3-btn:hover { background: #F5F8FF; }
.cs3 .cs3-btn--silver { background: linear-gradient(170deg, #F4F6FA, #D9DDE4 43%, #B2B6BE 78%, #CBD0D8); }
.cs3 .cs3-btn--silver:hover { background: #E8ECF2; }
.cs3 .cs3-btn--pale { --accent: var(--s3-pale); }
.cs3-btn__arrow { font-size: 1.25rem; line-height: 1; }

.cs3-diag {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); align-items: center;
  gap: 18px; scroll-margin-top: 90px; padding: clamp(18px, 3vw, 32px);
  background: radial-gradient(ellipse at 84% 80%, #1C527C, transparent 57%), #0A203E;
  border: 2px solid var(--s3-silver); border-radius: 18px;
}
/* body.mode-courses strips every <section>'s background and border with !important (signed-in pages),
   which erased the silver panel: restated here, scoped, so the panel matches the approved file. */
html body .cs3.cs3 .cs3-diag {
  background: radial-gradient(ellipse at 84% 80%, #1C527C, transparent 57%), #0A203E !important;
  border: 2px solid var(--s3-silver) !important;
}
.cs3-anchor { position: absolute; top: 0; scroll-margin-top: 90px; }
html body .cs3.cs3 .cs3-diag h2 { font-size: clamp(1.5rem, 2.7vw, 2.25rem) !important; font-weight: 800 !important; }
.cs3-diag__price { color: #E0E4EB; font-size: .69em; white-space: nowrap; }
/* General Training: the long title wraps, so the price is its own flex item and the "·" separator
   shows only while the price shares the title's line (cs3-diag.js sets data-inline). */
html body .cs3.cs3 .cs3-diag h2.cs3-diag__h--split { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .75em; row-gap: .25em; }
.cs3-diag__title { min-width: 0; }
.cs3-diag__h--split .cs3-diag__price { position: relative; }
.cs3-diag__h--split .cs3-diag__price[data-inline="true"]::before { content: "\00B7"; position: absolute; right: 100%; margin-right: .3em; }
.cs3-diag p { margin-top: 11px; }
.cs3-diag__actions { display: grid; justify-items: start; gap: 7px; margin-top: 15px; }
.cs3 .cs3-detail { font-size: .88rem; font-weight: 800; color: var(--s3-text) !important; text-decoration: underline; }
/* Every Explore link is permanently underlined (Cassi, 19 Nov 2026): the site's global link reset removed it. */
html body .cs3.cs3 a.cs3-detail { text-decoration: underline !important; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.cs3 .cs3-detail:hover { color: var(--s3-pale) !important; }
.cs3 .cs3-credit { font-size: .87rem; }
.cs3-report { display: grid; justify-items: center; min-width: 0; }
.cs3-report picture { display: block; width: min(100%, 440px); }
.cs3-report img { display: block; width: 100%; height: auto; }
.cs3-report figcaption { color: #E7EDF7; background: #081A35; border-radius: 18px; padding: 3px 10px; font-size: .73rem; font-weight: 800; }

.cs3-compare { padding: 28px 0 8px; scroll-margin-top: 80px; }
html body .cs3.cs3 .cs3-compare > h2 { font-size: clamp(1.65rem, 3vw, 2.5rem) !important; font-weight: 800 !important; margin-bottom: 15px !important; }
.cs3-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; scroll-margin-top: 80px; }
.cs3-card {
  --accent: var(--s3-blue);
  display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; min-width: 0;
  padding: 18px; border-radius: 17px; border: 3px solid var(--accent);
  background: linear-gradient(145deg, var(--s3-card-a), var(--s3-card-b));
  scroll-margin-top: 90px;
  transition: transform 250ms ease-out, box-shadow 250ms ease-out;
}
.cs3-card--xp { --accent: var(--s3-mint); }
.cs3-card--ma { --accent: var(--s3-purple); }
html body .cs3.cs3 .cs3-card h3 { color: var(--accent) !important; font-size: clamp(1.13rem, 1.8vw, 1.35rem) !important; font-weight: 800 !important; }
.cs3 .cs3-price { margin-top: 3px; font-size: 2.45rem; line-height: 1.25; color: var(--s3-text); font-weight: 800; letter-spacing: -.035em; }
.cs3 .cs3-price--status { font-size: 1rem; line-height: 2.2; color: var(--accent); letter-spacing: 0; }
.cs3 .cs3-intro { margin: 7px 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--s3-line); font-size: .9rem; }
.cs3-state { display: block; margin-top: 4px; color: var(--s3-text); font-weight: 700; }
.cs3-feature { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 7px; padding: 5px 0; color: #E5EEF9; font-size: .88rem; line-height: 1.4; }
.cs3-check { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: .75rem; font-weight: 800; background: var(--accent); color: var(--s3-navy); }
.cs3-feature strong { font-weight: 800; color: var(--s3-text); }
.cs3 .cs3-enrol { width: 100%; margin-top: 9px; }
.cs3-card .cs3-detail { justify-self: center; align-self: center; margin-top: 8px; text-align: center; }
@media (hover: hover) and (pointer: fine) {
  /* About 12px lift and a deeper shadow over 250ms ease-out, on hover-capable devices only; raised above its
     neighbours so the shadow is never clipped (Cassi, 19 Nov 2026). */
  html body .cs3.cs3 .cs3-card:hover { position: relative; z-index: 2; transform: translateY(-12px); box-shadow: 0 30px 52px #010919EB, 0 10px 20px #010919A6; }
}

/* THE DIAGNOSTIC PANEL ON ARRIVAL (Cassi, 19 Nov 2026): "Take the Writing Diagnostic" scrolled there too quietly.
   cs3-diag.js adds .is-arrived once the scroll lands: a brief silver ring and glow with a 1.01 swell, then back.
   transform and box-shadow only, so nothing around it moves. A gentle ring on hover / keyboard focus inside. */
.cs3-diag { transition: box-shadow 250ms ease-out; }
html body .cs3.cs3 .cs3-diag:hover, html body .cs3.cs3 .cs3-diag:focus-within { box-shadow: 0 0 0 2px #B2B6BE59, 0 14px 34px #01091966; }
@keyframes cs3-arrive {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 #E6E9EF00, 0 0 0 #D6DBE300; }
  30%  { transform: scale(1.01); box-shadow: 0 0 0 4px #E6E9EFB3, 0 0 42px #D6DBE380; }
  70%  { transform: scale(1.01); box-shadow: 0 0 0 4px #E6E9EF99, 0 0 36px #D6DBE366; }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 #E6E9EF00, 0 0 0 #D6DBE300; }
}
@keyframes cs3-arrive-still {
  0%, 75% { box-shadow: 0 0 0 4px #E6E9EFB3; }
  100%    { box-shadow: 0 0 0 0 #E6E9EF00; }
}
html body .cs3.cs3 .cs3-diag.is-arrived { animation: cs3-arrive 1.6s ease-out 1; }
/* Focus is moved here for keyboard users; the focus-within ring above is its visible indicator. */
html body .cs3.cs3 .cs3-diag:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  html body .cs3.cs3 .cs3-diag.is-arrived { animation: cs3-arrive-still 1.6s linear 1; }
  .cs3-diag { transition: none; }
}
@media (max-width: 970px) {
  .cs3-wrap { width: calc(100% - 48px); }
  .cs3-cards { column-gap: 10px; }
  .cs3-card { padding: 14px; }
}
@media (max-width: 730px) {
  .cs3-wrap { width: calc(100% - 32px); }
  .cs3 .cs3-switch a { padding-inline: 10px; font-size: .78rem; }
  .cs3-hero { padding: 20px 0 24px; }
  html body .cs3.cs3 h1 { text-wrap: wrap; }
  .cs3-paths, .cs3-diag, .cs3-cards { grid-template-columns: 1fr; gap: 14px; }
  .cs3-path { display: grid; grid-row: auto; grid-template-rows: auto; row-gap: 7px; padding-top: 12px; }
  .cs3-paths { margin-top: 19px; gap: 16px; }
  .cs3-report picture { width: min(100%, 300px); }
  .cs3-card { display: flex; flex-direction: column; }
  .cs3-card .cs3-btn { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .cs3 .cs3-btn, .cs3-card { transition: none; }
  html body .cs3.cs3 .cs3-card:hover { transform: none; box-shadow: 0 0 0 2px var(--accent); }
}

/* Writing Practice card (Cassi's 25 Nov 2026 handover): the Diagnostic panel's container, full width below the
   course row. Staff preview only until the Practice purchase route is approved. */
.cs3-practice { margin: 22px 0 8px; }
html body .cs3.cs3 .cs3-practice h2 { margin: 0; }
.cs3 .cs3-practice__price { margin-top: 4px; font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 800; color: #E0E4EB; }
.cs3 .cs3-practice__terms { margin-top: 2px; font-size: .9rem; font-weight: 700; color: #E0E4EB; }
.cs3 .cs3-practice__open { margin-top: 14px; font-size: 1.08rem; font-weight: 800; }
