/* ============================================================================
   Auth screens (login / register). Static SSR pages, so this is plain CSS — no
   MudBlazor here. Palette and type deliberately match the app: navy #14315C,
   gold #C9A227, light surfaces, Poppins display + Roboto body (both loaded in
   App.razor). The navy "brand panel" is the one bold element; the form stays quiet.
   ============================================================================ */

:root {
    --auth-navy:      #14315C;
    --auth-navy-dark: #0E2647;
    --auth-navy-soft: #294B7C;
    --auth-gold:      #C9A227;
    --auth-gold-soft: #E8C15A;
    --auth-bg:        #F4F6F9;
    --auth-surface:   #FFFFFF;
    --auth-text:      #23262B;
    --auth-muted:     #5B6472;
    --auth-line:      #E1E5EC;
    --auth-error:     #D1435B;
    --auth-radius:    14px;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(1100px 500px at 8% -10%, rgba(201, 162, 39, 0.08), transparent 60%),
        var(--auth-bg);
    font-family: Roboto, "Segoe UI", Helvetica, Arial, sans-serif;
    color: var(--auth-text);
}

/* ---- Split shell: navy brand panel | white form ---- */
.auth-shell {
    width: 100%;
    max-width: 940px;
    display: grid;
    grid-template-columns: 0.86fr 1fr;
    background: var(--auth-surface);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(20, 49, 92, 0.16);
}

@media (prefers-reduced-motion: no-preference) {
    .auth-shell {
        animation: auth-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    @keyframes auth-rise {
        from { opacity: 0; transform: translateY(14px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ---- Brand panel (the signature) ---- */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 34px;
    color: #fff;
    background:
        radial-gradient(520px 300px at 120% -8%, rgba(201, 162, 39, 0.22), transparent 62%),
        linear-gradient(158deg, var(--auth-navy) 0%, var(--auth-navy-dark) 100%);
    overflow: hidden;
}

/* Faint "ledger rule" hairlines — a quiet nod to the stipend ledger the product keeps. */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.05) 0,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 34px);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%);
            mask-image: linear-gradient(to bottom, transparent, #000 40%);
    pointer-events: none;
}

.auth-brand__inner { position: relative; }

.auth-brand__logo {
    height: 46px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
    margin-bottom: 22px;
}

/* Monogram tile when no logo is configured — gold on a translucent well, like the app-bar mark. */
.auth-brand__mark {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--auth-gold);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(201, 162, 39, 0.45);
}

.auth-brand__name {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.auth-brand__tagline {
    margin: 14px 0 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    max-width: 30ch;
}

.auth-brand__foot {
    position: relative;
    margin-top: 28px;
    padding-top: 16px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* ---- Form pane ---- */
.auth-formpane {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 40px;
}

.auth-card {
    width: 100%;
    max-width: 360px;
}

.auth-title {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0 0 6px;
    color: var(--auth-navy);
}

.auth-subtitle {
    color: var(--auth-muted);
    font-size: 0.95rem;
    margin: 0 0 26px;
    line-height: 1.5;
}

.auth-field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.auth-field label {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 7px;
    color: var(--auth-text);
}

.auth-field input {
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid var(--auth-line);
    background: #fff;
    color: var(--auth-text);
    font-size: 0.98rem;
    font-family: inherit;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.auth-field input::placeholder { color: #9aa2ad; }

.auth-field input:hover { border-color: #c4ccd6; }

.auth-field input:focus {
    outline: none;
    border-color: var(--auth-navy);
    box-shadow: 0 0 0 3px rgba(20, 49, 92, 0.14);
}

.auth-field .validation-message {
    color: var(--auth-error);
    font-size: 0.8rem;
    margin-top: 6px;
}

.auth-button {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: none;
    border-radius: 9px;
    background: var(--auth-gold);
    color: #2A2000;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(201, 162, 39, 0.26);
    transition: background 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.auth-button:hover { background: var(--auth-gold-soft); transform: translateY(-1px); }
.auth-button:active { transform: translateY(0); }

.auth-button:focus-visible,
.auth-link:focus-visible {
    outline: 3px solid rgba(20, 49, 92, 0.35);
    outline-offset: 2px;
}

.auth-error {
    background: rgba(209, 67, 91, 0.09);
    border: 1px solid rgba(209, 67, 91, 0.4);
    color: #A5273B;
    padding: 11px 13px;
    border-radius: 9px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-meta {
    margin: 22px 0 0;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-link {
    color: var(--auth-navy);
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
}
.auth-link:hover { text-decoration: underline; }

.auth-note {
    margin: 18px 0 0;
    padding: 10px 12px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--auth-muted);
    background: var(--auth-bg);
    border: 1px dashed var(--auth-line);
    border-radius: 9px;
}

/* ---- Responsive: collapse to a single column, brand becomes a compact banner ---- */
@media (max-width: 820px) {
    .auth-shell { grid-template-columns: 1fr; max-width: 440px; }

    .auth-brand {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 22px 24px;
    }
    .auth-brand__inner { display: flex; align-items: center; gap: 14px; }
    .auth-brand__logo,
    .auth-brand__mark { margin-bottom: 0; }
    .auth-brand__logo { height: 38px; }
    .auth-brand__mark { width: 44px; height: 44px; font-size: 1.25rem; }
    .auth-brand__name { font-size: 1.25rem; }
    .auth-brand__tagline,
    .auth-brand__foot { display: none; }

    .auth-formpane { padding: 30px 24px 34px; }
    .auth-card { max-width: none; }
}
