/* AAMUC Auth Design System — the standalone sign-in experience (and any future standalone auth
   screen: password reset, pending-approval notice, etc.) shares this file rather than re-inlining
   a one-off <style> block per page. Built on top of the app-wide tokens in tokens.css (brand-navy/
   brand-red/focus-ring/etc.) — no parallel token system, this only adds the handful of values a
   full-bleed branded auth page needs that an in-app portal page never does (radial glow stops,
   card elevation). Every color reachable from here traces back to a token, so a future brand
   color change (BrandingSettings.PrimaryColor/SecondaryColor) still flows straight to this page
   via the inline custom-property overrides LogIn.cshtml sets on :root. */

.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.07), transparent 42%),
        radial-gradient(circle at 88% 92%, rgba(var(--auth-red-rgb), 0.16), transparent 48%),
        linear-gradient(150deg, var(--brand-navy) 0%, var(--brand-navy-dark) 55%, var(--brand-navy-darker) 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
    color: #fff;
}

/* Hairline grid — institutional/technical texture, kept just barely visible so it reads as
   "structure" rather than decoration. */
.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    pointer-events: none;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
    min-width: 0; /* flex items default to min-width:auto, which lets a descendant's
                     min-content size force this item — and therefore the whole page — wider
                     than the viewport instead of wrapping text. Without this, narrow phones
                     (<400px) got horizontal overflow/clipping. */
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
    .auth-shell { animation: authRiseIn .5s cubic-bezier(.22, .61, .36, 1) both; }
}
@keyframes authRiseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Institutional identity block ─────────────────────────────────────────────────────── */

.auth-brand { text-align: center; margin-bottom: 1.85rem; }

.auth-seal {
    width: 96px;
    height: 96px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border: 3px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}
.auth-seal img { width: 100%; height: 100%; object-fit: contain; }
.auth-seal .auth-seal-fallback i {
    font-size: 2.1rem;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-name-primary {
    font-size: clamp(1.4rem, 5.2vw, 1.85rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: .015em;
    line-height: 1.15;
    text-wrap: balance;
}
.auth-name-secondary {
    margin-top: .15rem;
    font-size: clamp(.72rem, 2.6vw, .84rem);
    font-weight: 700;
    color: rgba(255, 255, 255, .78);
    letter-spacing: .16em;
    text-transform: uppercase;
}
.auth-name-short {
    display: inline-block;
    margin-top: .55rem;
    color: var(--brand-red);
    font-weight: 700;
    letter-spacing: .22em;
    font-size: .72rem;
    text-transform: uppercase;
}
.auth-tagline {
    color: rgba(255, 255, 255, .58);
    font-size: .78rem;
    margin-top: .3rem;
    font-style: italic;
}

/* ── Card ──────────────────────────────────────────────────────────────────────────────── */

.auth-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 1.15rem;
    box-shadow: 0 24px 60px rgba(3, 10, 26, 0.45);
    padding: 2.1rem 1.9rem 1.75rem;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--brand-navy), var(--brand-red));
}

.auth-card-title {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--color-text);
    text-align: center;
    margin-bottom: .3rem;
}
.auth-card-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: .85rem;
    margin-bottom: 1.6rem;
}

.auth-alert {
    font-size: .82rem;
    padding: .6rem .8rem;
    border-radius: .6rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: .45rem;
}

/* ── Fields ────────────────────────────────────────────────────────────────────────────── */

.auth-field { margin-bottom: 1.05rem; }
.auth-field label {
    display: block;
    font-weight: 600;
    font-size: .8rem;
    color: var(--color-text);
    margin-bottom: .35rem;
}
.auth-input-group {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #dfe3ea;
    border-radius: .6rem;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
    overflow: hidden;
}
.auth-input-group:focus-within {
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 4px var(--focus-ring);
}
.auth-input-group .auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    color: #9aa3b2;
    font-size: .92rem;
    flex-shrink: 0;
}
.auth-input-group input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    padding: .62rem .75rem .62rem 0;
    font-size: .92rem;
    color: var(--color-text);
    background: transparent;
}
.auth-input-group input::placeholder { color: #a2a9b5; }
.auth-toggle-btn {
    border: 0;
    background: transparent;
    color: #9aa3b2;
    width: 2.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .15s ease;
}
.auth-toggle-btn:hover, .auth-toggle-btn:focus-visible { color: var(--brand-navy); }
.auth-toggle-btn:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: -2px; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: .3rem 0 1.35rem;
    flex-wrap: wrap;
}
.auth-check { display: flex; align-items: center; gap: .5rem; }
.auth-check input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--brand-navy);
    cursor: pointer;
}
.auth-check label { font-size: .82rem; color: var(--color-text); cursor: pointer; margin: 0; }
.auth-forgot {
    background: none;
    border: 0;
    padding: 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--brand-navy);
    cursor: pointer;
    text-decoration: none;
}
.auth-forgot:hover { color: var(--brand-red); text-decoration: underline; }

/* ── Submit button ─────────────────────────────────────────────────────────────────────── */

.auth-submit {
    width: 100%;
    border: 0;
    border-radius: .65rem;
    background: var(--brand-navy);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .01em;
    padding: .78rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    transition: background-color .18s ease, transform .1s ease, filter .18s ease;
}
.auth-submit:hover { background: var(--brand-navy-dark); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.auth-submit:disabled { cursor: default; filter: saturate(.7) brightness(.92); }

.auth-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    display: none;
    flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .auth-spinner { animation: authSpin .7s linear infinite; }
}
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-submit.is-loading .auth-spinner { display: inline-block; }
.auth-submit.is-loading .auth-submit-label { opacity: .85; }

/* ── Trust / support / footer ──────────────────────────────────────────────────────────── */

.auth-trust {
    font-size: .74rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1.15rem;
    text-align: center;
}
.auth-support {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
    color: var(--color-text-muted);
    font-size: .8rem;
}
.auth-support a { color: var(--brand-navy); font-weight: 600; text-decoration: none; }
.auth-support a:hover { color: var(--brand-red); text-decoration: underline; }

.auth-footer {
    text-align: center;
    color: rgba(255, 255, 255, .55);
    font-size: .74rem;
    margin-top: 1.85rem;
    line-height: 1.65;
}
.auth-footer a { color: rgba(255, 255, 255, .75); }
.auth-footer .auth-footer-location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-bottom: .2rem;
}

@media (max-width: 380px) {
    .auth-card { padding: 1.7rem 1.35rem 1.5rem; }
    .auth-seal { width: 82px; height: 82px; }
}
