/* ==========================================================================
   Auth Login Styles — "Route & Ledger" theme
   --------------------------------------------------------------------------
   Intentionally separate from mk-base.css: the auth layout is a standalone
   screen with its own visual language (navy hero + light sign-in panel).
   See docs/design/ui-theme-redesign-2026-07-27.md for the design rationale.
   ========================================================================== */

/* ############### AUTH TOKENS ############### */
:root {
    --ss-navy-900: #0D1B2E;
    --ss-navy-800: #12263F;
    --ss-navy-700: #1B3A5C;
    --ss-interactive: #0078d4;
    --ss-interactive-dark: #0062ae;
    --ss-accent: #F0A63B;
    --ss-danger: #A4262C;
    --ss-danger-bg: #FBEDEB;
    --ss-danger-border: #F2C7C1;
    --ss-bg: #F4F7FA;
    --ss-card: #FFFFFF;
    --ss-input-bg: #F8F9FA;
    --ss-text: #1A1A1A;
    --ss-text-2: #5B6472;
    --ss-border: #E5E7EB;
    --ss-focus-ring: rgba(74, 144, 226, 0.45);
}

/* Dark mode — only the right-hand sign-in panel changes; the left hero is
   already a dark navy surface by design and needs no adjustment. */
[data-bs-theme="dark"] {
    --ss-card: #1A222C;
    --ss-input-bg: #202932;
    --ss-text: #E8EAED;
    --ss-text-2: #9AA7B5;
    --ss-border: #2A3541;
    --ss-danger-bg: #3A1F1C;
    --ss-danger-border: #5A2E28;
}

[data-bs-theme="dark"] .login-alert {
    color: #F2A99B;
}

.auth-theme-toggle {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 50%;
    color: rgba(255, 255, 255, .75);
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    position: fixed;
    right: 1rem;
    top: 1rem;
    width: 36px;
    z-index: 10;
}

.auth-theme-toggle:hover {
    background-color: rgba(255, 255, 255, .12);
    color: #fff;
}

.auth-theme-toggle .icon-dark {
    display: none;
}

[data-bs-theme="dark"] .auth-theme-toggle .icon-light {
    display: none;
}

[data-bs-theme="dark"] .auth-theme-toggle .icon-dark {
    display: inline-block;
}

@media (max-width: 768px) {
    .auth-theme-toggle {
        color: var(--ss-text-2);
    }

    .auth-theme-toggle:hover {
        background-color: var(--ss-input-bg);
        color: var(--ss-interactive);
    }
}

/* ############### AUTH PAGE LAYOUT ############### */
body.auth-layout {
    background-color: var(--ss-card);
    color: var(--ss-text);
    display: flex;
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

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

/* ############### HERO (LEFT) ############### */
.login-hero {
    background: linear-gradient(135deg, var(--ss-navy-900) 0%, var(--ss-navy-800) 60%, #16304E 100%);
    color: #fff;
    display: flex;
    flex: 1 1 55%;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    padding: 3rem 3.5rem;
    position: relative;
}

.login-hero-routes {
    height: 100%;
    inset: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
}

.login-hero-brand {
    align-items: center;
    display: flex;
    gap: .65rem;
    position: relative;
}

.login-hero-mark {
    align-items: center;
    background: var(--ss-accent);
    border-radius: 10px;
    color: var(--ss-navy-900);
    display: flex;
    font-size: 1.05rem;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    letter-spacing: -.5px;
    width: 38px;
}

.login-hero-mark img {
    height: 22px;
    width: 22px;
}

.login-hero-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.login-hero-name span {
    color: var(--ss-accent);
}

.login-hero-copy {
    max-width: 34rem;
    position: relative;
}

.login-hero-kicker {
    align-items: center;
    color: var(--ss-accent);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 600;
    gap: .5rem;
    letter-spacing: .12em;
    margin-bottom: 1.1rem;
    text-transform: uppercase;
}

.login-hero-kicker::before {
    background: var(--ss-accent);
    border-radius: 2px;
    content: "";
    height: 2px;
    width: 22px;
}

.login-hero-copy h1 {
    font-size: clamp(1.6rem, 2.6vw, 2.35rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.75rem;
}

.login-hero-copy h1 em {
    color: #9CC3F5;
    font-style: normal;
}

.login-feature {
    align-items: flex-start;
    display: flex;
    gap: .85rem;
    margin-bottom: 1.05rem;
}

.login-feature-dot {
    align-items: center;
    border: 1.5px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    color: var(--ss-accent);
    display: flex;
    flex: none;
    font-size: .8rem;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.login-feature p {
    color: rgba(255, 255, 255, .82);
    font-size: .92rem;
    line-height: 1.45;
    padding-top: .3rem;
}

.login-feature p strong {
    color: #fff;
    font-weight: 600;
}

.login-hero-foot {
    color: rgba(255, 255, 255, .65);
    font-size: .78rem;
    position: relative;
}

/* ############### SIGN-IN PANEL (RIGHT) ############### */
.login-panel {
    align-items: center;
    background-color: var(--ss-card);
    display: flex;
    flex: 1 1 45%;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 2.5rem 2rem;
    position: relative;
}

.login-panel-inner {
    max-width: 360px;
    width: 100%;
}

.login-panel-logo {
    align-items: center;
    display: none;
    gap: .6rem;
    margin-bottom: 2.2rem;
}

.login-panel-logo .login-hero-mark {
    background: var(--ss-navy-900);
    color: var(--ss-accent);
}

.login-panel-logo .login-hero-name {
    color: var(--ss-text);
}

.login-panel-logo .login-hero-name span {
    color: var(--ss-interactive);
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--ss-text);
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: .4rem;
}

.login-header p {
    color: var(--ss-text-2);
    font-size: .92rem;
}

/* ############### VALIDATION ALERT ############### */
.login-alert {
    align-items: center;
    background: var(--ss-danger-bg);
    border: 1px solid var(--ss-danger-border);
    border-radius: 8px;
    color: #8C2B20;
    display: flex;
    font-size: .85rem;
    gap: .6rem;
}

.login-alert:not(:empty) {
    margin-bottom: 1.1rem;
    padding: .65rem .85rem;
}

.login-alert ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ############### FORMS AND INPUTS ############### */
.auth-layout .form-control {
    background-color: var(--ss-input-bg);
    border-color: var(--ss-border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    padding: 1rem;
}

.auth-layout .form-control:focus {
    background-color: var(--ss-card);
    border-color: var(--ss-interactive);
    box-shadow: 0 0 0 .22rem var(--ss-focus-ring);
}

.auth-layout .form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1rem 1rem 0;
}

.auth-layout .form-floating > label {
    color: var(--ss-text-2);
    padding: 1rem 1rem 0;
}

.login-field {
    position: relative;
}

.login-field .form-control {
    padding-right: 3.25rem;
}

.login-toggle-pw {
    background: none;
    border: 0;
    color: var(--ss-text-2);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    padding: .35rem .5rem;
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.login-toggle-pw:hover,
.login-toggle-pw:focus-visible {
    color: var(--ss-interactive);
}

/* ############### BUTTONS ############### */
.auth-layout .btn-primary {
    background-color: var(--ss-interactive);
    border-color: var(--ss-interactive);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: .98rem;
    font-weight: 600;
    padding: .85rem;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.auth-layout .btn-primary:hover {
    background-color: var(--ss-interactive-dark);
    border-color: var(--ss-interactive-dark);
}

.auth-layout .btn-primary:focus {
    box-shadow: 0 0 0 .25rem var(--ss-focus-ring);
}

/* ############### LINKS AND FOOTER ############### */
.auth-layout .link-secondary {
    color: var(--ss-interactive);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}

.auth-layout .link-secondary:hover {
    color: var(--ss-interactive-dark);
    text-decoration: underline;
}

.login-panel-foot {
    color: var(--ss-text-2);
    font-size: .8rem;
    margin-top: 3rem;
    text-align: center;
}

/* ############### RESPONSIVE ############### */
@media (max-width: 768px) {
    body.auth-layout {
        min-height: 100dvh;
        overflow: auto;
    }

    .login-hero {
        display: none;
    }

    .login-panel {
        justify-content: flex-start;
        min-height: 100dvh;
        padding: 4rem 1.5rem 2rem;
    }

    .login-panel-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .login-header h2 {
        font-size: 1.35rem;
    }
}

/* P9-4: the auth layout deliberately skips ss-base.css (its own small stylesheet instead of
   the admin shell), so it never picked up the global reduced-motion rule there. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
