/* ==========================================================================
   Card page — one centred card in front of the site
   The staging password, sign-in, the sign-in code and the authenticator
   step. Same tokens and components as the site; no header or navigation.
   ========================================================================== */

.page--card {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-8) var(--shell-gutter);
}

.page--card main {
    width: 100%;
    max-width: 26rem;
}

.card-page__card {
    padding: clamp(1.75rem, 6vw, 2.5rem);
    background: var(--color-surface);
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    animation: rise 0.6s ease both;
}

.card-page__brand {
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-brand);
    font-weight: var(--weight-medium);
    letter-spacing: 0.02em;
}

.card-page__title {
    margin-top: var(--space-6);
    font-size: var(--text-section);
    line-height: 1.15;
    text-wrap: balance;
}

.card-page__intro {
    margin-top: var(--space-3);
}

.card-page .alert {
    margin-top: var(--space-5);
}

.card-page__form {
    display: grid;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.card-page__submit {
    width: 100%;
}

.card-page__note {
    margin-top: var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.card-page__note a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* --- Signing in (auth/frame.php) ------------------------------------------
   One card: on a phone the form alone under the logo; from 56rem a dark panel
   beside it saying what the account holds. A way back to the site under it. */

.page--auth main {
    max-width: 27rem;
}

.auth {
    display: grid;
    gap: var(--space-5);
}

.auth__card {
    display: grid;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    animation: rise 0.6s ease both;
}

.auth__panel {
    display: none;
}

.auth__main {
    display: grid;
    align-content: start;
    padding: clamp(1.75rem, 6vw, 2.75rem);
}

.auth__brand {
    justify-self: start;
    margin-bottom: var(--space-8);
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-brand);
    font-weight: var(--weight-medium);
}

.auth__logo {
    display: block;
    width: auto;
    height: 2.25rem;
}

.auth__title {
    font-size: var(--text-section);
    line-height: 1.15;
    text-wrap: balance;
}

.auth__intro {
    margin-top: var(--space-3);
}

.auth .alert {
    margin-top: var(--space-5);
}

.auth__form {
    display: grid;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.auth__submit {
    width: 100%;
}

.auth__note {
    margin-top: var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.auth__note a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* The address the code went to, with the way back to change it. */
.auth__sent {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-warm);
    border-radius: var(--radius-md);
}

.auth__sent > .icon {
    color: var(--color-accent-text);
}

.auth__sent-text {
    display: grid;
    min-width: 0;
    line-height: 1.35;
}

.auth__sent-label {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

.auth__sent-address {
    color: var(--color-ink);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

.auth__sent-change {
    flex: none;
    margin-left: auto;
    color: var(--color-accent-text);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.auth__back {
    text-align: center;
    font-size: var(--text-sm);
}

.auth__back a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
}

.auth__back a:hover {
    color: var(--color-ink);
}

@media (min-width: 56rem) {
    .page--auth main {
        max-width: 58rem;
    }

    .auth__card {
        grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
        min-height: 32rem;
    }

    .auth__panel {
        display: flex;
        flex-direction: column;
        gap: var(--space-5);
        padding: var(--space-10);
        background: var(--color-surface-dark);
        color: var(--color-text-on-dark-muted);
    }

    .auth__panel-brand {
        color: var(--color-ink-inverse);
        font-family: var(--font-display);
        font-size: var(--text-brand);
        font-weight: var(--weight-medium);
    }

    .auth__panel-logo {
        display: block;
        width: auto;
        height: 2.25rem;
    }

    .auth__panel-title {
        margin-top: var(--space-8);
        color: var(--color-ink-inverse);
        font-family: var(--font-display);
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .auth__panel-list {
        display: grid;
        gap: var(--space-4);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .auth__panel-list li {
        display: flex;
        align-items: flex-start;
        gap: var(--space-3);
        font-size: var(--text-sm);
        line-height: 1.5;
    }

    .auth__panel-list .icon {
        color: var(--color-accent-light);
    }

    .auth__main {
        align-content: center;
        padding: var(--space-12) var(--space-14);
    }

    .auth__brand {
        display: none;
    }
}

/* A six-digit code reads better spaced and centred. */
.input--code {
    font-size: var(--text-lead);
    letter-spacing: 0.3em;
    text-align: center;
}

/* --- The second step (auth/two-factor*.php, recovery-codes.php) ---------- */

.auth__hint {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

/* A form's button read as a quiet link: signing out, a new code. */
.auth__text-button {
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.auth__text-button:hover {
    color: var(--color-ink);
}

.auth__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
}

/* The QR code beside what to do with it; stacked on a phone. */
.auth-qr {
    display: grid;
    gap: var(--space-4);
    align-items: center;
    margin-top: var(--space-6);
    padding: var(--space-4);
    background: var(--color-surface-warm);
    border-radius: var(--radius-md);
}

.auth-qr__code {
    justify-self: center;
    width: 10.5rem;
    padding: var(--space-2);
    background: #fff;
    border-radius: var(--radius-sm);
}

.auth-qr__code svg {
    display: block;
    width: 100%;
    height: auto;
}

.auth-qr__step {
    color: var(--color-ink);
    font-weight: var(--weight-semibold);
}

.auth-qr__alt {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.auth-qr__alt a {
    color: var(--color-accent-text);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

@media (min-width: 30rem) {
    .auth-qr {
        grid-template-columns: auto minmax(0, 1fr);
    }
}

.auth-key {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
}

.auth-key summary {
    color: var(--color-text-muted);
    cursor: pointer;
}

.auth-key__value {
    margin-top: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-sunken);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}

.auth-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin: var(--space-5) 0 0;
    padding: var(--space-4);
    background: var(--color-surface-sunken);
    border-radius: var(--radius-md);
    color: var(--color-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--text-sm);
    list-style: none;
}

/* --- A document to keep: receipt and invoice ------------------------------
   The logo and the kind of document on top, a rule under them, the amount or
   the lines, and the organisation's registered details at the foot. */

.page--card main:has(.receipt) {
    max-width: 40rem;
}

.doc {
    padding: clamp(1.25rem, 5vw, 3rem);
}

/* On a phone the invoice's four columns need every pixel. */
@media (max-width: 30rem) {
    /* Under the logo now, so read from the left like the rest. */
    .doc .doc__meta {
        justify-items: start;
        text-align: left;
    }

    .doc .invoice__lines {
        font-size: var(--text-xs);
    }

    .doc .invoice__lines thead th {
        letter-spacing: 0.02em;
    }

    .doc .invoice__lines .invoice__num {
        padding-left: var(--space-2);
    }
}

.doc__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-5);
    padding-bottom: var(--space-6);
    border-bottom: 2px solid var(--color-accent);
}

.doc__logo {
    display: block;
    width: auto;
    height: 2.75rem;
}

.doc__name {
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-brand);
    font-weight: var(--weight-medium);
}

.doc__meta {
    display: grid;
    justify-items: end;
    gap: var(--space-1);
    text-align: right;
}

.doc__type {
    font-size: var(--text-section);
    line-height: 1.1;
}

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

.doc__meta .invoice__paid {
    margin-top: var(--space-2);
}

.doc__hero {
    margin-top: var(--space-6);
    padding: var(--space-6);
    background: var(--color-surface-warm);
    border-radius: var(--radius-md);
    text-align: center;
}

.doc__eyebrow {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.doc__amount {
    margin-top: var(--space-2);
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 7vw, 3rem);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.doc__lead {
    margin-top: var(--space-2);
    color: var(--color-accent-text);
}

.doc__foot {
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border-card);
}

.doc__foot strong {
    color: var(--color-ink);
    font-weight: var(--weight-semibold);
}

@media print {
    .doc {
        padding: 0;
    }

    .doc__hero {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* --- Donation receipt (modules/Donations/Views/public/receipt.php) --------
   Printable, not a generated PDF — CLAUDE.md's dependency policy rules out
   vendoring a PDF library for this; the donor's own browser print / "Save as
   PDF" is the mechanism, so .no-print hides the on-screen-only hint. */

.receipt__facts {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-6);
    text-align: left;
}

.receipt__fact {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-card);
}

.receipt__fact dt {
    color: var(--color-text-muted);
}

.receipt__fact dd {
    margin: 0;
    font-weight: var(--weight-semibold);
    text-align: right;
}

.receipt__divider {
    margin: var(--space-6) 0;
    border: 0;
    border-top: 1px solid var(--color-border-card);
}

.receipt__org {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: 1.6;
}

.receipt__print {
    margin-top: var(--space-5);
    font-size: var(--text-xs);
}

.receipt__download {
    width: 100%;
    margin-top: var(--space-6);
}

.receipt__download + .receipt__print {
    margin-top: var(--space-3);
    text-align: center;
}

/* --- Shop invoice (modules/Shop/Views/public/invoice.php) -----------------
   The receipt's card, wider for a table of lines; printable the same way. */

.page--card main:has(.invoice) {
    max-width: 46rem;
}

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

.invoice__paid {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-pill);
    color: var(--color-accent-text);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invoice__parties {
    display: grid;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

@media (min-width: 40rem) {
    .invoice__parties {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.invoice__label {
    margin-bottom: var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invoice__facts {
    margin-top: 0;
}

.invoice__lines {
    width: 100%;
    margin-top: var(--space-6);
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.invoice__lines th,
.invoice__lines td {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border-card);
    text-align: left;
    vertical-align: top;
}

.invoice__lines thead th {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invoice__lines tfoot th {
    font-weight: var(--weight-medium);
    text-align: right;
    padding-right: var(--space-4);
}

.invoice__lines .invoice__num {
    padding-left: var(--space-3);
    text-align: right;
    white-space: nowrap;
}

.invoice__total th,
.invoice__total td {
    border-bottom: 0;
    color: var(--color-ink);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

.invoice__settled {
    margin-top: var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

@media print {
    .no-print {
        display: none;
    }

    .card-page__card {
        box-shadow: none;
        border: none;
        animation: none;
    }
}

.card-page__brand a {
    display: inline-block;
}

.card-page__logo {
    display: block;
    width: auto;
    height: 2.5rem;
}
