/* Login and other unauthenticated screens.
 *
 * Loaded instead of Bootstrap: this page shares no components with the admin UI,
 * and Bootstrap's 200KB would fight the layout more than help it. The aesthetic is
 * "clinical editorial" — the restraint of a medical journal, not the gloss of a
 * consumer app. Nothing here is decorative for its own sake.
 */

:root {
    --navy: #1f3864;
    --navy-deep: #142a4d;
    --ink: #101212;
    --muted: #5d636d;
    --faint: #8b919a;
    --line: #e3e5e9;
    --surface: #ffffff;
    --canvas: #f5f6f8;
    --accent: #c8102e;
    --focus: #2f5da8;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.auth {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background: var(--canvas);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---------- The card ---------- */

.auth-card {
    width: 100%;
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow:
        0 1px 1px rgba(16, 18, 18, 0.03),
        0 12px 32px -12px rgba(16, 18, 18, 0.18);
    overflow: hidden;
}

/* ---------- The brand rail ---------- */

.auth-brand {
    position: relative;
    padding: 40px 32px 96px;
    background: var(--navy);
    color: #ffffff;
    overflow: hidden;
}

/* An electrocardiogram trace, drawn rather than imported: it scales to any width,
   weighs nothing, and reads as "medical" without a stock photo of a stethoscope.
   The brand block reserves padding-bottom for it so it can never sit under the text. */
.auth-brand__trace {
    position: absolute;
    inset: auto 0 0 0;
    height: 76px;
    width: 100%;
    opacity: 0.22;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: trace-draw 1.6s 0.15s ease-out forwards;
}

@keyframes trace-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand__trace {
        animation: none;
        stroke-dashoffset: 0;
    }
}

.auth-wordmark {
    position: relative;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.auth-product {
    position: relative;
    margin: 4px 0 0;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.auth-headline {
    position: relative;
    margin: 48px 0 0;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.auth-sub {
    position: relative;
    margin: 12px 0 0;
    max-width: 34ch;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.78);
}

/* ---------- The form ---------- */

.auth-form {
    padding: 40px 32px;
}

.auth-form__title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
}

.auth-form__lead {
    margin: 0 0 28px;
    font-size: 15px;
    color: var(--muted);
}

.field {
    margin-bottom: 20px;
}

.field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.field__input {
    display: block;
    width: 100%;
    /* 16px minimum: anything smaller makes iOS Safari zoom on focus. */
    font-size: 16px;
    font-family: inherit;
    color: var(--ink);
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid #cfd3d9;
    border-radius: 3px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder {
    color: #a6abb3;
}

.field__input:hover {
    border-color: #b6bcc4;
}

.field__input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.14);
}

.field__input[aria-invalid="true"] {
    border-color: var(--accent);
}

.field__error {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: var(--accent);
}

.field__error:empty {
    display: none;
}

/* ---------- Remember ---------- */

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.check__box {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--navy);
    flex: none;
}

.check__label {
    font-size: 15px;
    color: var(--muted);
    cursor: pointer;
}

/* ---------- Submit ---------- */

.btn-enter {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #ffffff;
    background: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.06s ease;
}

.btn-enter:hover {
    background: #172b4d;
    border-color: #172b4d;
}

.btn-enter:active {
    transform: translateY(1px);
}

.btn-enter:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.32);
}

/* ---------- Messages ---------- */

.notice {
    margin-bottom: 22px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 3px;
    border-left: 3px solid var(--accent);
    background: #fdf2f4;
    color: #8c0b21;
}

.notice:empty {
    display: none;
}

.notice ul {
    margin: 0;
    padding-left: 18px;
}

/* ---------- Footer ---------- */

.auth-foot {
    margin: 26px 0 0;
    font-size: 13px;
    text-align: center;
    color: var(--faint);
}

/* ---------- Two columns once there is room ---------- */

@media (min-width: 768px) {
    .auth-card {
        grid-template-columns: 0.86fr 1fr;
    }

    .auth-brand {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 48px 40px;
    }

    .auth-headline {
        margin-top: 0;
        font-size: 34px;
    }

    .auth-form {
        padding: 52px 44px;
    }
}

@media (min-width: 1024px) {
    .auth-form,
    .auth-brand {
        padding-left: 52px;
        padding-right: 52px;
    }
}
