/* Components (templates/components/): one rule set per component, in the order of docs/release-1.md 5.3. */

/* -- Logo --------------------------------------------------------------------- */

.logo {
    --logo-mark: 2.5rem;
    --logo-word: 1.5rem;
    --logo-shield: var(--color-primary);
    --logo-word-colour: var(--color-primary);

    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
}

.logo--on-header {
    --logo-shield: var(--color-on-header);
    --logo-word-colour: var(--color-on-header);
}

.logo--lg {
    --logo-mark: 3.5rem;
    --logo-word: 1.875rem;
}

.logo--xl {
    --logo-mark: 14rem;
    --logo-word: 3.375rem;

    flex-direction: column;
    gap: 0.75rem;
}

.logo__mark {
    flex: none;
    height: var(--logo-mark);
    width: auto;
    aspect-ratio: 210 / 190;
}

.logo__shield {
    fill: none;
    stroke: var(--logo-shield);
    stroke-width: 15;
}

.logo__gold {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 15;
}

.logo__check {
    fill: var(--color-accent);
}

.logo__word {
    color: var(--logo-word-colour);
    font-family: var(--font-heading);
    font-size: var(--logo-word);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
}

/* -- Button ------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--target-button);
    padding: 0.5rem 1.375rem; /* a label that wraps (a long address) keeps room above and below; min-height decides for one line */
    border: 2px solid transparent;
    border-radius: var(--radius-control);
    font: 600 var(--text-base) / 1.2 var(--font-body);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn--sm {
    min-height: var(--target-min);
    padding: 0 var(--space-4);
    font-size: var(--text-md);
}

.btn--lg {
    min-height: var(--target-hero);
    padding: 0 1.625rem;
    font-size: 1.0625rem;
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn:disabled,
.btn[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.btn--primary:hover {
    background: var(--color-primary-strong);
    color: var(--color-on-primary);
}

.btn--accent {
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.btn--accent:hover {
    background: var(--color-accent-strong);
    color: var(--color-on-accent);
}

.btn--secondary {
    border-color: var(--color-primary);
    background: var(--color-surface);
    color: var(--color-primary);
}

.btn--secondary:hover {
    background: var(--color-primary-tint);
    color: var(--color-primary);
}

/* A white outline for a teal ground (the home page's second hero button) */
.btn--inverse {
    border-color: var(--color-on-header);
    background: transparent;
    color: var(--color-on-header);
}

.btn--inverse:hover {
    background: var(--color-primary-strong);
    color: var(--color-on-header);
}

.btn--danger {
    background: var(--color-danger);
    color: var(--color-on-danger);
}

.btn--danger:hover {
    background: var(--color-danger-strong);
    color: var(--color-on-danger);
}

.btn--danger-outline {
    border-color: var(--color-danger);
    background: var(--color-surface);
    color: var(--color-danger-strong);
}

.btn--danger-outline:hover {
    background: var(--color-danger-tint);
    color: var(--color-danger-strong);
}

/* Looks like a link, is as big as a button to touch */
.btn--link {
    min-height: var(--target-min);
    padding: 0 0.5rem;
    background: transparent;
    color: var(--color-primary);
    font-size: var(--text-md);
}

.btn--link:hover {
    text-decoration: underline;
    color: var(--color-primary-strong);
}

/* A button in the teal bar that reads as one of its links (Sign out) */
.btn--nav {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-on-header);
}

.action-form {
    margin: 0;
    display: contents;
}

/* -- Status pill ---------------------------------------------------------------- */

.pill {
    display: inline-block;
    align-self: flex-start;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.2;
}

.pill--copy {
    background: var(--pill-copy-bg);
    color: var(--pill-copy-ink);
}

.pill--exemption {
    background: var(--pill-exemption-bg);
    color: var(--pill-exemption-ink);
}

.pill--attention {
    background: var(--pill-attention-bg);
    color: var(--pill-attention-ink);
}

.pill--neutral {
    background: var(--pill-neutral-bg);
    color: var(--pill-neutral-ink);
}

.pill--portal-green {
    background: var(--portal-green-bg);
    color: var(--portal-green-ink);
}

.pill--portal-blue {
    background: var(--portal-blue-bg);
    color: var(--portal-blue-ink);
}

.pill--portal-plum {
    background: var(--portal-plum-bg);
    color: var(--portal-plum-ink);
}

.pill--portal-amber {
    background: var(--portal-amber-bg);
    color: var(--portal-amber-ink);
}

.pill--portal-grey {
    background: var(--portal-grey-bg);
    color: var(--portal-grey-ink);
}

/* -- Card ------------------------------------------------------------------------ */

.card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    color: var(--color-ink);
}

@media (min-width: 40.0625rem) {
    .card {
        padding: var(--space-5);
    }
}

.card--roomy {
    padding: var(--space-5);
}

@media (min-width: 40.0625rem) {
    .card--roomy {
        padding: var(--space-6);
    }
}

.card--link {
    text-decoration: none;
}

.card--link:hover {
    border-color: var(--color-faint);
    color: var(--color-ink);
}

.card__heading {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-ink);
}

/* The small capitals above a card's title: "Child", "You" */
.eyebrow {
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* -- Notice ---------------------------------------------------------------------- */

.notice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 0.875rem var(--space-4);
    border-radius: var(--radius-card);
}

@media (min-width: 40.0625rem) {
    .notice {
        padding: var(--space-4) var(--space-5);
    }
}

.notice__icon {
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    margin-top: 0.125rem;
    fill: none;
    stroke: currentcolor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notice__body {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: var(--text-md);
    line-height: 1.5;
}

.notice__title {
    font-size: var(--text-base);
    font-weight: 600;
}

.notice a {
    color: inherit;
    font-weight: 600;
}

.notice--info {
    background: var(--pill-copy-bg);
    color: var(--pill-copy-ink);
}

.notice--attention {
    background: var(--pill-attention-bg);
    color: var(--color-on-notice);
}

.notice--danger {
    background: var(--color-danger-tint);
    color: var(--color-on-danger-tint);
}

.notice--success {
    background: var(--color-success-tint);
    color: var(--color-on-success-tint);
}

/* Public health needs this record too: its own, paler box */
.public-health {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: 1.125rem var(--space-5);
    border-radius: var(--radius-card);
    background: var(--color-notice-tint);
    color: var(--color-on-notice);
}

.public-health h2 {
    color: inherit;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
}

.public-health p {
    font-size: var(--text-sm);
    line-height: 1.5;
}

.public-health a {
    color: inherit;
    font-weight: 600;
}

/* -- Page header ----------------------------------------------------------------- */

.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    align-self: flex-start;
    min-height: var(--target-min);
    margin-block: calc(var(--space-2) * -1) calc(var(--space-3) * -1);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.page-header__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}

.page-header__text {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.page-header__subtitle {
    color: var(--color-muted);
    font-size: var(--text-md);
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* -- Definition list --------------------------------------------------------------- */

.definition-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem var(--space-4);
    margin: 0;
    font-size: var(--text-md);
}

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

.definition-list dd {
    margin: 0 0 var(--space-2);
}

@media (min-width: 40.0625rem) {
    .definition-list {
        grid-template-columns: 10rem minmax(0, 1fr);
        row-gap: var(--space-3);
    }

    .definition-list dd {
        margin: 0;
    }
}

/* -- Confirm panel ------------------------------------------------------------------ */

.confirm-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    border: 2px solid var(--color-danger);
    border-radius: var(--radius-card);
    background: var(--color-surface);
}

@media (min-width: 40.0625rem) {
    .confirm-panel {
        padding: var(--space-6);
    }
}

.confirm-panel__title {
    font-size: 1.375rem;
}

.confirm-panel__title:focus {
    outline: none;
}

.confirm-panel__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    font-size: var(--text-md);
    line-height: 1.55;
}

.confirm-panel__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* -- Data table ----------------------------------------------------------------------- */

/* `position: relative` makes the scroll area the containing block of what is absolutely placed inside it (the visually hidden words of a "Manage <name>" link):
   otherwise those escape the scroll area and widen the page itself on a phone. */
.table-scroll {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
}

.data-table {
    width: 100%;
    min-width: 45rem;
    border-collapse: collapse;
    font-size: var(--text-md);
    text-align: left;
}

.data-table th {
    padding: var(--space-3) var(--space-4);
    background: var(--color-canvas);
    color: var(--color-muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table td {
    padding: 0.875rem var(--space-4);
    border-top: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table td a {
    font-weight: 600;
}

/* A stacked table (the admin team, the organizations): on a phone each row is a card, every field under its own label, nothing to scroll sideways. The header row stays for a
   screen reader, drawn off screen. */
@media (max-width: 40rem) {
    .table-scroll--stacked {
        overflow-x: visible;
        border: 0;
        background: transparent;
    }

    .data-table--stacked,
    .data-table--stacked tbody,
    .data-table--stacked tr,
    .data-table--stacked td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .data-table--stacked thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .data-table--stacked tr {
        margin-bottom: var(--space-3);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-card);
        background: var(--color-surface);
        overflow: hidden;
    }

    .data-table--stacked td {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--space-1) var(--space-3);
        padding: var(--space-3) var(--space-4);
        border-top: 1px solid var(--color-border);
        text-align: end;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .data-table--stacked td::before {
        content: attr(data-label);
        color: var(--color-muted);
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        text-align: start;
    }

    .data-table--stacked td.data-table__lead {
        display: block;
        border-top: 0;
        background: var(--color-canvas);
        text-align: start;
    }

    .data-table--stacked td.data-table__lead::before {
        content: none;
    }
}

/* -- Empty state ------------------------------------------------------------------------ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border: 1px dashed var(--color-border-input);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.empty-state__title {
    color: var(--color-ink);
    font-size: var(--text-base);
    font-weight: 600;
}

.empty-state__action {
    margin-top: var(--space-2);
}

/* -- Form fields (the form theme and the field components) ----------------------------- */

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field > label,
.field > legend,
.field__label {
    padding: 0;
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 600;
}

.field__optional {
    color: var(--color-muted);
    font-weight: 400;
}

.field :is(input, select, textarea):not([type='checkbox'], [type='radio'], [type='file']) {
    width: 100%;
    min-height: var(--target-button);
    padding: 0 0.875rem;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    color: var(--color-ink);
    font: 400 var(--text-base) / 1.4 var(--font-body);
}

.field textarea {
    min-height: 7.5rem;
    padding-block: 0.75rem;
}

.field select {
    padding-inline: 0.625rem;
}

.field--invalid :is(input, select, textarea):not([type='checkbox'], [type='radio']) {
    border: 2px solid var(--color-danger);
}

.field__help,
.help-text {
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.field__errors {
    margin: 0;
    padding: 0;
    list-style: none;
}

.field__error {
    margin: 0;
    color: var(--color-danger-strong);
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Radios and checkboxes: the whole row is the target */
.choices {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.choice,
.field--check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--target-min);
    flex-wrap: wrap;
}

.choice label,
.field--check > label {
    flex: 1 1 0;
    font-size: var(--text-md);
    font-weight: 400;
    cursor: pointer;
}

.choice input[type='radio'],
.choice input[type='checkbox'],
.field--check input[type='checkbox'] {
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    margin: 0;
    accent-color: var(--color-primary);
}

.field--check > .field__errors,
.field--check > .field__help {
    flex-basis: 100%;
}

/* Date of birth: month, day, year in one row */
.dob {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr);
    gap: var(--space-2);
    max-width: 26.25rem;
}

.dob__part {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* The six-digit code: large, spaced, easy to check against the email */
.field--code input {
    min-height: 3.25rem;
    font-size: 1.375rem;
    font-weight: 500;
    letter-spacing: 0.12em;
}

.field--narrow {
    max-width: 26.25rem;
}

/* -- Error summary -------------------------------------------------------------------------- */

.error-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border: 2px solid var(--color-danger);
    border-radius: var(--radius-card);
    background: var(--color-danger-tint);
    color: var(--color-on-danger-tint);
}

.error-summary:focus {
    /* Invisible normally, drawn in forced-colours modes, where a box-shadow is not. */
    outline: 3px solid transparent;
    box-shadow: 0 0 0 3px var(--color-danger);
}

.error-summary h2 {
    color: inherit;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
}

.error-summary ul {
    margin: 0;
    padding-left: var(--space-5);
    font-size: var(--text-md);
}

.error-summary a {
    color: inherit;
    font-weight: 600;
}

/* -- File drop ----------------------------------------------------------------------------------- */

.file-drop {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.file-drop__native {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.file-drop__native label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.file-drop__native input[type='file'] {
    max-width: 100%;
    font: inherit;
}

/* With scripts, the buttons replace the browser's own file inputs (which stay in the page, out of sight, as what the form sends) */
.file-drop__buttons {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
}

.file-drop.is-enhanced .file-drop__buttons {
    display: grid;
}

.file-drop.is-enhanced .file-drop__native {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.file-drop.is-dragging .file-drop__zone {
    border-color: var(--color-primary);
    background: var(--color-primary-tint);
}

.file-drop__zone {
    padding: var(--space-3);
    border: 1px dashed var(--color-border-input);
    border-radius: var(--radius-control);
    color: var(--color-muted);
    font-size: var(--text-xs);
    text-align: center;
}

.file-drop__pages {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.file-drop__page {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
}

.file-drop__page--problem {
    border: 2px solid var(--color-danger);
}

.file-drop__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12.5rem;
    overflow: hidden;
    border-radius: var(--radius-control);
    background: var(--color-canvas);
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.file-drop__preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-drop__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: var(--text-sm);
}

.file-drop__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-drop__problem {
    color: var(--color-danger-strong);
    font-size: var(--text-sm);
    font-weight: 500;
}

.file-drop__hint {
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.5;
}

/* -- Copy button ----------------------------------------------------------------------------------- */

.copy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.copy__status {
    color: var(--color-success);
    font-size: var(--text-sm);
    font-weight: 600;
}

/* -- Home page pieces ---------------------------------------------------------------------------------- */

.reason {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.reason h2 {
    font-size: 1.25rem;
}

@media (min-width: 40.0625rem) {
    .reason h2 {
        font-size: 1.375rem;
    }
}

.reason p,
.steps__text {
    color: var(--color-muted);
    font-size: var(--text-md);
    line-height: 1.55;
}

@media (min-width: 40.0625rem) {
    .reason p {
        font-size: var(--text-base);
    }
}

.panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    padding: var(--space-5);
    border-radius: var(--radius-card);
    background: var(--color-canvas);
}

@media (min-width: 40.0625rem) {
    .panel {
        padding: var(--space-8);
    }
}

.panel h2 {
    font-size: 1.625rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
    gap: var(--space-6);
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps li {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.steps__title {
    color: var(--color-header);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
}

.fineprint {
    max-width: 47.5rem;
    color: var(--color-muted);
    font-size: var(--text-md);
    line-height: 1.55;
}

/* -- The component gallery (development only) ------------------------------------------------------------- */

.gallery {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
}

.gallery__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.gallery__section > h2 {
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

.gallery__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-4);
}

.gallery__ground {
    padding: var(--space-5);
    border-radius: var(--radius-card);
    background: var(--color-header);
}

.gallery__frame {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.gallery__sidebar {
    width: 14.5rem;
}

.gallery__phone {
    max-width: 24.375rem;
}

.gallery__note {
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17.5rem, 100%), 1fr));
    gap: var(--space-5);
}

.form__rows {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

/* The note under the home page's three reasons, as a soft box on a phone */
@media (max-width: 40rem) {
    .fineprint {
        padding: var(--space-4);
        border-radius: var(--radius-card);
        background: var(--color-canvas);
        font-size: var(--text-sm);
        line-height: 1.5;
    }

    .hero__actions .btn--lg {
        min-height: var(--target-button);
        font-size: var(--text-base);
    }
}

/* -- Written documents (the privacy policy, the terms) ---------------------------------------- */

.prose {
    gap: var(--space-4);
}

.prose > * {
    max-width: 44rem;
}

.prose h2 {
    margin-block-start: var(--space-4);
    font-size: 1.25rem;
}

.prose h2:first-child {
    margin-block-start: 0;
}

.prose p,
.prose li {
    line-height: 1.6;
}

.prose ul {
    margin: 0;
    padding-inline-start: var(--space-6);
}

.legal__versions ul {
    margin: 0;
    padding-inline-start: var(--space-6);
}

/* -- Sign-in and account pages (boards AppSignIn, AppCreateAccount) ---------------------------------------- */

/* "or" between two ways of doing the one thing: a rule on each side of the word */
.rule-or {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.rule-or::before,
.rule-or::after {
    content: '';
    flex: 1 1 0;
    height: 1px;
    background: var(--color-border);
}

/* The explanation under a card's button, the line under the card, the small print at the foot */
.auth__hint {
    margin: 0;
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.auth__lead {
    margin: 0 0 var(--space-4);
    line-height: 1.5;
}

.auth__alt {
    margin: 0;
    text-align: center;
    font-size: var(--text-md);
}

.auth__alt a {
    font-weight: 600;
}

.auth__note {
    margin: 0;
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
}

/* First and last name side by side where there is room */
.field-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
}

@media (min-width: 40.0625rem) {
    .field-pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* The password's "Forgot your password?" link sits where help does, but reads as a link */
.field__help a {
    font-weight: 500;
}

.legal-changes {
    margin: 0 0 var(--space-5);
    padding-left: var(--space-5);
    line-height: 1.6;
}

/* -- "immunized.ca is an Indinuity product", in the shared footer -------------------- */

.indinuity-credit {
    flex-basis: 100%;
    margin: 0;
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.indinuity-credit a {
    display: inline;
    min-height: 0;
    padding: 0;
    color: inherit;
}

.indinuity-credit__shield {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    margin-right: 0.25em;
    vertical-align: -0.3em;
}

/* -- My family and the family's pages --------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.75rem), 1fr));
    gap: var(--space-4);
}

@media (min-width: 40.0625rem) {
    .card-grid {
        gap: var(--space-5);
    }
}

.card-grid .pill {
    align-self: flex-start;
}

/* Who can see a record, who has access now, the invitations waiting: a name and a line under it, an action beside it */
.guardian-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.guardian-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The buttons that end a form: the main one, then Cancel as a link. On a phone the main button is as wide as the form. */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
}

@media (max-width: 40rem) {
    .form-actions > button.btn {
        flex: 1 1 100%;
    }
}

/* The copies of a record: an icon, the title and what it is, and what can be done with it (S6). */
.copy-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0 0 var(--space-4);
    padding: 0;
    list-style: none;
}

.copy-list__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-3);
}

.copy-list__icon {
    /* With a ten-disease exemption the text is tall: the icon stays beside the title, not in the middle of the card. */
    align-self: start;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.4rem;
    border-radius: var(--radius-control);
    background: var(--color-surface-sunken);
    fill: none;
    stroke: var(--color-muted);
    stroke-width: 1.5;
}

.copy-list__actions {
    display: flex;
    gap: var(--space-4);
}

.copy-list__problem {
    color: var(--color-danger-strong);
}

@media (max-width: 40rem) {
    .copy-list__item {
        grid-template-columns: auto 1fr;
    }

    .copy-list__actions {
        grid-column: 2;
    }
}

/* Every page of one copy, one under the other. */
.copy-pages {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.copy-pages__page {
    margin: 0;
}

.copy-pages__page img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
}

/* Add an exemption (S8): the choice of the two forms, and the diseases of the medical form, each with its permanent or temporary choice. */
.exemption-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr));
    gap: var(--space-3);
}

.exemption-choice {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-control);
    cursor: pointer;
}

.exemption-choice:has(input:checked) {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

.exemption-choice input[type='radio'] {
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    margin: 0.125rem 0 0;
    accent-color: var(--color-primary);
}

.exemption-choice__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.exemption-choice__title {
    font-weight: 600;
}

.exemption-choice__about {
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.exemption-diseases {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.exemption-line {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: var(--space-3);
    min-height: var(--target-min);
}

.exemption-line > input[type='checkbox'] {
    width: 1.375rem;
    height: 1.375rem;
    margin: 0;
    accent-color: var(--color-primary);
}

.exemption-line > label {
    font-size: var(--text-md);
    font-weight: 400;
    cursor: pointer;
}

.exemption-line__terms {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-1) 0 var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
}

/* With the script: a disease that is not ticked shows nothing more, and the date shows only for "Temporary until". */
.exemption-diseases.is-enhanced .exemption-line:not(.is-ticked) .exemption-line__terms,
.exemption-diseases.is-enhanced .exemption-line:not(.is-temporary) .exemption-line__until {
    display: none;
}

/* The admin site (S9): "Step 1 of 2" above the sign-in, the QR code and its key, the ten recovery codes, the team table and the page of one admin. */
.auth__step {
    margin: 0 0 var(--space-1);
    color: var(--color-muted);
    font-size: var(--text-md);
}

.qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 var(--space-5);
    text-align: center;
}

.qr__code {
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    background: var(--color-surface);
}

.qr__code svg {
    display: block;
    width: min(14.5rem, 100%);
    height: auto;
}

.qr__key {
    display: inline-block;
    margin-top: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: 6px;
    background: var(--color-surface-sunken);
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: var(--text-base);
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
}

.recovery-codes {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2) var(--space-5);
    margin: 0 0 var(--space-5);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-8);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    background: var(--color-surface-sunken);
}

.recovery-codes code {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: var(--text-base);
    letter-spacing: 0.04em;
}

@media (min-width: 40.0625rem) {
    .recovery-codes {
        grid-template-columns: 1fr 1fr;
    }
}

.team-table__name {
    font-weight: 600;
}

.team-table td .pill {
    white-space: nowrap;
    margin-top: var(--space-1);
    margin-inline-end: var(--space-1);
}

.team-table__actions {
    text-align: end;
    white-space: nowrap;
}

.team-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.admin-form {
    max-width: 40rem;
}

/* A key shown once: the label above, then the value (broken anywhere, so a long secret never widens a phone), then its copy button. */
.key-secrets {
    margin: 0 0 var(--space-5);
}

.key-secrets dt {
    font-weight: 600;
    margin-block-start: var(--space-4);
}

.key-secrets dd {
    margin: var(--space-1) 0 0;
}

.key-secrets code {
    display: block;
    margin-block-end: var(--space-2);
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* The keys of an organization: one block for each key, so nothing needed (the state, Turn off) is off screen on a phone. */
.key-list {
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
}

.key-list__item {
    border-block-start: 1px solid var(--color-border);
    padding-block: var(--space-3);
}

.key-list__item:first-child {
    border-block-start: 0;
}

.key-list__head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.key-list__head code {
    overflow-wrap: anywhere;
}

.key-list__action {
    margin-block-start: var(--space-2);
}
