/* Sign-in and first-run installer.
 *
 * Both pages are one centred card on the app's own background, so the
 * first thing a person sees already looks like the app they are about to
 * use. Everything visual comes from the shared tokens — this file only
 * lays out a card that the rest of the app has no equivalent for.
 */

.auth-wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--space-6) var(--space-4);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-8) var(--space-6) var(--space-6);
}

/* The installer walks through more than a login does, so it is wider —
   a QR and eight recovery codes need the room. */
.auth-card.wide { max-width: 34rem; }

.auth-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}
.auth-brand img { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.auth-brand h1 {
    margin: 0;
    font-size: var(--font-size-xl);
    line-height: var(--line-tight);
}
.auth-sub {
    margin: calc(var(--space-2) * -1) 0 var(--space-6);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-step { display: none; }
.auth-step.active { display: block; }

.auth-field { margin-bottom: var(--space-4); }
.auth-field label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}
.auth-field input {
    width: 100%;
    height: var(--control-h-lg);
    padding: 0 var(--space-3);
    background: var(--surface-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: var(--font-size-lg);
}
.auth-field input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

/* The six-digit code: wide tracking and a mono face so a typo is
   visible before it is submitted. */
.auth-field input.code {
    font-family: var(--font-mono);
    letter-spacing: .4em;
    text-align: center;
    font-size: var(--font-size-2xl);
}

.auth-actions { display: grid; gap: var(--space-3); margin-top: var(--space-5); }

.auth-or {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.auth-or::before, .auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-msg { margin-top: var(--space-4); }
.auth-msg:empty { display: none; }

.auth-foot {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

/* ── Enrolment ─────────────────────────────────────────────────────── */

.auth-qr {
    display: grid;
    place-items: center;
    padding: var(--space-4);
    background: #fff;           /* the QR ships its own white ground */
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}
.auth-qr svg { width: 100%; max-width: 240px; height: auto; }

.auth-secret {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    word-break: break-all;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    margin-bottom: var(--space-5);
}

/* ── Recovery codes ────────────────────────────────────────────────── */

.auth-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--font-size-lg);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin: var(--space-4) 0;
}
.auth-codes span { text-align: center; padding: var(--space-1) 0; }

.auth-steps-list {
    margin: 0 0 var(--space-5);
    padding-left: var(--space-5);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.7;
}

@media (max-width: 30rem) {
    .auth-card { padding: var(--space-6) var(--space-4) var(--space-4); }
    .auth-codes { grid-template-columns: 1fr; }
}
