/* ==========================================================================
   Cognivia Tutoring – sub-page layouts (book, checkout, thank-you)
   Loaded after styles.css. Builds on its tokens and sub-page components.
   ========================================================================== */

.sub-end { padding-bottom: clamp(88px, 8vw + 40px, 150px); }

.sub-lead { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; color: var(--ink); max-width: 62ch; }
.sub-lead .i { width: 22px; height: 22px; margin-top: 2px; color: var(--gold-deep); stroke-width: 2.2; }

.assure-title { margin: 0 0 18px; font-family: var(--font-sans); font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.assure-list li > div { min-width: 0; }
.assure-contact p { margin: 0; }
.assure-contact a[href^="tel"] { gap: 10px; }
.assure-contact a[href^="tel"] .i { width: 22px; height: 22px; color: var(--gold-deep); }

/* ---------- Book ---------- */
.book-intro .lead { max-width: 32em; }
.book-help {
  margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 18px; color: var(--ink-soft); max-width: 46ch;
}
.book-help a { overflow-wrap: anywhere; }
.book-help + .book-help { margin-top: 12px; padding-top: 0; border-top: 0; }
.book-choose { margin-top: clamp(44px, 5vw, 56px); }
.book-time { margin-top: clamp(56px, 6vw, 80px); }
.book-assure { margin-top: clamp(48px, 6vw, 72px); }
.segmented-lg button { font-size: 17px; }
/* Step 2: visible "Level" and "Where" labels above each toggle */
.control { display: grid; gap: 8px; }
.control-label { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink-soft); }
.book-choose .controls { gap: 18px 24px; align-items: end; }
.book-choose [data-lesson-controls] { margin-top: 40px; }
.o-per { font-family: var(--font-sans); font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); }
/* Compact option cards: icon beside the text, so step 2 and the calendar sit higher on the page */
.book-choose .option {
  display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; row-gap: 2px; align-content: start;
  min-height: 0; padding: 20px 52px 20px 20px;
}
.book-choose .o-icon { grid-row: 1 / span 3; margin: 0; }
.book-choose .o-title { padding-right: 0; }
.book-choose .o-price { font-size: 28px; padding-top: 8px; }
.book-choose .o-go { padding-top: 8px; }
/* Two-column cards: icon beside the title, details full width underneath so they don't wrap early */
@media (min-width: 561px) {
  .book-choose .option { padding: 20px 52px 22px 20px; }
  .book-choose .o-icon { grid-row: 1; }
  .book-choose .o-title { align-self: center; }
  .book-choose .o-meta, .book-choose .o-price, .book-choose .o-go { grid-column: 1 / -1; }
  .book-choose .o-meta { margin-top: 10px; }
}
.cal-meta { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 4px; }
.cal-meta p { margin-top: 10px; }
.cal-note { align-items: flex-start; }
.cal-note .i { margin-top: 3px; }
.after-title { margin: 40px 0 0; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.after-book { margin-top: 16px; }
.book-time > .note { max-width: 70ch; }

@media (min-width: 1024px) {
  .book-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; grid-template-rows: auto 1fr; column-gap: clamp(40px, 5vw, 72px); align-items: start; }
  .book-intro { grid-column: 1; grid-row: 1; }
  .book-choose { grid-column: 1; grid-row: 2; }
  .book-assure { grid-column: 2; grid-row: 1 / span 2; margin-top: 8px; }
  .book-time { grid-column: 1 / -1; grid-row: 3; }
  .book-choose .options { grid-template-columns: 1fr 1fr; }
}
/* Tablet: the panel sits under the calendar, photo beside the list */
@media (min-width: 640px) and (max-width: 1023px) {
  .book-assure { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 28px; align-items: stretch; }
  .book-assure .assure-photo { margin: 0; aspect-ratio: auto; min-height: 100%; }
  .book-assure .assure-photo img { object-position: 70% 50%; }
}
@media (max-width: 560px) {
  /* Compact option cards (base rules above): icon on the left, text on the right */
  .book-choose .option { padding: 20px 52px 20px 18px; }
  .controls { display: grid; }
  .controls .segmented { width: 100%; }
  .segmented-lg button { padding: 8px 14px; }
  .summary { padding: 18px 20px; }
  .summary strong { font-size: 30px; }
  .assure { padding: 24px 20px; }
}

/* ---------- Checkout ---------- */
.checkout-head { padding-bottom: 0; }
.checkout-head .segmented { display: inline-grid; margin-top: 32px; }
.pack-ticks { margin: 28px 0 0; font-size: 18px; }
.pack-line {
  display: flex; align-items: flex-start; gap: 12px; margin: 22px 0 0; padding: 16px 18px;
  border-radius: 16px; background: var(--tint); font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.5; max-width: none;
}
.pack-line .i { width: 22px; height: 22px; margin-top: 1px; color: var(--gold-deep); }
.tier-options .option { gap: 6px; }
.order .pay-methods { margin-top: 4px; font-weight: 600; color: #fff; }
.order .secure { margin-top: 16px; }
.order-assure span { min-width: 0; }
.order-assure a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.45); text-underline-offset: 3px; white-space: nowrap; }
.order .btn-light[aria-disabled="true"] { color: var(--ink); background: #fff; }
.next-chips { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.next-panel .next-steps + .next-steps { margin-top: 0; }

@media (max-width: 900px) {
  .has-sticky-total { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  html:has(body.has-sticky-total) { scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .sticky-total { min-height: 64px; transition: transform 0.5s var(--ease), visibility 0s linear 0s; }
  .sticky-total strong { font-family: var(--font-serif); font-weight: 600; font-size: 26px; margin-left: 6px; letter-spacing: -0.021em; }
  .sticky-total .sticky-go { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 16px; white-space: nowrap; }
  .sticky-total .i { width: 18px; height: 18px; }
  html.menu-open .sticky-total { visibility: hidden; }
  @media (max-width: 359px) {
    .sticky-total { padding-inline: 16px; }
    .sticky-total > span:first-child { white-space: nowrap; }
    .sticky-total strong { font-size: 23px; }
    .sticky-total .sticky-go { padding-inline: 12px; }
  }
  .sticky-total.is-hidden { transform: translateY(110%); visibility: hidden; transition: transform 0.5s var(--ease), visibility 0s linear 0.5s; }
}
@media (max-width: 560px) {
  .checkout-head .segmented { display: grid; width: 100%; }
  .checkout-head .segmented button, .panel .segmented-lg button { padding: 8px 12px; }
  .panel .segmented { display: grid; width: 100%; }
  .panel { padding: 22px 18px; }
  .panel-banner { aspect-ratio: 16 / 9; margin-bottom: 22px; }
  .tier-options .option { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 12px; padding: 20px; }
  .tier-options .o-title { flex: 1 1 60%; }
  .tier-options .o-meta { order: 3; flex-basis: 100%; }
  .tier-options .option { padding-right: 56px; }
  .tier-options .o-title { padding-right: 0; }
  .tier-options .o-price { margin-top: 0; padding-top: 0; order: 2; }
}

/* ---------- Thank-you ---------- */
.thanks-head { align-items: center; }
.thanks-copy .lead { max-width: 30em; }
.thanks-photo { box-shadow: 0 50px 90px -50px rgba(31, 43, 61, 0.45); }
.thanks-steps .panel-title { font-size: 22px; margin-bottom: 24px; }
.thanks-steps .next-steps a { overflow-wrap: anywhere; }
.thanks-cal .cal-note { margin: 0 0 4px; }
.thanks-cal .note { max-width: 70ch; }
@media (min-width: 900px) {
  .thanks-steps .next-steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
.thanks-contact {
  margin-top: clamp(48px, 6vw, 72px);
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px 24px; align-items: center;
}
.thanks-contact .trust-icon { margin: 0; width: 52px; height: 52px; }
.thanks-contact .assure-title { margin: 0 0 6px; }
.thanks-contact p { margin: 0; font-size: 18px; color: var(--ink-soft); }
.thanks-contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 900px) {
  .thanks-contact { grid-template-columns: auto 1fr; align-items: start; }
  .thanks-contact-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .thanks-contact { grid-template-columns: 1fr; }
  .thanks-contact-actions .btn { width: 100%; }
}

/* ---------- Shared helpers (thank-you, My lessons) ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.spinner {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid var(--line-strong); border-top-color: var(--gold-deep);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-line { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); max-width: none; }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: spin 1.8s linear infinite !important; }
}

/* ---------- Thank-you: 5-pack lessons added to My lessons ---------- */
.claim-panel { scroll-margin-top: calc(var(--nav-h) + 24px); }
.claim-ready { display: grid; grid-template-columns: auto 1fr; gap: 18px 22px; align-items: start; }
.claim-title {
  margin: 4px 0 0; font-family: var(--font-serif); font-weight: 600; color: var(--ink);
  font-size: clamp(28px, 1.6vw + 20px, 38px); line-height: 1.12; letter-spacing: -0.015em;
}
.claim-ready p:not(.claim-title) { margin: 12px 0 0; font-size: 18px; color: var(--ink-soft); }
.claim-ready .loading-line { margin-top: 18px; color: var(--ink); }
.claim-panel .btn-row { margin-top: 28px; }
.claim-error p { margin: 0 0 12px; font-size: 18px; color: var(--ink-soft); }
.claim-error p strong { color: var(--ink); }
@media (max-width: 560px) {
  .claim-ready { grid-template-columns: 1fr; }
  .claim-panel .btn-row .btn { width: 100%; white-space: normal; }
}

/* ==========================================================================
   Landing pages — added for /tmua-tutor/, /esat-tutor/, /ib-maths-tutor/,
   /tutoring-in-marylebone/ and /coursework-feedback/.
   Every rule below is new and prefixed .lp- so it cannot affect existing pages.
   ========================================================================== */

.lp-head .page-head-grid { align-items: start; }
.lp-head .lead { max-width: 34em; }
.lp-head .btn-row { margin-top: 32px; }
.lp-head .updated-line { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 16px; color: var(--muted); }
.lp-head .updated-line .i { width: 20px; height: 20px; color: var(--gold-deep); }
.lp-head .glance-title { margin: 0 0 18px; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink); }

/* Sticky in-page section nav (mirrors the policies page bar) */
.lp-bar {
  position: sticky; top: var(--nav-h); z-index: 20;
  background: rgba(251, 250, 247, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}
.lp-bar .policy-nav { margin: 0; padding-block: 12px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.lp-bar .policy-nav::-webkit-scrollbar { display: none; }
.lp-bar .chip { white-space: nowrap; }

.lp-body { padding-block: clamp(12px, 2vw, 24px) clamp(64px, 8vw, 110px); }
.lp-section { scroll-margin-top: calc(var(--nav-h) + 68px); }
.lp-section .lp-icon { margin-bottom: 18px; }
.lp-section > h2 + p { margin-top: 14px; }

/* Citation line under a section whose facts come from an official source */
.lp-source {
  margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 70ch;
}
.lp-source .i { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; color: var(--gold-deep); }

/* Two-column definition grid for test / syllabus facts */
.lp-facts { margin: 22px 0 0; display: grid; gap: 20px; }
.lp-facts div { display: grid; justify-items: start; align-content: start; gap: 8px; }
.lp-facts dt { display: inline-block; padding: 4px 14px; border-radius: 999px; background: var(--tint); font-size: 17px; font-weight: 700; color: var(--ink); }
.lp-facts dd { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink-soft); }
@media (min-width: 720px) { .lp-facts { grid-template-columns: 1fr 1fr; gap: 24px 32px; } }

/* Tables (paper structure, prices) — always scroll inside their own box */
.lp-tablewrap { overflow-x: auto; margin: 22px 0 0; }
.lp-table { border-collapse: collapse; width: 100%; min-width: 440px; font-size: 18px; }
.lp-table th, .lp-table td { text-align: left; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); line-height: 1.5; vertical-align: top; }
.lp-table th { color: var(--ink); font-weight: 700; }
.lp-table thead th { border-bottom: 1.5px solid var(--line-strong); font-size: 16px; letter-spacing: 0.02em; }
.lp-table tbody tr:last-child td, .lp-table tbody tr:last-child th { border-bottom: 0; }
.lp-table .lp-amount { font-family: var(--font-serif); font-weight: 600; font-size: 26px; letter-spacing: -0.021em; color: var(--ink); white-space: nowrap; }

/* Two-column tables whose second column is prose: stack them on phones rather
   than make the reader scroll a paragraph sideways. */
@media (max-width: 560px) {
  .lp-tablewrap:has(.lp-table-stack) { overflow-x: visible; }
  .lp-table-stack, .lp-table-stack tbody, .lp-table-stack tr, .lp-table-stack th, .lp-table-stack td { display: block; width: auto; min-width: 0; }
  .lp-table-stack thead { display: none; }
  .lp-table-stack tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .lp-table-stack tr:first-child { padding-top: 0; }
  .lp-table-stack tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .lp-table-stack th, .lp-table-stack td { padding: 0; border: 0; }
  .lp-table-stack th[scope="row"] { margin-bottom: 6px; }
}
/* Tables that genuinely still need a sideways scroll say so — above the table,
   not after it, so the hint is read before the clipped last column is seen.
   position: sticky pins it to the left edge while the table scrolls under it. */
@media (max-width: 639px) {
  .lp-tablewrap[data-scrollhint]::before {
    content: "Scroll the table sideways to see every column.";
    position: sticky; left: 0;
    display: block; margin-bottom: 12px; font-size: 15px; color: var(--muted);
  }
}

/* Highlighted single point (integrity statement, module coverage, practical summary) */
.lp-note {
  margin: 22px 0 0; padding: 18px 20px; border-radius: 18px; background: var(--tint);
  font-size: 18px; line-height: 1.6; color: var(--ink); max-width: 70ch;
}
.lp-note strong { color: var(--ink); }
.lp-note p { margin: 0; color: var(--ink) !important; font-size: 18px; }
.lp-note p + p { margin-top: 10px; }

/* The five-line practical summary shared by every landing page */
.lp-practical { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; max-width: 70ch; }
.lp-practical li { display: flex; gap: 14px; align-items: flex-start; font-size: 18px; line-height: 1.55; color: var(--ink-soft); }
.lp-practical .i { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--gold-deep); stroke-width: 2.2; }
.lp-practical strong { color: var(--ink); font-weight: 700; }

/* The single parent review, as visible text only (no rating, no markup) */
.lp-quote { margin: 22px 0 0; }
.lp-quote blockquote { margin: 0; }
.lp-quote blockquote p {
  margin: 0; font-family: var(--font-serif); font-weight: 500; color: var(--ink);
  font-size: clamp(22px, 1.2vw + 17px, 30px); line-height: 1.35; letter-spacing: -0.012em; max-width: 24em;
}
.lp-quote figcaption { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

/* "Where to go next" card at the foot of each landing page */
.lp-next { margin-top: 20px; padding: clamp(26px, 3.5vw, 44px); border-radius: var(--radius-lg); background: var(--tint); }
.lp-next h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.lp-next > p { margin: 8px 0 16px; font-size: 18px; color: var(--ink-soft); max-width: 60ch; }
.lp-next ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
@media (min-width: 720px) { .lp-next ul { grid-template-columns: 1fr 1fr; gap: 6px 32px; } }
.lp-next a { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; font-size: 18px; font-weight: 600; color: var(--ink); }
.lp-next a .i { flex: none; width: 20px; height: 20px; color: var(--gold-deep); transition: transform 0.5s var(--ease); }
.lp-next a:hover .i { transform: translateX(3px); }

/* Numbered ordering steps: keep a long email or URL from widening the whole list */
.lp-section .next-steps li { min-width: 0; }
.lp-section .next-steps strong, .lp-section .next-steps span { min-width: 0; overflow-wrap: anywhere; }

.lp-faq { margin-top: clamp(40px, 5vw, 64px); }
.lp-faq .section-head { margin-bottom: 28px; }
.lp-cta { padding-block: clamp(64px, 7vw, 120px) 0; }

@media (max-width: 639px) {
  .lp-bar { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  /* Wrap the chips rather than hiding them behind a sideways scroll */
  .lp-bar .policy-nav { flex-wrap: wrap; overflow-x: visible; padding-block: 4px 14px; }
  .lp-bar .chip { white-space: normal; }
  .lp-section { scroll-margin-top: 0; }
  .lp-head .btn-row .btn, .lp-section .btn-row .btn { width: 100%; white-space: normal; }
}
/* Short viewports (landscape phones, 200% zoom): don't stack a second sticky bar under the nav */
@media (max-height: 500px) {
  .lp-bar { position: static; }
  .lp-section { scroll-margin-top: 0; }
}

/* ---------------------------------------------------------------------------
   ESAT vs TMUA comparison table on /esat-tutor/.
   Three narrow columns whose meaning is carried by BOTH the row header and the
   column header, so the stacking treatment used for two-column prose tables
   would lose half the comparison. Instead the table is allowed to shrink below
   the shared 440px floor and wrap inside its cells, so nothing is clipped
   mid-word at 390px and below. The wrap keeps overflow-x:auto as a fallback.
   --------------------------------------------------------------------------- */
@media (max-width: 560px) {
  /* Auto layout, no shared 440px floor: the first column sizes itself to its
     longest row header so nothing breaks mid-word, and the two comparison
     columns wrap normally in what is left. */
  .lp-table-compare { min-width: 0; width: 100%; font-size: 16px; }
  .lp-table-compare th, .lp-table-compare td {
    padding: 10px 10px 10px 0; line-height: 1.4; hyphens: manual;
  }
  .lp-table-compare th[scope="row"] { white-space: nowrap; padding-right: 14px; }
  .lp-table-compare td { overflow-wrap: break-word; }
  .lp-table-compare th:last-child, .lp-table-compare td:last-child { padding-right: 0; }
  .lp-table-compare thead th { font-size: 14px; }
}
/* The comparison table only needs a sideways scroll on the very narrowest
   phones (below ~356px), where "Mathematics" no longer fits a third of the
   viewport. Above that it fits whole, so the inherited scroll hint is
   suppressed rather than telling the reader to scroll something that doesn't. */
@media (min-width: 356px) and (max-width: 639px) {
  .lp-tablewrap[data-scrollhint]:has(.lp-table-compare)::before { content: none; display: none; }
}

/* ---------------------------------------------------------------------------
   Buttons inside the landing-page prose sections.
   `.prose a` (styles.css) sets color: var(--ink) and wins on specificity over
   `.btn-primary`, which left the dark primary button rendering dark text on a
   dark fill — invisible on every one of these pages. Restore the button colours
   for anchors inside an .lp-section without touching the prose link style.
   --------------------------------------------------------------------------- */
.lp-section a.btn { font-weight: 700; text-decoration: none; overflow-wrap: normal; word-break: normal; }
.lp-section a.btn-primary { color: #fff; }
.lp-section a.btn-primary:hover { color: #fff; }
.lp-section a.btn-secondary { color: var(--ink); }

/* Price tables are only three columns and two of them are short. Shrink them to
   fit a phone rather than making a parent scroll sideways to see what it costs. */
@media (max-width: 639px) {
  .lp-table:not(.lp-table-stack):not(.lp-table-compare) { min-width: 0; font-size: 16px; }
  .lp-table:not(.lp-table-stack):not(.lp-table-compare) th,
  .lp-table:not(.lp-table-stack):not(.lp-table-compare) td { padding: 12px 10px 12px 0; }
  .lp-table:not(.lp-table-stack):not(.lp-table-compare) thead th { font-size: 14px; }
  .lp-table:not(.lp-table-stack):not(.lp-table-compare) .lp-amount { font-size: 21px; }
  .lp-tablewrap:has(.lp-table:not(.lp-table-stack):not(.lp-table-compare))[data-scrollhint]::before { content: none; }
}

/* ---------- Admissions test finder ---------- */
.finder-controls { display: grid; gap: 8px; max-width: 560px; margin: 22px 0 0; }
.finder-controls .control-label { margin-top: 10px; }
#finder-table tr[hidden] { display: none; }
#finder-table th[scope="row"] { min-width: 15em; }
/* ---------- Seasonal notice ---------- */
.notice-bar { background: var(--tint); border-bottom: 1px solid var(--line); font-size: 17px; line-height: 1.45; color: var(--ink); }
.notice-bar[hidden] { display: none; }
.notice-bar .container { padding-block: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.notice-bar strong { font-weight: 700; }
.notice-bar a { font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.finder-input { width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); font: inherit; font-size: 18px; color: var(--ink); }
.finder-input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#finder-table td:nth-child(3) { white-space: nowrap; }
