/*
 * Motion Events — Checkout bundle (M14-E: the transactional experience adopts the design system).
 * The Checkout opts into base.css with `class="ds checkout"`: identity tokens (purple / turquoise, Oxanium + Montserrat),
 * light and dark by the visitor's system, one focus system, reduced motion. This file only adds the Checkout's own
 * components to the shared layers and consumes tokens; nothing is copied from site.css (the boundaries stay separate).
 * Mobile first: one column, 44 px targets, no information carried by colour alone, no horizontal overflow at 320 px.
 * Naming: `c-ck-` for the Checkout's components; the pre-M14 class names still emitted by the unchanged diploma form
 * (`field`, `btn`, `notice`, `lead`, `actions`) are styled here at zero specificity so the whole boundary looks the same.
 */

/* ==== layout ======================================================================================================= */
@layer layout {
    .checkout {
        --ck-wide: 64rem;
        --ck-col: 46rem;
        --ck-narrow: 36rem;
        min-block-size: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* base.css keeps a pre-M14 `main` rule for every surface; the Checkout sets its own page frame. */
    .c-ck-main {
        flex: 1 0 auto;
        max-inline-size: none;
        margin: 0;
        padding: 0 0 var(--space-2xl);
    }

    .c-ck-page {
        inline-size: min(100% - 2 * var(--gutter), var(--ck-col));
        margin-inline: auto;
    }

    .c-ck-page--narrow {
        inline-size: min(100% - 2 * var(--gutter), var(--ck-narrow));
    }

    /* The same breathing room under the race band, the progress and the page title, whichever comes first. */
    .c-ck-main > .c-ck-page {
        padding-block-start: var(--space-l);
    }

    .c-ck-page > * + *,
    .c-ck-form > * + * {
        margin-block-start: var(--space-l);
    }

    .c-ck-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-s) var(--space-m);
        align-items: start;
    }

    @media (min-width: 40rem) {
        .c-ck-grid {
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
        }
    }
}

/* ==== components =================================================================================================== */
@layer components {
    /* ---- Skip link: visible on focus only. */
    .checkout .skip-link {
        position: absolute;
        inset-block-start: var(--space-2xs);
        inset-inline-start: var(--space-2xs);
        z-index: var(--z-skip);
        padding: var(--space-2xs) var(--space-s);
        background: var(--color-bg);
        color: var(--color-link);
        font-weight: var(--weight-semibold);
        transform: translateY(-200%);
    }

    .checkout .skip-link:focus {
        transform: none;
    }

    /* ---- Header: the brand lockup (a link home) and what this page is. */
    .c-ck-header {
        background: var(--color-bg);
        border-block-end: var(--border-hairline) solid var(--color-border);
    }

    .c-ck-header__bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2xs) var(--space-m);
        inline-size: min(100% - 2 * var(--gutter), var(--ck-wide));
        min-block-size: 4rem;
        margin-inline: auto;
        padding-block: var(--space-2xs);
    }

    .c-ck-header__brand {
        display: inline-flex;
        align-items: center;
        min-block-size: var(--control-height);
        text-decoration: none;
    }

    .c-ck-brand,
    .c-ck-brand__img {
        display: block;
        inline-size: auto;
        block-size: 2rem;
    }

    /* M14-J2 review round 4: brand at the start; the step label and the theme switch together at the end. */
    .c-ck-header__label {
        margin: 0 0 0 auto;
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    /* ---- ADR-030 (OD-125): the language switch «ES / EN» — the current language as text, the other as a 44 px link. */
    .c-ck-lang {
        display: flex;
        flex: none;
        align-items: center;
        gap: 0 0.3em;
        margin: 0;
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        white-space: nowrap;
    }

    .c-ck-lang__current {
        color: var(--color-text);
    }

    .c-ck-lang__sep {
        color: var(--color-border-strong);
    }

    .c-ck-lang__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-block-size: var(--control-height);
        min-inline-size: var(--control-height);
        color: var(--color-link);
    }

    /* M14-J2 round 5: on phones the brand, the step label and the theme switch stay on one line (at 390 px the colour
       lockup pushed the switch alone onto a second line). */
    @media (width < 30rem) {
        .c-ck-header__bar {
            column-gap: var(--space-xs);
        }

        .c-ck-brand__img {
            block-size: 1.625rem;
        }

        /* M14-K: a longer label («Pago simulado») wraps inside its own space instead of pushing the switch to a second line. */
        .c-ck-header .c-ck-header__bar {
            flex-wrap: nowrap;
        }

        .c-ck-header__brand {
            flex: none;
        }

        .c-ck-header__label {
            flex: 0 1 auto;
            min-inline-size: 0;
            line-height: var(--leading-tight);
            text-align: end;
        }

        /* ADR-027: with the access control the bar has no room for the label on a phone: the page's own heading says it. */
        .c-ck-header__bar:has(.c-account) .c-ck-header__label {
            display: none;
        }

        .c-ck-header__bar:has(.c-account) .c-ck-lang {
            margin-inline-start: auto;
        }

        /* OD-126: brand, «ES / EN», theme and account fit one 375 px line (with the switch they ran a few pixels past it). */
        .c-ck-header__bar:has(.c-account) {
            column-gap: var(--space-2xs);
        }

        .c-ck-header__bar:has(.c-account) .c-ck-brand__img {
            block-size: 1.375rem;
        }
    }

    @media (width < 22.5rem) {
        .c-ck-header__bar {
            column-gap: var(--space-2xs);
        }

        .c-ck-brand__img {
            block-size: 1.25rem;
        }

        .c-ck-header__bar:has(.c-account) .c-ck-brand__img {
            block-size: 1.25rem;
        }
    }

    /* ---- Race context: the manual's purple band, the race in Oxanium, its date plate or its own cover, the wave. */
    .c-ck-race {
        --band-space: var(--space-m);
        position: relative;
        isolation: isolate;
        overflow: hidden;
        padding-block: var(--band-space);
    }

    .c-ck-race::after {
        content: "";
        position: absolute;
        z-index: -1;
        inset-block-end: 0;
        inset-inline-end: 0;
        inline-size: min(100%, 30rem);
        block-size: 100%;
        background: url("/assets/img/brand/halftone-wave.2e3433c84f.svg") right bottom / contain no-repeat;
        opacity: 0.35;
        pointer-events: none;
    }

    .c-ck-race__inner {
        display: grid;
        grid-template-columns: 5.5rem minmax(0, 1fr);
        gap: var(--space-s);
        align-items: center;
        inline-size: min(100% - 2 * var(--gutter), var(--ck-col));
        margin-inline: auto;
    }

    .c-ck-race__media {
        aspect-ratio: 4 / 3;
        overflow: hidden;
        border-radius: var(--radius-s);
        background: var(--purple-900);
    }

    .c-ck-race__cover {
        display: block;
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
    }

    .c-ck-plate {
        display: grid;
        place-content: center;
        justify-items: center;
        block-size: 100%;
        font-family: var(--font-display);
        font-weight: var(--weight-bold);
        line-height: 0.95;
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
        color: #ffffff;
    }

    .c-ck-plate__day {
        font-size: 1.75rem;
        font-weight: var(--weight-heavy);
    }

    .c-ck-plate__month {
        font-size: 0.875rem;
        color: var(--turquoise-500);
    }

    .c-ck-plate__year {
        font-size: 0.75rem;
        color: var(--purple-200);
    }

    .c-ck-race__text > * {
        margin: 0;
    }

    .c-ck-race__eyebrow {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-signal);
    }

    .c-ck-race__name {
        margin-block: var(--space-3xs) var(--space-2xs);
        font-family: var(--font-display);
        font-size: var(--text-xl);
        font-weight: var(--weight-bold);
        line-height: var(--leading-heading);
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
        text-wrap: balance;
    }

    .c-ck-race__name a {
        color: var(--color-text);
        text-decoration: none;
    }

    .c-ck-race__name a:hover {
        text-decoration: underline;
        color: var(--color-text);
    }

    .c-ck-race__facts {
        display: grid;
        gap: var(--space-3xs);
        margin: 0;
        padding: 0;
        list-style: none;
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-race__facts li {
        display: flex;
        align-items: flex-start;
        gap: var(--space-2xs);
    }

    .c-ck-race__facts .c-icon {
        margin-block-start: 0.15em;
        color: var(--color-signal);
    }

    @media (min-width: 48rem) {
        .c-ck-race {
            --band-space: var(--space-l);
        }

        .c-ck-race__inner {
            grid-template-columns: 9rem minmax(0, 1fr);
            gap: var(--space-m);
        }

        .c-ck-plate__day {
            font-size: 2.75rem;
        }

        .c-ck-plate__month {
            font-size: 1.125rem;
        }

        .c-ck-race__name {
            font-size: var(--text-2xl);
        }
    }

    /* ---- Progress: four steps; the state is written (visually hidden words) and shown by marker + rule, never colour only. */
    .c-ck-steps {
        margin-block: 0;
    }

    .c-ck-steps__list {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--space-2xs);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .c-ck-steps__item {
        display: flex;
        flex-direction: column;
        gap: var(--space-2xs);
        padding-block-start: var(--space-2xs);
        border-block-start: 4px solid var(--color-border);
        font-size: var(--text-xs);
        line-height: var(--leading-tight);
        color: var(--color-muted);
    }

    .c-ck-steps__marker {
        display: inline-grid;
        place-items: center;
        inline-size: 1.75rem;
        block-size: 1.75rem;
        border: var(--border-strong) solid currentColor;
        border-radius: var(--radius-s);
        font-family: var(--font-display);
        font-weight: var(--weight-bold);
        font-size: var(--text-s);
    }

    .c-ck-steps__item.is-done {
        border-block-start-color: var(--color-signal);
        color: var(--color-text);
    }

    .c-ck-steps__item.is-done .c-ck-steps__marker {
        border-color: var(--color-signal);
        background: var(--color-signal);
        color: var(--color-bg);
    }

    .c-ck-steps__item.is-current {
        border-block-start-color: var(--color-primary);
        color: var(--color-text);
        font-weight: var(--weight-bold);
    }

    .c-ck-steps__item.is-current .c-ck-steps__marker {
        border-color: var(--color-primary);
        background: var(--color-primary);
        color: var(--color-on-primary);
    }

    .c-ck-steps__item.is-attention {
        border-block-start-color: var(--color-error);
    }

    .c-ck-steps__item.is-attention .c-ck-steps__marker {
        border-color: var(--color-error);
        background: var(--color-error);
        color: var(--color-on-error);
    }

    .c-ck-steps__text {
        margin: var(--space-2xs) 0 0;
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-steps__current {
        display: none;
        color: var(--color-text);
        font-weight: var(--weight-semibold);
    }

    /* On a phone the labels leave the narrow columns (they stay in the accessibility tree) and the line below names the
       current step instead. */
    @media (max-width: 30rem) {
        .c-ck-steps__label {
            position: absolute;
            inline-size: 1px;
            block-size: 1px;
            overflow: hidden;
            clip-path: inset(50%);
            white-space: nowrap;
        }

        .c-ck-steps__current {
            display: inline;
        }
    }

    /* A heading or a text that receives focus only to move the reading position (after a load, an added card, an opened
       confirmation) is not a control: no ring. Controls keep base.css's focus system. */
    .checkout :where(h1, h2, p)[tabindex="-1"]:focus {
        outline: none;
        box-shadow: none;
    }

    /* ---- Intro of a step: the H1 and one lead. */
    .c-ck-intro > * {
        margin: 0;
    }

    .c-ck-intro h1 {
        font-size: var(--text-2xl);
    }

    .c-ck-intro__lead,
    .checkout :where(.lead) {
        margin-block-start: var(--space-2xs);
        max-inline-size: var(--measure);
        font-size: var(--text-m);
        color: var(--color-muted);
    }

    .c-ck-ref {
        margin-block-start: var(--space-2xs);
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-ref code,
    .checkout :where(.received) code {
        font-size: 0.95em;
        overflow-wrap: anywhere;
    }

    .c-ck-muted {
        color: var(--color-muted);
        font-weight: var(--weight-regular);
    }

    /* ---- Notices: icon + text, the tone also said by the icon and the words. */
    .c-ck-notice,
    .checkout :where(.notice) {
        display: flex;
        align-items: flex-start;
        gap: var(--space-2xs);
        margin: 0;
        padding: var(--space-s);
        border: var(--border-hairline) solid var(--color-info);
        border-inline-start-width: 4px;
        border-radius: var(--radius-s);
        background: var(--color-info-bg);
        color: var(--color-text);
    }

    .c-ck-notice > .c-icon {
        margin-block-start: 0.2em;
        color: var(--color-info);
    }

    .c-ck-notice > p {
        margin: 0;
    }

    .c-ck-notice--success {
        border-color: var(--color-success);
        background: var(--color-success-bg);
    }

    .c-ck-notice--success > .c-icon {
        color: var(--color-success);
    }

    .c-ck-notice--warning,
    .checkout :where(.notice--warn) {
        border-color: var(--color-warning);
        background: var(--color-warning-bg);
    }

    .c-ck-notice--warning > .c-icon {
        color: var(--color-warning);
    }

    /* ---- Sections of a form (fieldsets) and panels of a page. */
    .c-ck-section,
    .c-ck-panel {
        min-inline-size: 0;
        margin-inline: 0;
        padding: var(--space-m);
        border: var(--border-hairline) solid var(--color-border);
        border-radius: var(--radius-m);
        background: var(--color-bg);
    }

    .c-ck-section__title,
    .c-ck-panel__title {
        margin: 0;
        padding: 0;
        font-family: var(--font-display);
        font-size: var(--text-l);
        font-weight: var(--weight-bold);
        line-height: var(--leading-heading);
    }

    fieldset.c-ck-section > .c-ck-section__title {
        float: left;
        inline-size: 100%;
        margin-block-end: var(--space-s);
    }

    .c-ck-section__body {
        clear: both;
        display: grid;
        gap: var(--space-m);
    }

    .c-ck-panel > * + * {
        margin-block-start: var(--space-s);
    }

    .c-ck-panel__head {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--space-2xs) var(--space-s);
    }

    .c-ck-panel__text {
        margin: 0;
    }

    .c-ck-edit {
        display: inline-flex;
        align-items: center;
        gap: var(--space-3xs);
        min-block-size: var(--control-height);
        font-weight: var(--weight-semibold);
    }

    .c-ck-edit--small {
        min-block-size: 2rem;
        font-size: var(--text-s);
    }

    /* ---- Fields: the design-system field at full width of the column; `--s`/`--m` keep short values short. */
    .checkout .c-field {
        max-inline-size: none;
    }

    .checkout .c-field--s {
        max-inline-size: 10rem;
    }

    .checkout .c-field--m {
        max-inline-size: 18rem;
    }

    .field__req {
        font-weight: var(--weight-regular);
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    /* Pre-M14 markup still served by the diploma form: the same look at zero specificity. */
    .checkout :where(p.field) {
        display: grid;
        gap: var(--space-2xs);
        margin: 0;
    }

    .checkout :where(p.field) > label {
        font-weight: var(--weight-semibold);
    }

    .checkout :where(.field__hint) {
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .checkout :where(p.field) :where(input:not([type="radio"], [type="checkbox"]), select) {
        inline-size: 100%;
        min-block-size: var(--control-height);
        padding: 0.5em 0.75em;
        border: var(--border-hairline) solid var(--color-border-strong);
        border-radius: var(--radius-s);
        background: var(--color-bg);
        color: var(--color-text);
        font: inherit;
    }

    /* ---- Choices: chips (sex, shirt size), the two ways to register, checkboxes — the input stays inside its label. */
    .c-ck-chips {
        min-inline-size: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .c-ck-chips > legend {
        margin-block-end: var(--space-2xs);
        padding: 0;
    }

    .c-ck-chips > .c-field__error,
    .c-ck-chips > .c-field__hint {
        margin-block-end: var(--space-2xs);
    }

    .c-ck-chips__row {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2xs);
    }

    .c-ck-chip,
    .c-ck-mode {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2xs);
        min-block-size: var(--control-height);
        padding: var(--space-3xs) var(--space-s);
        border: var(--border-hairline) solid var(--color-border-strong);
        border-radius: var(--radius-s);
        background: var(--color-bg);
        cursor: pointer;
    }

    .c-ck-chip:hover,
    .c-ck-mode:hover {
        border-color: var(--color-text);
    }

    .c-ck-chip:has(input:checked),
    .c-ck-mode:has(input:checked) {
        border-color: var(--color-primary);
        box-shadow: inset 0 0 0 1px var(--color-primary);
        background: var(--color-surface-alt);
        font-weight: var(--weight-semibold);
    }

    .c-ck-chip:has(input:focus-visible),
    .c-ck-mode:has(input:focus-visible),
    .c-ck-check:has(input:focus-visible),
    .c-ck-offer:has(input:focus-visible) {
        outline: var(--focus-width) solid var(--color-focus);
        outline-offset: var(--focus-offset);
    }

    .c-ck-chip__input,
    .c-ck-mode__input,
    .c-ck-check__input,
    .c-ck-offer__input {
        flex: none;
        inline-size: 1.25rem;
        block-size: 1.25rem;
        margin: 0;
        accent-color: var(--color-primary);
    }

    .is-invalid .c-ck-chip,
    .is-invalid .c-ck-offer {
        border-color: var(--color-error);
    }

    .c-ck-modes {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
        gap: var(--space-2xs);
    }

    .c-ck-mode {
        padding-block: var(--space-xs);
    }

    .c-ck-mode__text {
        display: grid;
        gap: 0.1em;
    }

    .c-ck-mode__name {
        font-weight: var(--weight-bold);
    }

    .c-ck-mode__hint {
        font-size: var(--text-s);
        font-weight: var(--weight-regular);
        color: var(--color-muted);
    }

    .c-ck-count {
        display: grid;
        gap: var(--space-2xs);
    }

    .c-ck-stepper {
        display: flex;
        align-items: stretch;
        gap: var(--space-2xs);
        max-inline-size: 16rem;
    }

    .c-ck-stepper .c-input {
        text-align: center;
    }

    .c-ck-count .c-input {
        max-inline-size: 8rem;
    }

    .c-ck-check {
        display: flex;
        align-items: flex-start;
        gap: var(--space-xs);
        min-block-size: var(--control-height);
        padding-block: var(--space-2xs);
        cursor: pointer;
        font-weight: var(--weight-text);
    }

    .c-ck-check__input {
        margin-block-start: 0.1em;
    }

    /* ---- Participant cards: a fieldset per person, sections inside, collapsible (JS) with a written summary. */
    .c-ck-people {
        display: grid;
        gap: var(--space-m);
    }

    .c-ck-person {
        min-inline-size: 0;
        margin: 0;
        padding: 0;
        border: var(--border-hairline) solid var(--color-border);
        border-radius: var(--radius-m);
        background: var(--color-bg);
    }

    .c-ck-person[data-card-invalid] {
        border-color: var(--color-error);
        border-inline-start-width: 4px;
    }

    .c-ck-person__legend {
        float: left;
        inline-size: 100%;
        margin: 0;
        padding: var(--space-s) var(--space-m) 0;
    }

    .c-ck-person__title {
        margin: 0;
        font-size: var(--text-l);
    }

    .c-ck-person__head {
        clear: both;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2xs) var(--space-s);
        padding: var(--space-2xs) var(--space-m) 0;
    }

    .c-ck-person__summary {
        flex: 1 1 14rem;
        margin: 0;
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-person__summary strong {
        color: var(--color-text);
    }

    .c-ck-person__status {
        display: block;
        margin-block-start: var(--space-3xs);
        font-weight: var(--weight-semibold);
    }

    .c-ck-person__status.is-complete {
        color: var(--color-success);
    }

    .c-ck-person__status.is-incomplete {
        color: var(--color-warning);
    }

    .c-ck-person__body {
        display: grid;
        gap: var(--space-l);
        padding: var(--space-m);
    }

    .c-ck-person.is-collapsed .c-ck-person__head {
        padding-block-end: var(--space-s);
    }

    .c-ck-sub {
        display: grid;
        gap: var(--space-s);
        min-inline-size: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .c-ck-sub + .c-ck-sub {
        padding-block-start: var(--space-m);
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    .c-ck-sub__title {
        margin: 0;
        padding: 0;
        font-family: var(--font-sans);
        font-size: var(--text-xs);
        font-weight: var(--weight-bold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    fieldset.c-ck-sub > .c-ck-sub__title {
        float: left;
        inline-size: 100%;
        margin-block-end: var(--space-s);
    }

    fieldset.c-ck-sub > .c-ck-sub__title + * {
        clear: both;
    }

    .c-ck-copy {
        display: grid;
        gap: var(--space-2xs);
        justify-items: start;
        padding: var(--space-s);
        border-radius: var(--radius-s);
        background: var(--color-surface-alt);
    }

    .c-ck-copy .c-field__hint {
        margin: 0;
    }

    .c-ck-age {
        margin: var(--space-2xs) 0 0;
        font-size: var(--text-s);
        font-weight: var(--weight-semibold);
        color: var(--color-text);
    }

    .c-ck-inline-check {
        margin: 0;
    }

    /* ---- Modalities: a card per option — name, category/distance, today's price and its written state. */
    .c-ck-offers {
        display: grid;
        gap: var(--space-2xs);
    }

    .c-ck-offer {
        border: var(--border-hairline) solid var(--color-border-strong);
        border-radius: var(--radius-s);
        background: var(--color-bg);
    }

    .c-ck-offer:has(input:checked) {
        border-color: var(--color-primary);
        box-shadow: inset 0 0 0 1px var(--color-primary);
        background: var(--color-surface-alt);
    }

    .c-ck-offer__label {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: var(--space-3xs) var(--space-s);
        align-items: center;
        min-block-size: var(--control-height);
        padding: var(--space-xs) var(--space-s);
        cursor: pointer;
    }

    .c-ck-offer__input {
        grid-row: 1 / span 3;
    }

    .c-ck-offer__name {
        grid-column: 2;
        font-weight: var(--weight-bold);
    }

    .c-ck-offer__detail {
        grid-column: 2;
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-offer__price {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        font-family: var(--font-display);
        font-weight: var(--weight-bold);
        white-space: nowrap;
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-ck-offer__state {
        grid-column: 2 / span 2;
        display: inline-flex;
        align-items: center;
        gap: var(--space-3xs);
        font-size: var(--text-s);
        font-weight: var(--weight-semibold);
    }

    .c-ck-offer__state.is-ok {
        color: var(--color-success);
    }

    .c-ck-offer__state.is-low {
        color: var(--color-warning);
    }

    .c-ck-offer__state.is-off {
        color: var(--color-muted);
    }

    .c-ck-offer.is-off .c-ck-offer__label {
        cursor: not-allowed;
        color: var(--color-muted);
    }

    .c-ck-offer.is-off {
        border-style: dashed;
    }

    .c-ck-offer__branch {
        padding: 0 var(--space-s) var(--space-s);
    }

    .c-ck-modalities__update {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-2xs) var(--space-s);
    }

    .c-ck-modalities__update .c-button[aria-busy="true"] .c-icon {
        animation: c-spin var(--dur-cinematic) var(--ease-linear) infinite;
    }

    /* ---- Group bar and the estimate (an estimate, said so; the server's total is on the review). */
    .c-ck-group-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-2xs) var(--space-s);
    }

    .c-ck-group-bar .c-field__hint {
        margin: 0;
    }

    .c-ck-estimate {
        display: grid;
        gap: var(--space-3xs);
        padding: var(--space-s) var(--space-m);
        border: var(--border-hairline) dashed var(--color-border-strong);
        border-radius: var(--radius-s);
    }

    .c-ck-estimate > p {
        margin: 0;
    }

    .c-ck-estimate__label {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-ck-estimate__value {
        font-family: var(--font-display);
        font-size: var(--text-xl);
        font-weight: var(--weight-bold);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-ck-estimate__note {
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    /* ---- Actions: one primary per view; on a phone every button takes the full width. */
    .c-ck-actions,
    .checkout :where(.actions) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-s);
    }

    .c-ck-actions--split {
        justify-content: space-between;
    }

    .c-ck-actions--end {
        justify-content: flex-end;
    }

    .c-ck-inline-form {
        display: contents;
    }

    @media (max-width: 30rem) {
        .c-ck-actions > .c-button,
        .c-ck-actions > .c-ck-inline-form > .c-button,
        .c-ck-state__actions > .c-button,
        .c-ck-state__actions > .c-ck-inline-form > .c-button {
            inline-size: 100%;
        }

        .c-ck-actions--split {
            flex-direction: column-reverse;
            align-items: stretch;
        }
    }

    /* The legacy button classes of the diploma form, drawn as the design-system button. */
    .checkout :where(.btn) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-block-size: var(--control-height);
        padding: 0.625em 1.25em;
        border: var(--border-strong) solid var(--color-primary);
        border-radius: var(--radius-s);
        background: var(--color-primary);
        color: var(--color-on-primary);
        font: inherit;
        font-weight: var(--weight-semibold);
        text-decoration: none;
        cursor: pointer;
    }

    .checkout :where(.btn--secondary) {
        background: transparent;
        color: var(--color-text);
        border-color: var(--color-text);
    }

    /* The first submit button of the cards form exists only so that Enter means «continue»: off-screen. */
    .default-action {
        position: absolute;
        inset-inline-start: -9999px;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
    }

    /* ---- Confirmation disclosure: the first press shows what happens and the real button. */
    .c-ck-confirm {
        display: grid;
        gap: var(--space-s);
    }

    .c-ck-confirm__toggle {
        list-style: none;
        justify-self: start;
    }

    .c-ck-confirm__toggle::-webkit-details-marker {
        display: none;
    }

    .c-ck-confirm[open] > .c-ck-confirm__toggle {
        --_bg: var(--color-surface-alt);
    }

    .c-ck-confirm__panel {
        display: grid;
        gap: var(--space-s);
        padding: var(--space-m);
        border: var(--border-hairline) solid var(--color-border-strong);
        border-inline-start-width: 4px;
        border-radius: var(--radius-s);
        background: var(--color-bg);
    }

    .c-ck-confirm__panel > * {
        margin: 0;
    }

    .c-ck-confirm__title {
        font-family: var(--font-display);
        font-size: var(--text-l);
        font-weight: var(--weight-bold);
    }

    .c-ck-confirm__points {
        display: grid;
        gap: var(--space-2xs);
        padding-inline-start: 1.25em;
    }

    .c-ck-confirm__form {
        margin: 0;
    }

    .c-ck-aside-actions {
        padding-block-start: var(--space-m);
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    /* ---- Review: lines per person, totals as data. */
    .c-ck-lines {
        display: grid;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .c-ck-line {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--space-s);
        padding-block: var(--space-s);
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    .c-ck-line__who > * {
        margin: 0;
    }

    .c-ck-line__name {
        font-weight: var(--weight-bold);
    }

    .c-ck-line__meta {
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-line__facts {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-3xs) var(--space-m);
        margin-block: var(--space-2xs) 0;
        font-size: var(--text-s);
    }

    .c-ck-line__facts dt {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-ck-line__facts dd {
        margin: 0;
        font-weight: var(--weight-semibold);
    }

    .c-ck-line__money {
        text-align: end;
    }

    .c-ck-line__money > p {
        margin: 0;
        font-variant-numeric: tabular-nums lining-nums;
        white-space: nowrap;
    }

    .c-ck-line__net {
        font-family: var(--font-display);
        font-weight: var(--weight-bold);
    }

    .c-ck-line__discount {
        font-size: var(--text-s);
        color: var(--color-success);
    }

    .is-struck {
        text-decoration: line-through;
        color: var(--color-muted);
    }

    .c-ck-discount {
        display: grid;
        gap: var(--space-s);
    }

    .c-ck-totals__rows {
        display: grid;
        margin: 0;
    }

    .c-ck-totals__row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--space-2xs) var(--space-m);
        padding-block: var(--space-2xs);
        border-block-end: var(--border-hairline) solid var(--color-border);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-ck-totals__row dd {
        margin: 0;
    }

    .c-ck-totals__row--total {
        padding-block: var(--space-s);
        border-block-end: 0;
        border-block-start: var(--border-strong) solid var(--color-text);
        align-items: baseline;
    }

    .c-ck-totals__row--total dt {
        font-weight: var(--weight-bold);
    }

    .c-ck-totals__row--total dd {
        font-family: var(--font-display);
        font-size: var(--text-2xl);
        font-weight: var(--weight-bold);
        line-height: 1;
    }

    .c-ck-totals__note {
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-hold {
        display: flex;
        align-items: flex-start;
        gap: var(--space-2xs);
        margin: 0;
        padding: var(--space-s);
        border-radius: var(--radius-s);
        background: var(--color-surface-alt);
        font-weight: var(--weight-semibold);
    }

    .c-ck-hold > .c-icon {
        margin-block-start: 0.2em;
        color: var(--color-signal);
    }

    .c-ck-next {
        padding: var(--space-s) var(--space-m);
        border-inline-start: 4px solid var(--color-signal);
        background: var(--color-surface-alt);
    }

    .c-ck-next > p {
        margin: 0;
    }

    .c-ck-next__title {
        font-size: var(--text-xs);
        font-weight: var(--weight-bold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    /* ---- Order state panel: what happened, what to do, wait?, e-mail?, the action. Tone = border + icon + label. */
    .c-ck-state {
        --_tone: var(--color-info);
        display: grid;
        gap: var(--space-m);
        padding: var(--space-m);
        border: var(--border-hairline) solid var(--color-border);
        border-inline-start: 6px solid var(--_tone);
        border-radius: var(--radius-m);
        background: var(--color-bg);
    }

    .c-ck-state--success {
        --_tone: var(--color-success);
    }

    .c-ck-state--warning {
        --_tone: var(--color-warning);
    }

    .c-ck-state--error {
        --_tone: var(--color-error);
    }

    .c-ck-state--neutral {
        --_tone: var(--color-border-strong);
    }

    .c-ck-state__head {
        display: flex;
        align-items: flex-start;
        gap: var(--space-s);
    }

    .c-ck-state__icon {
        flex: none;
        color: var(--_tone);
    }

    .c-ck-state__heading > * {
        margin: 0;
    }

    .c-ck-state__label {
        font-size: var(--text-xs);
        font-weight: var(--weight-bold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-ck-state__title {
        font-size: var(--text-xl);
    }

    h1.c-ck-state__title {
        font-size: var(--text-2xl);
    }

    .c-ck-state__body {
        display: grid;
        gap: var(--space-s);
    }

    .c-ck-state__body > p {
        margin: 0;
    }

    .c-ck-state__actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-s);
    }

    .c-ck-state__more {
        display: grid;
        gap: var(--space-s);
        padding-block-start: var(--space-s);
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    .c-ck-facts {
        display: grid;
        gap: var(--space-s);
        margin: 0;
    }

    .c-ck-facts dt {
        font-weight: var(--weight-bold);
    }

    .c-ck-facts dd {
        margin: 0;
        color: var(--color-muted);
    }

    .c-ck-secure {
        display: flex;
        align-items: flex-start;
        gap: var(--space-2xs);
        flex: 1 1 100%;
        margin: 0;
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    /* Polling: a written status; the ring only accompanies it and stops with reduced motion (base.css safety net). */
    .c-ck-poll {
        display: grid;
        gap: var(--space-2xs);
        padding: var(--space-s);
        border-radius: var(--radius-s);
        background: var(--color-info-bg);
    }

    .c-ck-poll > p {
        margin: 0;
    }

    .c-ck-poll__status {
        display: flex;
        align-items: center;
        gap: var(--space-2xs);
        font-weight: var(--weight-semibold);
    }

    /* ---- Order page: people and money. */
    .c-ck-people-list,
    .c-ck-money {
        display: grid;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .c-ck-person-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-2xs);
        padding-block: var(--space-s);
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    .c-ck-person-row__who > p {
        margin: 0;
    }

    .c-ck-person-row__name {
        font-weight: var(--weight-bold);
    }

    .c-ck-person-row__meta {
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-person-row__facts {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2xs) var(--space-l);
        margin: 0;
    }

    .c-ck-person-row__facts dt {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-ck-person-row__facts dd {
        margin: 0;
        font-weight: var(--weight-semibold);
    }

    .c-ck-bib {
        font-family: var(--font-display);
        font-size: var(--text-l);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-ck-reg--confirmed {
        color: var(--color-success);
    }

    .c-ck-reg--expired,
    .c-ck-reg--cancelled {
        color: var(--color-muted);
    }

    @media (min-width: 40rem) {
        .c-ck-person-row {
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
        }
    }

    .c-ck-money__line {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--space-2xs) var(--space-m);
        padding-block: var(--space-2xs);
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    .c-ck-money__amount {
        font-variant-numeric: tabular-nums lining-nums;
        white-space: nowrap;
    }

    .c-ck-reuse > summary {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: var(--space-2xs);
        min-block-size: var(--control-height);
        cursor: pointer;
    }

    .c-ck-reuse > summary .c-ck-panel__title {
        font-size: var(--text-m);
    }

    .c-ck-private {
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-private > p {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: var(--space-2xs);
        margin: 0;
    }

    .c-ck-private > p + p {
        margin-block-start: var(--space-2xs);
    }

    /* ---- Footer: the factual help channels (config/site.php), on the manual's purple. */
    .c-ck-footer {
        color-scheme: dark;
        --color-bg: var(--brand-purple);
        --color-focus-gap: var(--brand-purple);
        background: var(--color-bg);
        color: var(--color-text);
    }

    .c-ck-footer__inner {
        display: grid;
        gap: var(--space-s);
        inline-size: min(100% - 2 * var(--gutter), var(--ck-wide));
        margin-inline: auto;
        padding-block: var(--space-l);
    }

    .c-ck-footer__inner > * {
        margin: 0;
    }

    .c-ck-footer__title {
        font-family: var(--font-display);
        font-size: var(--text-l);
        font-weight: var(--weight-bold);
    }

    .c-ck-footer__channels {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2xs) var(--space-l);
        padding: 0;
        list-style: none;
    }

    .c-ck-footer__channel {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2xs);
        min-block-size: var(--control-height);
        font-weight: var(--weight-semibold);
        overflow-wrap: anywhere;
    }

    .c-ck-footer__links {
        font-size: var(--text-s);
    }

    .c-ck-footer__links a {
        display: inline-block;
        min-block-size: 1.5rem;
    }

    /* M14-J: the document of each consent (review). */
    .c-ck-doc .c-icon {
        --icon-size: 1em;
        margin-inline-start: 0.25em;
        vertical-align: -0.1em;
    }

    /* ---- Final comments, phase 2 ---------------------------------------------------------------------------------- */
    /* Step 1 without JavaScript: what belongs only to «Grupal» / «Individual» follows the checked mode (the enhancement
       does the same with `hidden` where `:has()` is missing; there the hints say which mode a field is for). */
    .c-ck-form:has(input[name="mode"][value="individual"]:checked) [data-group-only],
    .c-ck-form:has(input[name="mode"][value="group"]:checked) [data-individual-only] {
        display: none;
    }

    @supports selector(:has(*)) {
        .c-ck-only-hint {
            display: none;
        }
    }

    /* The birth date as day / month / year. */
    .c-ck-date {
        min-inline-size: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .c-ck-date__row {
        display: grid;
        grid-template-columns: minmax(3.5rem, 4.5rem) minmax(0, 1fr) minmax(4.5rem, 6rem);
        gap: var(--space-2xs);
        align-items: end;
    }

    .c-ck-date__label {
        display: block;
        margin-block-end: var(--space-3xs);
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        color: var(--color-muted);
    }

    /* A self-registration's identity: the contact's names and e-mail, shown, not asked again. */
    .c-ck-identity {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2xs) var(--space-m);
        padding: var(--space-s);
        border: var(--border-hairline) solid var(--color-border);
        border-radius: var(--radius-s);
        background: var(--color-surface-alt);
    }

    .c-ck-identity__facts {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2xs) var(--space-l);
        margin: 0;
    }

    .c-ck-identity__facts dt {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-ck-identity__facts dd {
        margin: 0;
        font-weight: var(--weight-semibold);
        overflow-wrap: anywhere;
    }

    .c-ck-identity .c-field__error {
        flex: 1 1 100%;
    }

    .c-ck-person__count {
        font-size: var(--text-s);
        font-weight: var(--weight-regular);
        color: var(--color-muted);
    }

    /* The one acceptance box: its documents, and the provisional state said briefly. */
    .c-ck-docs {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-3xs) var(--space-m);
        margin: var(--space-2xs) 0 0;
        padding: 0;
        list-style: none;
    }

    .c-ck-provisional,
    .c-ck-coupon-hint {
        display: flex;
        align-items: flex-start;
        gap: var(--space-2xs);
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-ck-provisional .c-icon,
    .c-ck-coupon-hint .c-icon {
        flex: none;
        margin-block-start: 0.2em;
    }

    /* Forced colours (Windows contrast themes): decoration goes, every boundary stays. */
    @media (forced-colors: active) {
        .c-ck-race::after {
            display: none;
        }

        .c-ck-steps__marker,
        .c-ck-chip,
        .c-ck-mode,
        .c-ck-offer {
            border: 1px solid CanvasText;
        }
    }
}

/* ==== utilities ==================================================================================================== */
@layer utilities {
    /* `hidden` always wins over a component's display (the collapsed cards, the scripted estimate, the polling states). */
    .checkout [hidden] {
        display: none;
    }
}
