/* Pathway package ladder (ADR 0012 D1). Themed through the existing --mx / --bs tokens, so it
   follows light/dark automatically. Used by Components/Shared/PathwayOffer.razor. */

/* Destination switcher: a centred segmented control. */
.pw-tabstrip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 2.25rem;
    padding: .3rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--bs-card-bg);
    box-shadow: var(--mx-elevation-sm);
}

.pw-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 999px;
    padding: .5rem 1.05rem;
    font-size: .92rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #5c6f66);
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.pw-tab:hover { color: var(--bs-body-color); background: rgba(var(--bs-primary-rgb), .06); }
.pw-tab.is-active {
    color: var(--mx-on-signal, #fff);
    background: var(--mx-nav-signal, var(--bs-primary));
}
.pw-tab.is-active:hover { background: var(--mx-nav-signal, var(--bs-primary)); color: var(--mx-on-signal, #fff); }
.pw-tab:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }

.pw-destination[hidden] { display: none; }

/* Dashboard course "Extend / Renew" chip-link (ADR 0012 D3). Rides the dashboard tag look but reads
   as an action. Defined here to avoid touching the dashboard stylesheet. */
.mdash-course-tag--renew {
    text-decoration: none;
    color: var(--mx-action-on);
    background: var(--mx-action);
    border-color: transparent;
    font-weight: 700;
}
.mdash-course-tag--renew:hover { background: var(--mx-action-hover); color: var(--mx-action-on); }

.pw-destination {
    margin-bottom: 2.5rem;
}

.pw-dest-title {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--bs-body-color);
}

/* One column of content: every step's heading, its cards and the bundles share the same two edges, the width
   the programme page's card sections use - so nothing floats in the middle of an empty row. */
.pw-offer {
    display: flex;
    flex-direction: column;
    gap: 2.75rem;
    width: 100%;
    max-width: 1040px;
    margin-inline: auto;
}

.pw-step,
.pw-bundles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pw-step-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .35rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: .6rem;
}

.pw-step-title {
    margin: 0;
    font-family: var(--mx-font-display);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--mx-nav-heading, var(--bs-body-color));
}

.pw-step.is-highlight .pw-step-title::after {
    content: "Your exam";
    display: inline-block;
    margin-left: .6rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-family: var(--mx-font-sans);
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mx-nav-signal-ink, var(--bs-primary));
    background: var(--mx-nav-signal-tint, rgba(var(--bs-primary-rgb), .08));
    vertical-align: middle;
}

.pw-regulator {
    font-size: .82rem;
    color: var(--bs-secondary-color, #5c6f66);
    text-decoration: none;
}
.pw-regulator:hover { text-decoration: underline; }

/* Cards fill the row evenly (two or three across); a lone package becomes one wide card instead of a narrow
   one stranded in the middle. */
.pw-tiers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}
.pw-tiers--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pw-tiers--single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) {
    .pw-tiers--n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .pw-tiers, .pw-tiers--n2, .pw-tiers--n3 { grid-template-columns: minmax(0, 1fr); }
}

.pw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--mx-nav-card-radius, var(--mx-radius));
    background: var(--bs-card-bg);
    box-shadow: var(--mx-nav-card-shadow, var(--mx-elevation-sm));
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.pw-card-head { display: flex; flex-direction: column; gap: .45rem; }
.pw-card-body { display: flex; flex-direction: column; gap: .8rem; }

/* The lone package, laid out across: name and price | what it includes (two columns) | the button. */
.pw-tiers--single .pw-card {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr) auto;
    align-items: center;
    gap: 1.25rem 2.25rem;
    padding: 1.6rem 1.9rem;
}
.pw-tiers--single .pw-feats { display: block; columns: 2; column-gap: 2rem; }
.pw-tiers--single .pw-feats li { break-inside: avoid; margin-bottom: .25rem; }
.pw-tiers--single .pw-cta { margin-top: 0; align-self: center; }
@media (max-width: 860px) {
    .pw-tiers--single .pw-card { display: flex; align-items: stretch; }
    .pw-tiers--single .pw-cta { align-self: stretch; }
    .pw-tiers--single .pw-feats { columns: 1; }
}
.pw-card:hover { transform: translateY(-2px); box-shadow: var(--mx-elevation); border-color: rgba(var(--bs-primary-rgb), .4); }

.pw-card.is-featured {
    border-color: rgba(var(--bs-primary-rgb), .55);
    box-shadow: 0 1px 0 rgba(var(--bs-primary-rgb), .12), 0 12px 30px -18px rgba(var(--bs-primary-rgb), .55);
}

.pw-card--bundle {
    border-color: rgba(var(--bs-primary-rgb), .35);
    background:
        linear-gradient(180deg, rgba(var(--bs-primary-rgb), .05), transparent 55%),
        var(--bs-card-bg);
}

.pw-badge {
    align-self: flex-start;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15rem .5rem;
    border-radius: 999px;
    color: var(--mx-action-on);
    background: var(--mx-action);
}

.pw-card-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--mx-nav-heading, var(--bs-body-color));
}

.pw-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem;
}

.pw-was {
    text-decoration: line-through;
    /* The muted ink, not a half-transparent one: the struck price still carries information (the saving), and
       opacity .55 left it at 2.9:1. */
    color: var(--bs-secondary-color);
    font-size: .95rem;
}

.pw-amount {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--bs-body-color);
    font-variant-numeric: tabular-nums;
}

.pw-price--soon .pw-amount,
.pw-price--soon {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #5c6f66);
}

.pw-window {
    font-size: .82rem;
    color: var(--bs-secondary-color, #5c6f66);
}

.pw-save {
    align-self: flex-start;
    font-size: .8rem;
    font-weight: 700;
    color: #157347;
    background: rgba(21, 115, 71, .12);
    padding: .15rem .55rem;
    border-radius: 999px;
}
/* Dark twin. The app switches on data-bs-theme (theme-medax.css); an earlier copy of this
   keyed on data-theme with an unguarded :not() line, which matched ALWAYS - so the pale
   dark-mode green showed on white too. */
@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) .pw-save { color: #6ee7a8; background: rgba(110, 231, 168, .12); }
}
:root[data-bs-theme="dark"] .pw-save { color: #6ee7a8; background: rgba(110, 231, 168, .12); }

.pw-feats {
    margin: 0;
    padding: 0 0 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-size: .85rem;
    color: var(--bs-body-color);
}
.pw-feats li { margin: 0; }

/* Computed student count on a card (ADR 0012 D9). */
.pw-students {
    font-size: .78rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #5c6f66);
}

/* Ultimate feature-gated tools hub (ADR 0012 Phase 6). */
.tools { padding-block: 1.5rem 3rem; }
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 720px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
.tools-card {
    display: flex; flex-direction: column; gap: .5rem;
    padding: 1.1rem 1.2rem; border: 1px solid var(--bs-border-color);
    /* Paper, not --bs-body-bg: that is the page ground, so the cards vanished into it. */
    border-radius: var(--mx-radius, 12px); background: var(--mx-paper-bg, var(--bs-card-bg));
    box-shadow: var(--mx-elevation-sm);
}
.tools-card .btn { align-self: flex-start; }
.tools-card.is-on { border-color: rgba(var(--bs-primary-rgb), .5); }
.tools-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.tools-desc { font-size: .88rem; color: var(--bs-secondary-color, #5c6f66); margin: 0; flex: 1; }
.tools-state { font-size: .8rem; font-weight: 600; margin-top: auto; }
.tools-state--soon { color: #1a7f4b; }
@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) .tools-state--soon { color: #6ee7a8; }
}
:root[data-bs-theme="dark"] .tools-state--soon { color: #6ee7a8; }
.tools-state--locked { color: var(--bs-secondary-color, #5c6f66); }

/* Custom-test blueprint (ADR 0012 Phase 6). */
.ct-topics { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0; }
@media (min-width: 640px) { .ct-topics { grid-template-columns: 1fr 1fr; } }
.ct-group { border: 1px solid var(--bs-border-color); border-radius: var(--mx-radius-sm, 10px); padding: .6rem .9rem; margin: 0; }
.ct-group-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color, #5c6f66); padding: 0 .25rem; width: auto; }
.ct-topic { display: flex; align-items: center; gap: .5rem; padding: .2rem .25rem; cursor: pointer; }
.ct-topic span:nth-child(2) { flex: 1; }
.ct-topic-count { font-size: .75rem; color: var(--bs-secondary-color, #5c6f66); font-variant-numeric: tabular-nums; }
.ct-controls { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-top: .5rem; }
.ct-hint { display: block; font-size: .78rem; color: var(--bs-secondary-color, #5c6f66); margin-top: .35rem; }

/* Study planner timeline (ADR 0012 Phase 6). */
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.plan-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.plan-item { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; padding: .75rem .9rem; border: 1px solid var(--bs-border-color); border-radius: var(--mx-radius-sm, 10px); background: var(--bs-body-bg); border-left: 3px solid var(--bs-border-color); }
.plan-item--practice { border-left-color: var(--mx-action, #3b5bdb); }
.plan-item--mock { border-left-color: #c0392b; }
.plan-item--review { border-left-color: #d08700; }
.plan-item--exam { border-left-color: #1a7f4b; }
.plan-date { font-size: .8rem; font-weight: 700; color: var(--bs-secondary-color, #5c6f66); font-variant-numeric: tabular-nums; padding-top: .1rem; }
.plan-title { font-weight: 600; }
.plan-detail { font-size: .85rem; color: var(--bs-secondary-color, #5c6f66); }
.plan-link { display: inline-block; margin-top: .3rem; font-size: .82rem; font-weight: 600; }

/* Tutor support thread (ADR 0012 Phase 6). */
/* The thread and the composer sit on one paper panel; they were loose on the page ground,
   and the tutor's bubbles were painted the ground colour, so they had no edge at all. */
.tutor-thread {
  display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0 0;
  padding: 1.1rem 1.2rem; min-height: 9rem;
  background: var(--mx-nav-card); border: 1px solid var(--bs-border-color);
  border-radius: 14px 14px 0 0; box-shadow: var(--mx-elevation-sm);
}
.tutor-thread > .text-muted { margin: auto; }
.tutor-msg { max-width: 82%; padding: .6rem .8rem; border-radius: var(--mx-radius, 12px); border: 1px solid var(--bs-border-color); }
.tutor-msg--me { align-self: flex-end; background: rgba(var(--bs-primary-rgb), .08); border-color: rgba(var(--bs-primary-rgb), .3); }
.tutor-msg--staff { align-self: flex-start; background: var(--bs-tertiary-bg); }
.tutor-who { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color, #5c6f66); }
.tutor-text { white-space: pre-wrap; margin: .15rem 0; }
.tutor-when { font-size: .7rem; color: var(--bs-secondary-color, #5c6f66); }
.tutor-compose {
  padding: 1rem 1.2rem 1.1rem; display: flex; flex-direction: column; align-items: flex-start;
  background: var(--mx-nav-card); border: 1px solid var(--bs-border-color); border-top: 0;
  border-radius: 0 0 14px 14px; box-shadow: var(--mx-elevation-sm);
}
.tutor-compose .form-control { width: 100%; }

/* "Includes …" line on a mixed package that carries components (ADR 0012 D4). */
.pw-includes {
    font-size: .8rem;
    color: var(--bs-secondary-color, #5c6f66);
    padding: .3rem .5rem;
    border-radius: var(--mx-radius-sm, 8px);
    background: rgba(var(--bs-primary-rgb), .06);
}

/* The card names the package, so the button only says what it does - the old "Choose UK NMC OSCE Preparation →"
   wrapped its arrow onto a second line. The full name stays in aria-label for screen readers. */
.pw-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    white-space: nowrap;
    padding: .75rem 1.2rem;
    border-radius: var(--mx-nav-radius, var(--mx-radius-sm));
    font-weight: 600;
    text-decoration: none;
    color: var(--mx-action-on);
    background: var(--mx-action);
    border: 1px solid transparent;
}
.pw-cta:hover { background: var(--mx-action-hover); color: var(--mx-action-on); }

.pw-cta--ghost {
    color: var(--bs-body-color);
    background: transparent;
    border-color: var(--bs-border-color);
}
.pw-cta--ghost:hover { background: rgba(var(--bs-primary-rgb), .06); color: var(--bs-body-color); }

/* Content-language chip on a tier card (ADR 0012 D12). English is left unlabelled. */
.pw-lang {
    display: inline-block;
    margin-left: .4rem;
    padding: .05rem .45rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--bs-body-color);
    background: rgba(var(--bs-primary-rgb), .1);
    vertical-align: middle;
}

/* What sets the packages apart (ADR 0012 D2), inside each card and in the same order across cards, so they
   compare side by side. */
.pw-compare {
    list-style: none;
    margin: 0;
    padding: .75rem 0 0;
    border-top: 1px solid var(--bs-border-color);
    display: grid;
    gap: .3rem;
    font-size: .84rem;
    color: var(--bs-body-color);
}
.pw-compare li { display: flex; align-items: baseline; gap: .5rem; }
.pw-compare-mark { width: 1rem; flex: 0 0 auto; font-weight: 700; text-align: center; }
.pw-compare .is-yes .pw-compare-mark { color: var(--mx-nav-verified, #1a7f4b); }
.pw-compare .is-no { color: var(--bs-secondary-color); }

/* Build-your-own bundle (ADR 0012 D5) */
.pbuild-head { margin-bottom: 1.9rem; }
.pbuild-head h1 { font-family: var(--mx-font-serif); font-size: clamp(1.9rem, 3.5vw, 2.5rem); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .5rem; color: var(--bs-heading-color); }
.pbuild-lede { color: var(--bs-secondary-color, #5b6270); max-width: 54ch; font-size: 1.02rem; line-height: 1.55; margin: 0 0 .85rem; }
.pbuild-head .mkt-back { font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--mx-accent-ink, var(--bs-link-color)); }
.pbuild-head .mkt-back:hover { text-decoration: underline; }

.pbuild-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; }
@media (min-width: 820px) { .pbuild-grid { grid-template-columns: 1.7fr 1fr; align-items: start; } }

.pbuild-picks { display: flex; flex-direction: column; gap: .65rem; }
.pbuild-card {
    display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left;
    padding: .95rem 1.1rem; border: 1px solid var(--bs-border-color); border-radius: var(--mx-radius, 12px);
    background: var(--bs-card-bg); color: var(--bs-body-color); cursor: pointer;
    box-shadow: var(--mx-elevation-sm); transition: border-color .12s ease, box-shadow .12s ease, transform .1s ease;
}
.pbuild-card:hover { border-color: rgba(var(--bs-primary-rgb), .5); transform: translateY(-1px); box-shadow: var(--mx-elevation); }
.pbuild-card.is-on { border-color: var(--mx-nav-signal, var(--bs-primary)); box-shadow: inset 0 0 0 1px var(--mx-nav-signal, var(--bs-primary)), var(--mx-elevation-sm); }
.pbuild-check {
    width: 1.35rem; height: 1.35rem; flex: none; border-radius: 6px; border: 1.5px solid var(--bs-border-color);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .82rem;
    background: transparent; transition: background .12s ease, border-color .12s ease;
}
.pbuild-card.is-on .pbuild-check { border-color: var(--mx-nav-signal, var(--bs-primary)); background: var(--mx-nav-signal, var(--bs-primary)); }
.pbuild-card-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pbuild-card-title { font-weight: 700; color: var(--bs-heading-color); }
.pbuild-card-cat { font-size: .78rem; color: var(--bs-secondary-color, #5b6270); }
.pbuild-card-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--bs-body-color); }

.pbuild-summary {
    border: 1px solid var(--bs-border-color); border-radius: var(--mx-radius, 14px);
    padding: 1.4rem; background: var(--bs-card-bg); box-shadow: var(--mx-elevation); position: sticky; top: 1.5rem;
}
.pbuild-summary h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 1rem; color: var(--bs-heading-color); }
.pbuild-empty { color: var(--bs-secondary-color, #5b6270); font-size: .92rem; }
.pbuild-lines {
    list-style: none; margin: 0 0 1rem; padding: 0 0 1rem; border-bottom: 1px solid var(--bs-border-color);
    display: flex; flex-direction: column; gap: .5rem;
}
.pbuild-lines li { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.pbuild-lines li span:first-child { color: var(--bs-body-color); }
.pbuild-lines li span:last-child { font-variant-numeric: tabular-nums; color: var(--bs-secondary-color, #5b6270); }
.pbuild-lines li.is-redundant span:first-child { color: var(--bs-tertiary-color, #8a8f98); text-decoration: line-through; }
.pbuild-lines li.is-redundant span:last-child { color: var(--mx-teal-ink, #0c7a62); font-weight: 600; }
.pbuild-total { display: flex; flex-direction: column; gap: .45rem; }
.pbuild-sub, .pbuild-save, .pbuild-pay { display: flex; justify-content: space-between; }
.pbuild-sub, .pbuild-save { font-size: .92rem; }
.pbuild-sub span:last-child, .pbuild-save span:last-child, .pbuild-pay span:last-child { font-variant-numeric: tabular-nums; }
.pbuild-save { color: #157347; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-bs-theme="light"]) .pbuild-save { color: #6ee7a8; } }
:root[data-bs-theme="dark"] .pbuild-save { color: #6ee7a8; }
.pbuild-pay { font-weight: 800; font-size: 1.2rem; color: var(--bs-heading-color); margin-top: .2rem; }
.pbuild-window { font-size: .78rem; color: var(--bs-secondary-color, #5b6270); margin-top: .1rem; }
.pbuild-curated {
    margin-top: 1rem; padding: .85rem .95rem; border-radius: var(--mx-radius-sm, 10px);
    background: rgba(var(--bs-primary-rgb), .07); border: 1px solid rgba(var(--bs-primary-rgb), .18);
    font-size: .86rem; line-height: 1.45;
}
.pbuild-curated a { display: inline-block; margin-top: .3rem; font-weight: 600; }
.pbuild-note { font-size: .88rem; color: var(--bs-secondary-color, #5b6270); }
.pbuild-cta { margin-top: 1.2rem; width: 100%; }
.pbuild-err { margin-top: .5rem; color: var(--bs-danger, #c0392b); font-size: .85rem; }
.pbuild-comingsoon {
    max-width: 40rem; padding: 1.4rem 1.5rem; border: 1px solid var(--bs-border-color); border-radius: var(--mx-radius, 14px);
    background: var(--bs-card-bg); box-shadow: var(--mx-elevation-sm); color: var(--bs-secondary-color, #5b6270);
}

/* ADR 0041 D3: "Or buy a single mock" - a quiet list under an exam's package cards. */
.pw-mocks { margin-top: 1rem; padding: .9rem 1rem; border: 1px dashed var(--bs-border-color); border-radius: var(--mx-radius, .6rem); }
.pw-mocks-title { margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bs-secondary-color); }
.pw-mocks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pw-mock { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-top: 1px solid var(--bs-border-color); }
.pw-mock:first-child { border-top: 0; }
.pw-mock-link { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--bs-body-color); }
.pw-mock-link:hover .pw-mock-name { color: var(--bs-primary); text-decoration: underline; }
.pw-mock-name { font-weight: 600; font-size: .95rem; }
.pw-mock-meta { font-size: .8rem; color: var(--bs-secondary-color); }
.pw-mock-price { flex: 0 0 auto; font-weight: 700; color: var(--bs-heading-color); }
