/* ══════════════════════════════════════════════════════════════════════
   THE ENTRY LAYER — Stage 5
   ══════════════════════════════════════════════════════════════════════

   The eleven pages under /Pages have no Blazor layout: each one sets
   `Layout = null` and owns its whole document. Before Stage 5 they linked
   Bootstrap and nothing else, so no token reached them. _KingCareHead
   fixed that. This file fixes the half the stylesheets could not: the
   pages had no shared vocabulary of their own, so /login grew a set of
   `.auth-*` rules, MfaSetup and MfaVerify grew near-identical copies of
   them under `.mfa-*`, and the remaining eight stayed stock Bootstrap.

   Copying /login's block into ten pages would have recreated exactly the
   problem Stage 5 just removed from 126 component stylesheets — literal
   values in a hundred places, drifting apart one page at a time. So the
   vocabulary moves here, once.

   WHAT THESE PAGES ARE, WHICH IS WHY THEY GET THEIR OWN LAYER:
   they are the product's thresholds. Sign in, register a home, accept an
   invitation, prove a second factor, and — 8.1 — an inspector's own front
   door. Each is one task on an empty ground with no navigation, and a
   person on one of them is either arriving or being stopped. The layer is
   therefore built from one shape, the panel, and three ways of saying
   something went well, something needs attention, or something failed.

   COLOUR DISCIPLINE, WHICH THIS LAYER HAD WRONG AND NOW DOES NOT:
   --kc-overdue is the statutory amber. It means a regulatory deadline has
   passed, and it is reserved for that. MfaSetup and MfaVerify were using
   it for a mistyped six-digit code, which is not a compliance state — it
   is an error, and errors are --kc-alert. /login already had this right.
   ══════════════════════════════════════════════════════════════════════ */


/* ══ THE GROUND ════════════════════════════════════════════════════════ */

.kc-entry {
    background: var(--kc-paper);
    min-height: 100vh;
}

/* One task, vertically centred — sign in, verify, confirm. Not used for
   the longer forms, where centring a tall panel puts the submit button
   below the fold on a laptop. */
.kc-entry--center {
    display: flex;
    align-items: center;
}

.kc-entry-shell {
    width: 100%;
    padding-block: var(--kc-space-6);
}

/* ══ THE PANEL ═════════════════════════════════════════════════════════
   The only container in this layer. The 3px evergreen rule under the
   head carries the brand, which is why the heading does not have to be
   large or centred to do it. */

.kc-panel {
    background: var(--kc-card-bg);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--kc-radius);
    box-shadow: var(--kc-shadow-sm);
    overflow: hidden;
}

.kc-panel-head {
    border-bottom: 3px solid var(--kc-evergreen);
    padding: var(--kc-space-5) var(--kc-space-5) var(--kc-space-4);
}

.kc-panel-head h1,
.kc-panel-head h2 {
    font-family: var(--kc-font-heading);
    font-size: var(--kc-text-xl);
    line-height: var(--kc-leading-snug);
    color: var(--kc-ink);
    margin: 0;
}

.kc-panel-head p {
    font-size: var(--kc-text-sm);
    line-height: var(--kc-leading);
    color: var(--kc-slate);
    max-width: var(--kc-measure);
    margin: var(--kc-space-1) 0 0;
}

.kc-panel-body { padding: var(--kc-space-5); }

/* The secondary way out of a threshold page — "register" under sign-in,
   "resend" under check-your-email. Set on paper so it reads as a
   different offer rather than more of the same form. */
.kc-panel-alt {
    border-top: 1px solid var(--kc-card-border);
    background: var(--kc-paper);
    padding: var(--kc-space-4) var(--kc-space-5);
}

.kc-panel-alt p {
    font-size: var(--kc-text-sm);
    color: var(--kc-slate);
    margin: 0 0 var(--kc-space-2);
}

/* ══ SECTIONS WITHIN A LONGER FORM ═════════════════════════════════════
   Register is three questions, not one, and before Stage 5 it separated
   them with Bootstrap's <hr>. A rule between sections says "different
   topic" less clearly than a heading above one does. */

.kc-section-head {
    font-family: var(--kc-font-heading);
    font-size: var(--kc-text-base);
    font-weight: var(--kc-weight-heading);
    color: var(--kc-ink);
    margin: 0 0 var(--kc-space-1);
}

.kc-section-head + .kc-section-note {
    font-size: var(--kc-text-sm);
    color: var(--kc-slate);
    max-width: var(--kc-measure);
    margin: 0 0 var(--kc-space-3);
}

.kc-section + .kc-section {
    border-top: 1px solid var(--kc-card-border);
    margin-top: var(--kc-space-5);
    padding-top: var(--kc-space-5);
}

/* A required field, marked once in ink rather than in Bootstrap's red.
   Red on a label means "you got this wrong"; these fields are not wrong
   yet, they are simply required. */
.kc-req {
    color: var(--kc-slate);
    font-weight: var(--kc-weight-body);
}

/* ══ THE THREE NOTICES ═════════════════════════════════════════════════
   Left-ruled rather than boxed, which is the pattern the product already
   uses for anything that interrupts reading. */

.kc-notice {
    background: var(--kc-sage);
    border-left: 4px solid var(--kc-evergreen);
    color: var(--kc-ink);
    padding: var(--kc-space-3) var(--kc-space-4);
    font-size: var(--kc-text-sm);
    line-height: var(--kc-leading);
}

.kc-notice p:last-child { margin-bottom: 0; }

/* Something failed: a wrong password, an expired link, a mistyped code.
   --kc-alert, never the statutory amber. */
.kc-notice--error {
    background: var(--kc-alert-light);
    border-left-color: var(--kc-alert);
}

/* Something succeeded and the person can stop reading. */
.kc-notice--done {
    background: var(--kc-sage);
    border-left-color: var(--kc-evergreen);
}

/* Something needs an action before continuing — recovery codes about to
   be lost, a rate limit, an invitation that no longer works. Distinct
   from an error because nothing has gone wrong yet. */
.kc-notice--attend {
    background: var(--kc-paper);
    border-left-color: var(--kc-ink);
}

.kc-notice + .kc-notice,
.kc-notice + form,
.kc-notice + p { margin-top: var(--kc-space-4); }

/* ══ TYPE ══════════════════════════════════════════════════════════════ */

.kc-entry-text {
    font-size: var(--kc-text-sm);
    line-height: var(--kc-leading);
    color: var(--kc-slate);
    max-width: var(--kc-measure);
}

.kc-entry-text strong { color: var(--kc-ink); }

.kc-entry-foot {
    font-size: var(--kc-text-xs);
    color: var(--kc-slate);
    text-align: center;
    margin-top: var(--kc-space-4);
}

.kc-entry-foot a { color: var(--kc-slate); }

/* A quiet in-page alternative — "use a recovery code instead". An action,
   so it is not styled as body text, but not a button, because offering
   two buttons of equal weight makes the primary path ambiguous. */
.kc-switch-link {
    font-size: var(--kc-text-sm);
    color: var(--kc-action-primary);
    text-decoration: none;
}

.kc-switch-link:hover { text-decoration: underline; }

/* ══ CODES AND KEYS ════════════════════════════════════════════════════
   Mono, spaced, and tabular — these are read character by character and
   transcribed, usually under mild stress. */

.kc-code-input {
    font-family: var(--kc-font-mono);
    font-size: var(--kc-text-xl);
    letter-spacing: 0.3em;
    text-align: center;
    max-width: 13ch;
}

.kc-code-input--recovery {
    font-size: var(--kc-text-lg);
    letter-spacing: 0.15em;
    max-width: 18ch;
}

.kc-code-hint {
    font-family: var(--kc-font-mono);
    font-size: var(--kc-text-xs);
    color: var(--kc-slate);
    margin-top: var(--kc-space-1);
}

.kc-key-display {
    font-family: var(--kc-font-mono);
    font-size: var(--kc-text-xs);
    background: var(--kc-sage);
    color: var(--kc-ink);
    padding: var(--kc-space-2) var(--kc-space-3);
    letter-spacing: 0.1em;
    word-break: break-all;
}

.kc-recovery-codes {
    font-family: var(--kc-font-mono);
    font-size: var(--kc-text-sm);
    background: var(--kc-sage);
    color: var(--kc-ink);
    padding: var(--kc-space-4);
    column-count: 2;
    column-gap: var(--kc-space-6);
}

.kc-recovery-codes div { padding: var(--kc-space-1) 0; }

.kc-qr {
    text-align: center;
    padding: var(--kc-space-4) 0;
}

.kc-qr img { image-rendering: pixelated; }

/* ══ THE INSPECTOR'S SESSION ════════════════════════════════════════════
   8.1's standing banner, which is shown to the inspector rather than
   hidden from them. It was Bootstrap's near-black; evergreen is the
   product's own authority colour and reads as a system statement rather
   than as a warning. */

.kc-session-bar {
    background: var(--kc-evergreen);
    color: var(--kc-on-primary);
    padding: var(--kc-space-2) 0;
    font-size: var(--kc-text-sm);
}

.kc-session-bar a { color: var(--kc-on-primary); text-decoration: underline; }

/* Counts of what a home holds. The same figure treatment as the Evidence
   Mapper's source cards, deliberately: an inspector seeing both should
   not have to learn two ways of reading a number. Not coloured by value
   — a hue that climbs with a count reads as a quality scale, and no
   surface in this product may imply one. */

.kc-stat {
    background: var(--kc-card-bg);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--kc-radius);
    padding: var(--kc-space-4);
    height: 100%;
}

.kc-stat-figure {
    font-size: var(--kc-text-2xl);
    font-weight: var(--kc-weight-heading);
    font-variant-numeric: tabular-nums;
    line-height: var(--kc-leading-tight);
    color: var(--kc-ink);
}

.kc-stat-what {
    font-size: var(--kc-text-sm);
    font-weight: var(--kc-weight-body-medium);
    color: var(--kc-ink);
    margin-top: var(--kc-space-1);
}

.kc-stat-period {
    font-size: var(--kc-text-xs);
    color: var(--kc-slate);
}

/* ══ THE MARK ══════════════════════════════════════════════════════════
   Confirmation pages had a 3rem glyph in Bootstrap's green or red —
   foreign colours, and ornament where the direction calls for none. A
   small mark in the product's own ink does the same job without
   announcing itself. */

.kc-mark {
    font-size: var(--kc-text-2xl);
    line-height: 1;
    color: var(--kc-evergreen);
    margin-bottom: var(--kc-space-3);
}

.kc-mark--alert { color: var(--kc-alert); }

/* The wordmark above the panel on the front-door pages. */
.kc-entry-logo {
    display: block;
    height: 40px;
    width: auto;
    margin: 0 auto var(--kc-space-5);
}

/* A label with a quiet link at the far end: "Password … Forgot your password?" */
.kc-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--kc-space-2);
}

.kc-label-link {
    font-size: var(--kc-text-sm);
    color: var(--kc-evergreen);
    text-decoration: none;
}

.kc-label-link:hover { text-decoration: underline; }
