/*
   Sign-in page only. Loaded after styles.css and scoped entirely to .auth-*
   selectors so it cannot reach any other page. Every colour, radius and face
   comes from the tokens in styles.css :root — nothing new is invented here.
*/

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 40px 24px;
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-secondary);
}

.auth-shell {
    width: 100%;
    max-width: 26.5rem;
    min-width: 0;
    animation: auth-rise 420ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

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

/* ── Header band ──────────────────────────────────────────────────────────── */

.auth-band {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 20px 26px;
    background: var(--surface-strong);
    border-bottom: 5px solid var(--brand-magenta);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

/* Inverted tile keeps the brand mark distinct against the teal band. */
.auth-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-band-text {
    min-width: 0;
}

.auth-org {
    color: var(--brand-mint-on-dark);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-band-text h1 {
    margin-top: 3px;
    color: var(--text-on-dark);
    font-size: 1.04rem;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* ── Form body ────────────────────────────────────────────────────────────── */

.auth-body {
    padding: 26px;
}

.auth-body h2 {
    margin: 6px 0 20px;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.15;
}

/* .error-banner ships with margin-top; this page needs it above the form. */
.auth-body .error-banner {
    margin: 0 0 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin-bottom: 16px;
}

.auth-field label {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.auth-field input {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-field input:hover {
    border-color: var(--border-strong);
}

.auth-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
}

.auth-password {
    position: relative;
    display: flex;
}

.auth-password input {
    padding-right: 4.4rem;
}

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    padding: 7px 9px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: color var(--transition), background var(--transition);
}

.auth-reveal:hover {
    color: var(--brand-magenta);
    background: var(--accent-soft);
}

.auth-submit {
    margin-top: 22px;
}

.auth-note {
    margin-top: 20px;
    padding-top: 16px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ── Pipeline rail ────────────────────────────────────────────────────────── */

/* The four stages a run moves through, in order. The 1px gap over a --border
   ground draws the dividers, so it re-flows to any column count unchanged. */
.auth-rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    counter-reset: stage;
    background: var(--border);
    border-top: 1px solid var(--border);
    list-style: none;
}

.auth-rail li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 12px 12px 13px;
    counter-increment: stage;
    background: var(--surface-muted);
}

.auth-rail li::before {
    content: counter(stage, decimal-leading-zero);
    color: var(--brand-magenta);
    font-family: var(--mono);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
}

.auth-rail span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-transform: uppercase;
}

/* ── Narrow viewports ─────────────────────────────────────────────────────── */

@media (max-width: 30rem) {
    .auth-page {
        padding: 24px 16px;
    }

    .auth-band,
    .auth-body {
        padding: 20px;
    }

    .auth-body h2 {
        font-size: 1.42rem;
    }

    .auth-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell {
        animation: none;
    }
}
