/* ==========================================================================
   PHASE 03 — Checkout and payment result
   --------------------------------------------------------------------------
   Self-contained so it can be appended without disturbing the Phase 02 layer.
   Everything is token-driven (colours, radii, shadows) and mobile-first.
   ========================================================================== */

.pay-grid {
    display: grid;
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
}

.pay-main { min-width: 0; }

.pay-list {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.pay-list > li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: .96rem;
    line-height: 1.55;
    color: var(--muted-strong);
}

.pay-list__icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--emerald-500);
}

.pay-steps {
    list-style: none;
    counter-reset: pay-step;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.pay-steps > li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.pay-steps__num {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--emerald-50);
    color: var(--emerald-700);
    font-weight: 700;
    font-size: .86rem;
    border: 1px solid rgba(14, 159, 110, .22);
}

.pay-steps strong {
    display: block;
    color: var(--ink);
    font-size: .97rem;
    margin-bottom: 3px;
}

.pay-steps span span,
.pay-steps li > div > span {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.6;
}

.pay-reassure {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 30px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: var(--surface-navy-tint);
    border: 1px solid var(--line);
}

.pay-reassure__icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--navy-700);
}

.pay-reassure p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--muted-strong);
}

/* --- Checkout card ------------------------------------------------------- */

.pay-card-wrap { min-width: 0; }

.pay-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.pay-card__head {
    padding: clamp(22px, 3vw, 30px);
    background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
    color: #fff;
}

.pay-card__label {
    display: inline-block;
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, .72);
}

.pay-card__amount {
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    margin-top: 8px;
}

.pay-card__note {
    margin: 8px 0 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .72);
    line-height: 1.5;
}

.pay-card__body {
    padding: clamp(22px, 3vw, 30px);
}

.pay-form { display: grid; gap: 16px; }

.pay-form .field { margin: 0; }

.pay-form__foot {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 4px 0 0;
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.5;
}

.pay-form__foot-icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--emerald-600);
}

.pay-card__trust {
    display: grid;
    gap: 9px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.pay-card__trust > div {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .84rem;
    color: var(--muted);
}

.pay-card__trust svg { color: var(--emerald-600); flex: 0 0 auto; }

.pay-fineprint {
    margin: 16px 2px 0;
    font-size: .78rem;
    line-height: 1.6;
    color: var(--muted);
}

.pay-fineprint a { color: var(--navy-700); text-decoration: underline; }

/* Inline success panel (replaces the form after a confirmed payment) */

.pay-success {
    text-align: center;
    padding: 8px 4px 4px;
    outline: none;
}

.pay-success__badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ECFDF3;
    color: #027A48;
    border: 1px solid #A6F4C5;
}

.pay-success__title {
    margin: 0 0 8px;
    font-size: 1.22rem;
    font-weight: 750;
    color: var(--ink);
}

.pay-success__text {
    margin: 0 auto 18px;
    max-width: 42ch;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--muted-strong);
}

.pay-success__meta {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    text-align: left;
    font-size: .86rem;
}

.pay-success__meta > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pay-success__meta dt { color: var(--muted); }

.pay-success__meta dd {
    margin: 0;
    font-weight: 650;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* A resolved lookup replaces the prompt rather than stacking under it */
.pay-result__state.is-resolved [data-lookup-badge],
.pay-result__state.is-resolved [data-lookup-intro] { display: none; }

/* --- Payment result page ------------------------------------------------- */

.pay-result { padding-block: clamp(36px, 6vw, 72px); }

.pay-result__inner {
    display: grid;
    place-items: center;
}

.pay-result__card {
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(26px, 4vw, 44px);
    text-align: center;
}

.pay-result__state { outline: none; }

.pay-result__badge {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-navy-tint);
    color: var(--navy-700);
    border: 1px solid var(--line);
}

.pay-result__badge--ok {
    background: #ECFDF3;
    border-color: #A6F4C5;
    color: #027A48;
}

.pay-result__badge--warn {
    background: #FFFAEB;
    border-color: #FEDF89;
    color: #B54708;
}

.pay-result__title {
    margin: 0 0 10px;
    font-size: clamp(1.3rem, 3.2vw, 1.6rem);
    font-weight: 760;
    letter-spacing: -.015em;
    color: var(--ink);
}

.pay-result__text {
    margin: 0 auto 16px;
    max-width: 48ch;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--muted-strong);
}

.pay-result__meta {
    display: grid;
    gap: 10px;
    margin: 20px 0;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    text-align: left;
    font-size: .88rem;
}

.pay-result__meta > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pay-result__meta dt { color: var(--muted); }

.pay-result__meta dd {
    margin: 0;
    font-weight: 650;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.pay-result__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}

.pay-result__foot {
    margin: 22px 0 0;
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.6;
}

.pay-result__foot a { color: var(--navy-700); text-decoration: underline; }

.pay-result__spinner {
    width: 42px;
    height: 42px;
    margin: 4px auto 18px;
    border: 3px solid var(--line);
    border-top-color: var(--emerald-500);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.pay-result__card .form { text-align: left; margin-top: 8px; }

@media (min-width: 941px) {
    .pay-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .85fr); }
    .pay-card-wrap { position: sticky; top: calc(var(--header-h, 76px) + 18px); }
}

@media (max-width: 720px) {
    .pay-result__actions { flex-direction: column; }
    .pay-result__actions .btn { width: 100%; }
}

/* ==========================================================================
   PHASE 04 — Paid registration form
   ========================================================================== */

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.page-hero--compact .page-hero__title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }

.reg { padding-block: clamp(26px, 4vw, 46px); }

.reg__grid {
    display: grid;
    gap: clamp(24px, 3.5vw, 44px);
    align-items: start;
}

.reg__main { min-width: 0; }
.reg__aside { min-width: 0; display: grid; gap: 18px; }

/* --- Step rail ------------------------------------------------------------ */

.reg-rail {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 6px;
    margin: 0 0 20px;
    padding: 0;
}

.reg-rail__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px 7px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: .82rem;
    color: var(--muted);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.reg-rail__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-alt);
    color: var(--muted-strong);
    font-size: .74rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.reg-rail__item.is-active {
    border-color: var(--navy-800);
    background: var(--navy-900);
    color: #fff;
}

.reg-rail__item.is-active .reg-rail__num { background: rgba(255,255,255,.16); color: #fff; }

.reg-rail__item.is-done {
    border-color: rgba(14, 159, 110, .35);
    color: var(--emerald-700);
    background: var(--emerald-50);
}

.reg-rail__item.is-done .reg-rail__num { background: var(--emerald-500); color: #fff; }

/* --- Steps ---------------------------------------------------------------- */

.js .reg-step { display: none; }
.js .reg-step.is-active { display: block; animation: fade-in .25s var(--ease); }

.reg-step {
    border: 0;
    padding: 0;
    margin: 0;
}

.reg-step__legend:focus { outline: none; }
.reg-step__legend:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 4px; }

.reg-step__legend {
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -.01em;
    color: var(--ink);
    padding: 0;
    margin-bottom: 4px;
}

.reg-step__intro {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.6;
    max-width: 62ch;
}

.reg-step .field,
.reg-step .form__row { margin-bottom: 16px; }

.reg-form > .reg-step { margin-bottom: 4px; }

/* --- Upload --------------------------------------------------------------- */

.upload { position: relative; }

.upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.upload__zone {
    display: grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
    padding: clamp(24px, 4vw, 38px) 22px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.upload__zone:hover,
.upload__zone:focus-within,
.upload__zone.is-dragging {
    border-color: var(--emerald-500);
    background: var(--emerald-50);
}

.upload__zone.is-dragging { transform: scale(1.005); }

.upload__input:focus-visible + .upload__zone { outline: 2px solid var(--navy-700); outline-offset: 2px; }

.upload__zone.is-filled {
    border-style: solid;
    border-color: rgba(14, 159, 110, .4);
    background: #F4FCF8;
}

.upload__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--emerald-600);
    margin-bottom: 4px;
}

.upload__title { font-weight: 650; color: var(--ink); font-size: .95rem; }
.upload__meta { font-size: .82rem; color: var(--muted); }

.upload__file {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: .88rem;
}

.upload__file-icon { color: var(--navy-700); display: inline-flex; }

.upload__file-name {
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.upload__file-size { color: var(--muted); font-variant-numeric: tabular-nums; }

.upload__remove {
    margin-left: auto;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted-strong);
    cursor: pointer;
}

.upload__remove:hover { border-color: var(--danger); color: var(--danger); }

.upload__status {
    margin: 10px 0 0;
    font-size: .85rem;
    color: var(--emerald-700);
    min-height: 1.2em;
}

.upload__status.is-error { color: var(--danger); font-weight: 600; }

.upload__repeat { margin: 10px 0 0; font-size: .85rem; color: var(--warning); }

/* --- Review summary ------------------------------------------------------- */

.reg-summary {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.reg-summary__title {
    margin: 0 0 12px;
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
}

.reg-summary__list {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    gap: 7px 16px;
    margin: 0 0 14px;
    font-size: .88rem;
}

.reg-summary__list dt { color: var(--muted); }

.reg-summary__list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.reg-consents { display: grid; gap: 14px; margin: 4px 0 22px; }

.reg-consents .checkbox a {
    color: var(--navy-700);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reg-consents .checkbox a:hover { color: var(--emerald-700); }
.reg-consents .field-error { margin-left: 30px; }

/* --- Submit + progress ---------------------------------------------------- */

.reg-submit { display: grid; gap: 12px; }

.reg-submit__note {
    margin: 0;
    font-size: .78rem;
    line-height: 1.6;
    color: var(--muted);
}

.reg-submit__note a { color: var(--navy-700); text-decoration: underline; }

.progress {
    position: relative;
    height: 34px;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    overflow: hidden;
}

.progress__bar {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, var(--emerald-600), var(--emerald-400));
    transition: width .2s linear;
}

.progress__label {
    position: relative;
    display: grid;
    place-items: center;
    height: 100%;
    font-size: .8rem;
    font-weight: 650;
    color: var(--navy-900);
    mix-blend-mode: multiply;
}

/* --- Step navigation ------------------------------------------------------ */

.reg-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.js .reg-nav { display: flex; }
:root:not(.js) .reg-nav { display: none; }

.reg-nav__back-icon { transform: rotate(180deg); }

/* --- Aside ---------------------------------------------------------------- */

.reg-receipt,
.reg-next {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.reg-receipt__label {
    display: block;
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 12px;
}

.reg-receipt__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    font-size: .88rem;
    border-top: 1px solid var(--line);
}

.reg-receipt__row:first-of-type { border-top: 0; }

.reg-receipt__row > span:first-child { color: var(--muted); }

.reg-receipt__row strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
    overflow-wrap: anywhere;
}

.reg-next__title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 750;
    color: var(--ink);
}

.reg-next__list {
    list-style: none;
    counter-reset: reg-next;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    gap: 12px;
}

.reg-next__list > li {
    counter-increment: reg-next;
    display: grid;
    gap: 2px;
    padding-left: 30px;
    position: relative;
    font-size: .87rem;
    line-height: 1.55;
}

.reg-next__list > li::before {
    content: counter(reg-next);
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-navy-tint);
    color: var(--navy-800);
    font-size: .7rem;
    font-weight: 700;
}

.reg-next__list strong { color: var(--ink); font-weight: 650; }
.reg-next__list span { color: var(--muted); }

.reg-next__foot {
    margin: 0;
    font-size: .8rem;
    line-height: 1.6;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

/* --- Gate (invalid / expired / used link) --------------------------------- */

.reg-gate { padding-block: clamp(48px, 9vw, 96px); }

.reg-gate__inner { display: grid; place-items: center; }

.reg-gate .empty-state { max-width: 620px; }

.reg-gate__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.reg-gate__foot {
    margin: 18px 0 0;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--muted);
}

/* --- Confirmation page ---------------------------------------------------- */

.reg-done { padding-block: clamp(40px, 7vw, 80px); }

.reg-done__inner { display: grid; place-items: center; }

.reg-done__card {
    width: 100%;
    max-width: 660px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(26px, 4vw, 44px);
    text-align: center;
}

.reg-done__badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ECFDF3;
    border: 1px solid #A6F4C5;
    color: #027A48;
}

.reg-done__badge--muted {
    background: var(--surface-navy-tint);
    border-color: var(--line);
    color: var(--navy-700);
}

.reg-done__title {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    font-weight: 780;
    letter-spacing: -.02em;
    color: var(--ink);
}

.reg-done__text {
    margin: 0 auto 18px;
    max-width: 52ch;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--muted-strong);
}

.reg-done__text--muted { font-size: .86rem; color: var(--muted); }

.reg-done__id {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    margin: 0 0 20px;
    border-radius: var(--radius);
    border: 1px dashed rgba(14, 159, 110, .45);
    background: #F4FCF8;
}

.reg-done__id-label {
    flex: 1 1 100%;
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--emerald-700);
}

.reg-done__id-value {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--navy-900);
    font-variant-numeric: tabular-nums;
}

.reg-done__id-note {
    flex: 1 1 100%;
    font-size: .78rem;
    color: var(--emerald-700);
    min-height: 1em;
}

.reg-done__checklist {
    list-style: none;
    display: grid;
    gap: 9px;
    margin: 0 auto 20px;
    padding: 0;
    max-width: 44ch;
    text-align: left;
    font-size: .89rem;
    color: var(--muted-strong);
}

.reg-done__checklist > li { display: flex; gap: 9px; align-items: flex-start; }
.reg-done__checklist svg { color: var(--emerald-500); flex: 0 0 auto; margin-top: 2px; }

.reg-done__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 6px;
}

@media (min-width: 941px) {
    .reg__grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); }
    .reg__aside { position: sticky; top: calc(var(--header-h, 76px) + 18px); }
}

@media (max-width: 720px) {
    .reg-done__actions { flex-direction: column; }
    .reg-done__actions .btn { width: 100%; }
    .reg-rail__label { display: none; }
    .reg-rail__item { padding: 6px; }
    .reg-rail__item.is-active .reg-rail__label { display: inline; }
    .reg-summary__list { grid-template-columns: 1fr; gap: 4px; }
    .reg-summary__list dd { margin-bottom: 8px; }
}

/* ==========================================================================
   PHASE 04 — Error pages (404 / 500)
   ========================================================================== */

.error-page { padding-block: clamp(44px, 8vw, 88px); }

.error-page__inner { display: grid; place-items: center; }

.error-page__card {
    width: 100%;
    max-width: 660px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(26px, 4vw, 44px);
    text-align: center;
}

.error-page__code {
    margin: 0 0 6px;
    font-size: clamp(2.6rem, 7vw, 3.6rem);
    font-weight: 850;
    letter-spacing: -.03em;
    line-height: 1;
    color: var(--navy-100, #e4e9f2);
}

.error-page__badge {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #FFF4ED;
    border: 1px solid #FFD9C2;
    color: #B54708;
}

.error-page__title {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 780;
    letter-spacing: -.02em;
    color: var(--ink);
}

.error-page__text {
    margin: 0 auto 16px;
    max-width: 54ch;
    font-size: .94rem;
    line-height: 1.65;
    color: var(--muted-strong);
}

.error-page__text--muted { font-size: .85rem; color: var(--muted); }

.error-page__ref {
    display: inline-block;
    margin: 0 0 18px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    font-size: .82rem;
    color: var(--muted);
}

.error-page__ref strong {
    color: var(--ink);
    letter-spacing: .08em;
    font-variant-numeric: tabular-nums;
}

.error-page__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}

.error-page__subtitle {
    margin: 0 0 10px;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.error-page__list {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: .9rem;
}

.error-page__list a {
    color: var(--navy-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.error-page__list a:hover { color: var(--emerald-700); }

@media (max-width: 720px) {
    .error-page__links { flex-direction: column; }
    .error-page__links .btn { width: 100%; }
}

/* ==========================================================================
   PHASE 05 — Candidate portal
   ========================================================================== */

/* --- Sign-in gate (login + verify) --------------------------------------- */

.portal-gate { padding-block: clamp(32px, 6vw, 64px); }

.portal-gate__inner {
    display: grid;
    gap: clamp(22px, 3vw, 36px);
    align-items: start;
}

.portal-gate__card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(24px, 4vw, 40px);
    min-width: 0;
}

.portal-gate__badge {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-navy-tint);
    border: 1px solid var(--line);
    color: var(--navy-700);
}

.portal-gate__title {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 780;
    letter-spacing: -.02em;
    color: var(--ink);
}

.portal-gate__text {
    margin: 0 0 16px;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--muted-strong);
    max-width: 58ch;
}

.portal-gate__text--muted { font-size: .87rem; color: var(--muted); }

.portal-form { margin: 18px 0 4px; display: grid; gap: 16px; }

.portal-gate__facts {
    list-style: none;
    display: grid;
    gap: 9px;
    margin: 22px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    font-size: .85rem;
    color: var(--muted);
}

.portal-gate__facts > li { display: flex; gap: 9px; align-items: flex-start; }
.portal-gate__facts svg { color: var(--emerald-600); flex: 0 0 auto; margin-top: 1px; }
.portal-gate__facts a { color: var(--navy-700); text-decoration: underline; }

.portal-gate__aside {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
}

.portal-gate__aside-title {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.portal-gate__aside-text {
    margin: 0 0 14px;
    font-size: .88rem;
    line-height: 1.65;
    color: var(--muted-strong);
}

.portal-gate__aside-text--muted { font-size: .82rem; color: var(--muted); }
.portal-gate__aside-text a { color: var(--navy-700); text-decoration: underline; }

.portal-gate__list {
    margin: 0 0 16px;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    font-size: .87rem;
    line-height: 1.6;
    color: var(--muted-strong);
}

.portal-gate__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.portal-gate__inline-form { display: contents; }

.input--code {
    font-size: 1.4rem;
    letter-spacing: .42em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    padding-block: 14px;
    text-indent: .42em;   /* balance the trailing letter-spacing */
}

/* --- Portal header band --------------------------------------------------- */

.portal-head {
    background: var(--navy-900);
    color: #fff;
    padding-block: clamp(26px, 4vw, 40px);
}

.portal-head--compact { padding-block: clamp(20px, 3vw, 30px); }

.portal-head__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.portal-head__eyebrow {
    margin: 0 0 6px;
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,.62);
}

.portal-head__title {
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}

.portal-head__meta {
    margin: 0;
    font-size: .88rem;
    color: rgba(255,255,255,.72);
}

.portal-head__meta strong { color: #fff; font-variant-numeric: tabular-nums; }
.portal-head__dot { margin: 0 .45em; opacity: .5; }

.portal-head__side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.portal-head__side .btn--ghost {
    border-color: rgba(255,255,255,.28);
    color: #fff;
    background: transparent;
}

.portal-head__side .btn--ghost:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.5);
}

.portal-head__logout { margin: 0; }

.portal-head .breadcrumb,
.portal-head .breadcrumb a { color: rgba(255,255,255,.7); }
.portal-head .breadcrumb [aria-current="page"] { color: #fff; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .01em;
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
}

.status-badge--emerald { background: rgba(14,159,110,.24); border-color: rgba(14,159,110,.5); }
.status-badge--amber   { background: rgba(245,158,11,.22); border-color: rgba(245,158,11,.45); }
.status-badge--grey    { background: rgba(255,255,255,.12); }

/* --- Portal layout -------------------------------------------------------- */

.portal { padding-block: clamp(26px, 4vw, 46px); }

.portal__grid {
    display: grid;
    gap: clamp(20px, 3vw, 32px);
    align-items: start;
}

.portal__main,
.portal__aside,
.portal__single { min-width: 0; display: grid; gap: 18px; }

.portal__intro {
    margin: 0 0 2px;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--muted-strong);
    max-width: 68ch;
}

.portal__footnote {
    margin: 4px 0 0;
    font-size: .84rem;
    line-height: 1.65;
    color: var(--muted);
}

.portal__footnote a { color: var(--navy-700); text-decoration: underline; }

/* --- Cards ---------------------------------------------------------------- */

.portal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(18px, 2.6vw, 26px);
}

.portal-card--tight { padding: clamp(16px, 2.2vw, 22px); }

.portal-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.portal-card__title {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 750;
    letter-spacing: -.01em;
    color: var(--ink);
}

.portal-card__meta {
    font-size: .78rem;
    font-weight: 650;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.portal-card__link {
    font-size: .84rem;
    font-weight: 650;
    color: var(--navy-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.portal-card__lead {
    margin: 0 0 18px;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--muted-strong);
}

.portal-card__empty,
.portal-card__text {
    margin: 0 0 12px;
    font-size: .9rem;
    line-height: 1.65;
    color: var(--muted-strong);
}

.portal-card__hint {
    margin: 14px 0 0;
    font-size: .78rem;
    line-height: 1.6;
    color: var(--muted);
}

/* --- Tracker (candidate dashboard) ---------------------------------------
   Reuses the milestone component introduced on /check-status.php so a candidate
   sees the same shape in both places; only the "you are here" chip is new.     */

.tracker { list-style: none; padding: 0; }

.tracker__item > .tracker__body { display: grid; gap: 3px; min-width: 0; }

.tracker__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tracker__now {
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--emerald-700);
    background: var(--emerald-50);
    border: 1px solid rgba(14,159,110,.22);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    white-space: nowrap;
}

.tracker__item:not(.is-done):not(.is-current) .tracker__note {
    color: #9AA6B5;
    border-left-color: var(--line-strong);
}

/* --- Timeline ------------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

.timeline__item {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 12px;
    position: relative;
}

.timeline__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--emerald-500);
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

.timeline__item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 15px;
    bottom: -16px;
    width: 1px;
    background: var(--line);
}

.timeline__body { display: grid; gap: 4px; min-width: 0; }

.timeline__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    justify-content: space-between;
}

.timeline__label { font-size: .9rem; color: var(--ink); font-weight: 650; }

.timeline__time {
    font-size: .76rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.timeline__note {
    font-size: .87rem;
    line-height: 1.6;
    color: var(--muted-strong);
}

/* --- Meetings ------------------------------------------------------------- */

.meeting-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.meeting {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.meeting--past { background: var(--surface); }

.meeting__when { display: grid; gap: 2px; }

.meeting__date {
    font-size: .84rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.meeting__time { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.meeting__body { display: grid; gap: 3px; min-width: 0; }

.meeting__title { font-size: .92rem; font-weight: 650; color: var(--ink); }

.meeting__meta { font-size: .8rem; color: var(--muted); }

.meeting__agenda { font-size: .83rem; line-height: 1.55; color: var(--muted-strong); }

.meeting__action { display: flex; justify-content: flex-end; }

.meeting__pending {
    font-size: .76rem;
    font-weight: 650;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-pill);
    padding: 5px 11px;
    white-space: nowrap;
}

.status-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: .72rem;
    font-weight: 700;
    background: #EDF1F6;
    color: var(--muted-strong);
    white-space: nowrap;
}

.status-chip--completed { background: var(--emerald-50); color: var(--emerald-700); }
.status-chip--cancelled { background: #FEE4E2; color: #912018; }
.status-chip--no_show   { background: #FEF3C7; color: #92400E; }

/* --- Resume row ----------------------------------------------------------- */

.resume-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.resume-row__icon { color: var(--navy-700); display: inline-flex; }

.resume-row__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }

.resume-row__name {
    font-size: .9rem;
    font-weight: 650;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resume-row__meta { font-size: .78rem; color: var(--muted); }

/* --- Profile list --------------------------------------------------------- */

.profile-list { margin: 0; display: grid; gap: 9px; }

.profile-list__row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    font-size: .87rem;
}

.profile-list dt { color: var(--muted); }

.profile-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    overflow-wrap: break-word;
    min-width: 0;
}

.profile-list dd a { color: var(--navy-700); text-decoration: underline; }

.verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: var(--emerald-50);
    color: var(--emerald-700);
    font-size: .68rem;
    font-weight: 700;
    vertical-align: middle;
}

/* --- Responsive ----------------------------------------------------------- */

@media (min-width: 901px) {
    .portal-gate__inner { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); }
    .portal__grid       { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .85fr); }
    .portal__aside {
        position: sticky;
        top: calc(var(--header-h, 76px) + 18px);
    }
}

@media (max-width: 720px) {
    .portal-head__inner { flex-direction: column; align-items: flex-start; }
    .portal-head__side { width: 100%; justify-content: space-between; }
    .meeting { grid-template-columns: 1fr auto; }
    .meeting__when { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; }
    .meeting__action { grid-column: 2; }
    .profile-list__row { grid-template-columns: 1fr; gap: 2px; }
    .input--code { font-size: 1.2rem; letter-spacing: .3em; }
}
