/*
 * Crack The UCAT - redesigned student pages: public home, Welcome, Home and
 * Account. Loaded after u2u.css and theme.css on pages opened with
 * pageOpen(..., ['themed' => true]). Colours come from the theme tokens so
 * light, dark and pastel all work.
 */

html.ctu-theme {
  --c-hero:        #15213A;   /* navy panels (stay navy in dark mode) */
  --c-hero-text:   #FFFFFF;
  --c-hero-2:      #C9D3E6;
  --c-eyebrow:     #7FD8DE;
  --c-teal-tint:   #E8F6F7;
  --c-strong-btn:  #15213A;   /* dark "Start →" buttons */
  --c-strong-text: #FFFFFF;
  --c-soft:        #F4F6F9;   /* small stat boxes */
  --c-track:       #E9EDF3;   /* progress bar track */
  --c-link-strong: #2448C9;
  --c-up:          #1D6A41;
  --c-down:        #A12A2A;
  --c-maths:       #6A3FC4;
}
html.ctu-theme[data-theme="dark"] {
  --c-hero: #14213A; --c-teal-tint: #10313A; --c-strong-btn: #E8ECF4; --c-strong-text: #0B1424;
  --c-soft: #0F1A2E; --c-track: #22355A; --c-link-strong: #8FB0F0; --c-up: #5DC08A; --c-down: #F07A7A; --c-maths: #B49AF0;
}
@media (prefers-color-scheme: dark) {
  html.ctu-theme:not([data-theme="light"]) {
    --c-hero: #14213A; --c-teal-tint: #10313A; --c-strong-btn: #E8ECF4; --c-strong-text: #0B1424;
    --c-soft: #0F1A2E; --c-track: #22355A; --c-link-strong: #8FB0F0; --c-up: #5DC08A; --c-down: #F07A7A; --c-maths: #B49AF0;
  }
}

/* ---- Page frame ---------------------------------------------------------- */
html.ctu-theme .ctu-main {
  flex: 1;
  min-width: 0;
  padding: 40px clamp(16px, 4vw, 56px) 64px;
  line-height: 1.5;
}
.ctu-page { display: flex; flex-direction: column; gap: 26px; max-width: 1180px; }
.ctu-page--narrow { max-width: 1080px; }
.ctu-page h1 { margin: 0; font-size: clamp(28px, 4vw, 34px); font-weight: 700; line-height: 1.2; font-family: var(--font-body); }
.ctu-page h2 { margin: 0; font-weight: 700; font-family: var(--font-body); }
.ctu-page p { margin: 0; }
.ctu-page ul { margin: 0; padding: 0; list-style: none; }
.ctu-page [hidden] { display: none !important; }
/* u2u.css styles every label dark and bold; on these pages labels follow the theme. */
html.ctu-theme .ctu-page label { color: inherit; margin-bottom: 0; }
.ctu-muted { color: var(--c-text-2); }
.ctu-small { font-size: 14px; }

.ctu-head { display: flex; flex-direction: column; gap: 10px; }
.ctu-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ctu-chip {
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: 20px;
  padding: 6px 14px; font-size: 14px; font-weight: 600;
}
.ctu-pill { background: var(--c-btn); color: var(--c-btn-text); font-weight: 700; padding: 4px 14px; border-radius: 20px; }

.ctu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; align-items: start; }
.ctu-grid--stretch { align-items: stretch; }
.ctu-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (min-width: 1000px) {
  .ctu-span2 { grid-column: span 2; }
}
.ctu-full { grid-column: 1 / -1; }

/* ---- Buttons and links ---------------------------------------------------- */
.ctu-btn, html.ctu-theme a.ctu-btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  background: var(--c-btn); color: var(--c-btn-text);
  border: 0; border-radius: 12px; text-decoration: none; cursor: pointer;
  font: 700 16px/1.2 var(--font-body); padding: 0 26px; min-height: 52px;
}
.ctu-btn:hover { filter: brightness(1.08); }
.ctu-btn--big { font-size: 18px; min-height: 58px; padding: 0 30px; }
.ctu-btn--strong, html.ctu-theme a.ctu-btn--strong { background: var(--c-strong-btn); color: var(--c-strong-text); }
.ctu-btn--outline, html.ctu-theme a.ctu-btn--outline { background: transparent; color: var(--c-text); border: 2px solid var(--c-text); }
.ctu-btn--small { font-size: 14px; min-height: 40px; padding: 0 16px; border-radius: 10px; }
.ctu-btn:focus-visible, .ctu-card-link:focus-visible, .ctu-link:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }
.ctu-link, html.ctu-theme a.ctu-link { font-weight: 700; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; color: var(--c-link); }
html.ctu-theme .ctu-hero a.ctu-link { color: var(--c-hero-text); font-size: 15px; font-weight: 600; }
.ctu-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ctu-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--c-link); font-weight: 700; cursor: pointer; min-height: 44px; }

/* ---- Panels ---------------------------------------------------------------- */
.ctu-hero {
  background: var(--c-hero); color: var(--c-hero-text);
  border-radius: 18px; padding: clamp(22px, 4vw, 32px);
  display: flex; flex-direction: column; gap: 18px;
}
.ctu-hero h1, .ctu-hero h2 { color: var(--c-hero-text); }
.ctu-hero h2 { font-size: 26px; }
.ctu-hero p { color: var(--c-hero-2); font-size: 15px; line-height: 1.5; }
.ctu-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-eyebrow); }
.ctu-eyebrow--teal { color: #0A5F67; font-weight: 700; }
html.ctu-theme[data-theme="dark"] .ctu-eyebrow--teal { color: var(--c-teal); }
@media (prefers-color-scheme: dark) { html.ctu-theme:not([data-theme="light"]) .ctu-eyebrow--teal { color: var(--c-teal); } }

.ctu-box {
  background: var(--c-card); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.ctu-box h2 { font-size: 17px; }
.ctu-box--big { border: 2px solid var(--c-text); border-radius: 20px; padding: clamp(22px, 3vw, 30px); gap: 18px; }
.ctu-box--big h2 { font-size: clamp(22px, 3vw, 28px); }
.ctu-box--teal { background: var(--c-teal-tint); border: 3px solid var(--c-btn); border-radius: 20px; padding: 26px; gap: 14px; }
.ctu-box--teal h2 { font-size: 22px; }
.ctu-box__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.ctu-ticks { display: flex; flex-direction: column; gap: 10px; font-size: 15px; flex: 1; }
.ctu-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ctu-price strong { font-size: 30px; font-weight: 700; }

/* Big number + caption */
.ctu-figure { display: flex; align-items: baseline; gap: 8px; }
.ctu-figure strong { font-size: 30px; font-weight: 700; }
.ctu-figure span { font-size: 15px; color: var(--c-text-2); }

.ctu-bar { height: 10px; background: var(--c-track); border-radius: 5px; overflow: hidden; }
.ctu-bar > span { display: block; height: 10px; border-radius: 5px; background: var(--c-correct); }
.ctu-bar--navy > span { background: var(--c-chart-frame); }
.ctu-hero .ctu-bar { background: #22355A; }
.ctu-hero .ctu-bar > span { background: var(--c-teal); }

.ctu-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ctu-stat { background: var(--c-soft); border-radius: 10px; padding: 12px; }
.ctu-stat strong { display: block; font-size: 24px; font-weight: 700; }
.ctu-stat span { font-size: 12px; color: var(--c-text-2); }
.ctu-split { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; border-top: 1px solid var(--c-border); padding-top: 12px; }
.ctu-up { color: var(--c-up); font-weight: 600; }
.ctu-down { color: var(--c-down); font-weight: 600; }

/* ---- Subtest cards ------------------------------------------------------- */
.ctu-subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.ctu-sub, html.ctu-theme a.ctu-sub, button.ctu-sub {
  text-decoration: none; color: var(--c-text); background: var(--c-card); text-align: left;
  border: 1px solid var(--c-border); border-top: 8px solid var(--sub, var(--c-border)); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; font: inherit; cursor: pointer; width: 100%;
}
.ctu-sub--small { border-top-width: 6px; padding: 16px; gap: 6px; min-height: 0; }
.ctu-sub__name { font-size: 17px; font-weight: 700; }
.ctu-sub--small .ctu-sub__name { font-size: 15px; }
.ctu-sub__blurb { font-size: 13px; color: var(--c-text-2); line-height: 1.45; flex: 1; }
.ctu-sub__go { align-self: flex-start; background: var(--c-strong-btn); color: var(--c-strong-text); font-size: 14px; font-weight: 700; padding: 10px 16px; border-radius: 10px; }
.ctu-sub__go--text { background: none; padding: 0; color: var(--c-btn); }
.ctu-sub:hover { border-color: var(--sub, var(--c-sel-border)); }
.ctu-sub:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }
.ctu-sub__cost { font-size: 12px; color: var(--c-text-2); }

.ctu-mix, html.ctu-theme a.ctu-mix {
  text-decoration: none; color: var(--c-text); background: var(--c-sel-fill);
  border: 2px solid var(--c-sel-border); border-radius: 14px; padding: 18px 22px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.ctu-mix strong { display: block; font-size: 17px; }
.ctu-mix:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }

.ctu-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.ctu-card-link, html.ctu-theme a.ctu-card-link {
  text-decoration: none; color: var(--c-text); background: var(--c-card);
  border: 1px solid var(--c-border); border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.ctu-card-link strong { font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctu-card-link span { font-size: 14px; color: var(--c-text-2); line-height: 1.45; }
.ctu-card-link .ctu-go { color: var(--c-link-strong); font-weight: 700; }
.ctu-card-link--maths { border: 2px solid var(--c-maths); }
.ctu-free { background: var(--c-maths); color: #FFFFFF; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 10px; }
html.ctu-theme[data-theme="dark"] .ctu-free { color: #0B1424; }
@media (prefers-color-scheme: dark) { html.ctu-theme:not([data-theme="light"]) .ctu-free { color: #0B1424; } }

.ctu-section { display: flex; flex-direction: column; gap: 14px; }
.ctu-section > h2 { font-size: 22px; }
.ctu-section h3 { margin: 8px 0 0; font-size: 16px; font-weight: 700; color: var(--c-text-2); }

/* ---- Timing choice (Welcome) -------------------------------------------- */
.ctu-choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.ctu-choices legend { font-size: 14px; font-weight: 600; color: var(--c-text-2); margin-bottom: 8px; padding: 0; }
.ctu-choice { position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  padding: 12px 16px; min-height: 64px; max-width: 300px; border-radius: 12px; font-size: 15px;
  border: 2px solid var(--c-border); font-weight: 400; }
.ctu-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ctu-choice span { font-size: 13px; opacity: .85; }
.ctu-choice:has(input:checked) { background: var(--c-sel-fill); border-color: var(--c-sel-border); }
.ctu-choice:has(input:focus-visible) { outline: 3px solid var(--c-teal); outline-offset: 2px; }

/* ---- First-name box (Welcome) ------------------------------------------- */
.ctu-namebox { background: var(--c-card); border: 2px solid var(--c-btn); border-radius: 16px; padding: 18px 22px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ctu-namebox > div { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; }
.ctu-namebox label { font-size: 16px; font-weight: 700; }
.ctu-input, html.ctu-theme .ctu-input {
  font: 400 17px/1.2 var(--font-body); padding: 0 14px; min-height: 48px; width: 100%;
  border: 2px solid var(--c-border); border-radius: 10px; color: var(--c-text); background: var(--c-card);
}
.ctu-input:focus { outline: none; border-color: var(--c-sel-border); }

/* ---- Read-this-first ----------------------------------------------------- */
.ctu-details { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 16px; padding: 10px 22px; }
.ctu-details summary { font-size: 16px; font-weight: 700; min-height: 48px; display: flex; align-items: center; cursor: pointer; }
.ctu-details ul { list-style: disc !important; padding: 0 0 16px 18px !important; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }

/* ---- Notices --------------------------------------------------------------- */
.ctu-note { background: var(--c-teal-tint); border-radius: 12px; padding: 14px 18px; font-size: 15px; }
.ctu-status { font-size: 14px; color: var(--c-text-2); min-height: 1.2em; }

/* ---- Public home: plans -------------------------------------------------- */
.ctu-landing-hero h1 { font-size: clamp(32px, 4.5vw, 46px); line-height: 1.15; }
.ctu-landing-hero p { font-size: 18px; line-height: 1.55; max-width: 600px; }
.ctu-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ctu-tags span { border: 2px solid; border-radius: 16px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.ctu-tags .t-vr { border-color: #5F8BE6; } .ctu-tags .t-dm { border-color: #D9A057; }
.ctu-tags .t-qr { border-color: #9478DD; } .ctu-tags .t-sjt { border-color: #5DB384; }
.ctu-badge-white { background: #FFFFFF; color: #15213A; font-size: 15px; font-weight: 700; padding: 8px 14px; border-radius: 20px; }
.ctu-strip { background: var(--c-card); border: 3px solid var(--c-btn); border-radius: 20px; padding: 28px 32px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.ctu-strip h2 { font-size: 26px; }
.ctu-strip p { font-size: 16px; color: var(--c-text-2); margin-top: 8px; }
.ctu-strip--maths, html.ctu-theme a.ctu-strip--maths { border: 2px solid var(--c-maths); border-radius: 18px; padding: 20px 26px; text-decoration: none; color: var(--c-text); }
.ctu-strip--maths strong { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.ctu-strip--maths .ctu-go { background: var(--c-maths); color: #FFFFFF; font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 10px; }

.ctu-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; align-items: stretch; }
.ctu-plan { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.ctu-plan--rec { background: var(--c-teal-tint); border: 3px solid var(--c-btn); }
.ctu-plan__name { font-size: 17px; font-weight: 700; }
.ctu-plan__tag { background: var(--c-track); color: var(--c-text); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; }
.ctu-plan--rec .ctu-plan__tag { background: var(--c-btn); color: var(--c-btn-text); }
.ctu-plan .ctu-price strong { font-size: 36px; }
.ctu-plan__line { font-size: 15px; font-weight: 600; }
.ctu-plan p { font-size: 14px; color: var(--c-text-2); line-height: 1.5; flex: 1; }
.ctu-plan .ctu-btn { min-height: 50px; font-size: 15px; padding: 0 12px; }

/* ---- Account ---------------------------------------------------------------- */
.ctu-plan-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.ctu-plan-dates span { display: block; font-size: 13px; color: var(--c-hero-2); }
.ctu-plan-dates strong { font-size: 18px; font-weight: 600; }
.ctu-active { background: #2E7D4F; color: #FFFFFF; font-size: 14px; font-weight: 700; padding: 6px 14px; border-radius: 20px; }
.ctu-inactive { background: #4A5875; color: #FFFFFF; font-size: 14px; font-weight: 700; padding: 6px 14px; border-radius: 20px; }
.ctu-fields { display: flex; flex-direction: column; gap: 12px; }
.ctu-field span { display: block; font-size: 13px; color: var(--c-text-2); }
.ctu-field strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ctu-form { display: flex; flex-direction: column; gap: 12px; }
.ctu-form label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.ctu-form .ctu-input { font-size: 16px; min-height: 44px; }
.ctu-receipts li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--c-border); font-size: 15px; }
.ctu-receipts li:first-child { border-top: 0; }
.ctu-foot-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---- Supervisor panels on themed pages --------------------------------- */
html.ctu-theme .sv-panel { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 16px; box-shadow: none; padding: 22px; margin: 0; }
html.ctu-theme .sv-panel .section-title { font-family: var(--font-body); font-size: 17px; font-weight: 700; color: var(--c-text); margin: 0 0 6px; }
html.ctu-theme .sv-panel p.sv-note, html.ctu-theme .sv-pending, html.ctu-theme .sv-student-stats { color: var(--c-text-2); }
html.ctu-theme .sv-student-name, html.ctu-theme .sv-student-stats strong { color: var(--c-text); }
html.ctu-theme .sv-list > li, html.ctu-theme .sv-assignments li { border-color: var(--c-border); }
html.ctu-theme .sv-btn { background: transparent; color: var(--c-btn); border-color: var(--c-btn); }
html.ctu-theme .sv-btn-primary { background: var(--c-btn); color: var(--c-btn-text); border-color: transparent; }
html.ctu-theme .sv-btn-quiet { color: var(--c-text-2); border-color: var(--c-border); }
html.ctu-theme .sv-btn-danger { color: var(--c-incorrect); border-color: var(--c-incorrect); background: transparent; }
html.ctu-theme .sv-invite input, html.ctu-theme .sv-assign select { background: var(--c-card); color: var(--c-text); border-color: var(--c-border); }
html.ctu-theme .sv-notice { margin: 0; }

@media (max-width: 600px) {
  html.ctu-theme .ctu-main { padding-top: 24px; }
  .ctu-strip, .ctu-strip--maths { padding: 20px; }
}

/* ---- Practice chooser (practice.php) ----------------------------------- */
.ctu-steps { display: flex; flex-direction: column; gap: 24px; }
.ctu-step__title { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.ctu-step__num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-text); color: var(--c-card); font-size: 16px; font-weight: 700; }
.ctu-choice--wide { flex: 1 1 240px; max-width: none; }
.ctu-choice--wide strong { font-size: 17px; }
.ctu-choice:has(input:checked) strong::after { content: " ✓"; color: var(--c-sel-border); }
.ctu-choices--small { align-items: center; }
.ctu-choices--small legend { float: left; margin: 0 8px 0 0; line-height: 40px; }
.ctu-choice--small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.ctu-pill--ok { background: var(--c-sel-fill); color: var(--c-sel-border); border: 2px solid var(--c-sel-border); }
button.ctu-mix { font: inherit; width: 100%; text-align: left; cursor: pointer; }
.ctu-mix--big { padding: 24px 26px; }
.ctu-mix--big strong { font-size: 22px; margin: 4px 0; }
.ctu-mix:hover { border-color: var(--c-text); }
.ctu-subwrap { display: flex; flex-direction: column; gap: 4px; }
.ctu-subwrap .ctu-sub { flex: 1; }
.ctu-upsell { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px 20px;
  border: 1px dashed var(--c-border); border-radius: 14px; background: var(--c-card); font-size: 15px; }
.ctu-upsell > span { flex: 1 1 240px; }
