/**
 * Smart Traffic — login page (AI command-center split layout)
 */

:root {
    --st-teal: #1bd0c4;
    --st-teal-2: #14a89e;
    --st-accent: #2dd4bf;
    --st-green: #34d36a;
    --st-amber: #ffb020;
    --st-red: #ff4d4f;
    --st-text: #f5f7fa;
    --st-muted: #9aa3b2;
    --st-panel: #0c1018;
    --st-panel-2: #11161f;
    --st-field-bg: rgba(255, 255, 255, 0.05);
    --st-field-border: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

.st-login-page {
    margin: 0;
    min-height: 100vh;
    background: #06080d;
    color: var(--st-text);
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.st-login-layout {
    display: grid;
    grid-template-columns: 1fr 460px;
    min-height: 100vh;
}

/* ============================ HERO ============================ */
.st-hero {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: 72% center;
    background-color: #0a0e17;
    padding: 3.2rem 3.4rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.st-hero__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(6, 9, 15, 0.92) 0%, rgba(6, 9, 15, 0.55) 38%, rgba(6, 9, 15, 0.2) 65%, rgba(6, 9, 15, 0.55) 100%),
        linear-gradient(0deg, rgba(6, 9, 15, 0.9) 0%, rgba(6, 9, 15, 0.1) 40%);
    z-index: 1;
}

.st-hero__content {
    position: relative;
    z-index: 3;
    max-width: 460px;
    margin-top: auto;
    margin-bottom: auto;
}

.st-hero__title {
    margin: 0;
    font-size: 2.9rem;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.st-hero__title-accent { color: var(--st-teal); }

.st-hero__subtitle {
    margin: 1rem 0 2.2rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: #d7dce4;
    line-height: 1.35;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.st-hero__stats {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.st-stat {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.st-stat > i {
    font-size: 1.5rem;
    color: var(--st-teal);
    width: 30px;
    text-align: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(27, 208, 196, 0.4));
}

.st-stat > div { display: flex; flex-direction: column; line-height: 1.1; }

.st-stat__num {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.st-stat__label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--st-muted);
}

.st-stat__label--lead {
    font-size: 1.05rem;
    color: var(--st-text);
    letter-spacing: 0.02em;
}

.st-stat__label .is-green { color: var(--st-green); }

/* Traffic alerts */
.st-hero__alerts {
    background: rgba(10, 14, 22, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.95rem 1.1rem;
    max-width: 420px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.st-hero__alerts-head {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #cdd3dd;
    margin-bottom: 0.7rem;
}

.st-hero__alerts-head i { color: var(--st-amber); margin-right: 0.35rem; }

.st-alert {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.st-alert:first-of-type { border-top: none; }
.st-alert > i { font-size: 1rem; flex-shrink: 0; }
.st-alert > i.is-red { color: var(--st-red); }
.st-alert > i.is-amber { color: var(--st-amber); }

.st-alert__text {
    flex: 1;
    font-size: 0.84rem;
    color: #dde1e8;
}

.st-alert__time {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--st-muted);
    letter-spacing: 0.03em;
}

/* Junction markers */
.st-hero__markers { position: absolute; inset: 0; z-index: 2; transform: translateX(16%); }

.st-marker {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translate(-50%, -50%);
}

.st-marker__pin {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.st-marker__pin--green {
    background: var(--st-green);
    box-shadow: 0 0 0 4px rgba(52, 211, 106, 0.18), 0 0 16px rgba(52, 211, 106, 0.6);
    animation: st-marker-blink-green 1.4s ease-in-out infinite;
}
.st-marker__pin--red {
    background: var(--st-red);
    box-shadow: 0 0 0 4px rgba(255, 77, 79, 0.18), 0 0 16px rgba(255, 77, 79, 0.6);
    animation: st-marker-blink-red 1s ease-in-out infinite;
}

@keyframes st-marker-blink-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 106, 0.55), 0 0 14px rgba(52, 211, 106, 0.6);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 12px rgba(52, 211, 106, 0), 0 0 22px rgba(52, 211, 106, 0.9);
        opacity: 0.65;
    }
}

@keyframes st-marker-blink-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.6), 0 0 14px rgba(255, 77, 79, 0.65);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 77, 79, 0), 0 0 24px rgba(255, 77, 79, 0.95);
        opacity: 0.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-marker__pin--green,
    .st-marker__pin--red { animation: none; }
}

.st-marker__label {
    background: rgba(10, 14, 22, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.5;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.st-marker__label b { font-weight: 800; }
.st-marker__label .is-normal { color: var(--st-teal); }
.st-marker__label .is-optimal { color: var(--st-green); }
.st-marker__label .is-busy { color: var(--st-amber); }

/* ============================ AUTH ============================ */
.st-auth {
    background: linear-gradient(180deg, var(--st-panel) 0%, var(--st-panel-2) 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}

.st-auth__inner {
    width: 100%;
    max-width: 340px;
}

.st-auth__brand { text-align: center; margin-bottom: 1.6rem; }

.st-auth__logo {
    max-width: 200px;
    max-height: 160px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
}

.st-auth__name {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.st-auth__title {
    margin: 0.15rem 0 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--st-teal);
}

.st-auth__tagline {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--st-muted);
}

.st-auth__heading {
    text-align: center;
    margin: 0 0 1.3rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #cfd5df;
}

.st-field {
    position: relative;
    margin-bottom: 0.9rem;
}

.st-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.st-auth__form .form-control {
    height: 50px;
    border-radius: 10px;
    border: 1px solid var(--st-field-border);
    background: var(--st-field-bg);
    color: var(--st-text);
    font-size: 0.95rem;
    padding: 0 2.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.st-auth__form .form-control::placeholder { color: rgba(154, 163, 178, 0.85); }

.st-auth__form .form-control:focus {
    border-color: var(--st-teal);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(27, 208, 196, 0.18);
    outline: none;
    color: var(--st-text);
}

.st-field__toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-muted);
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0.25rem;
    line-height: 1;
    background: none;
    border: none;
}

.st-field__toggle:hover { color: var(--st-text); }

.st-auth__remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.2rem 0 1.1rem;
    font-size: 0.875rem;
    color: var(--st-muted);
    cursor: pointer;
}

.st-auth__remember input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--st-teal);
}

.st-auth__error {
    color: #ff7b7b;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.st-auth__submit {
    width: 100%;
    height: 50px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--st-teal) 0%, var(--st-teal-2) 100%);
    color: #04201e !important;
    border: none;
    box-shadow: 0 8px 22px rgba(27, 208, 196, 0.3);
    transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.st-auth__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(27, 208, 196, 0.45);
    filter: brightness(1.05);
}

.st-auth__submit:disabled { opacity: 0.7; cursor: progress; }

.st-auth__divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.2rem 0;
    color: var(--st-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.st-auth__divider::before,
.st-auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.st-auth__sso {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.7rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--st-text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--st-field-border);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.st-auth__sso:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.st-auth__forgot {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    background: none;
    border: none;
    color: var(--st-teal);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    cursor: pointer;
}

.st-auth__forgot:hover { text-decoration: underline; }

.st-auth__footer {
    margin: 1.2rem 0 0;
    text-align: center;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.4);
}

.st-auth__sso-note {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--st-amber);
    min-height: 1rem;
}

/* Background music toggle */
.st-music-toggle {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 50;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    color: var(--st-text);
    background: rgba(12, 16, 24, 0.8);
    border: 1px solid var(--st-field-border);
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.st-music-toggle:hover { transform: translateY(-2px); color: var(--st-teal); }

.st-music-toggle.is-playing {
    color: var(--st-teal);
    border-color: rgba(27, 208, 196, 0.55);
    box-shadow: 0 0 0 0 rgba(27, 208, 196, 0.5);
    animation: st-music-pulse 1.8s ease-out infinite;
}

@keyframes st-music-pulse {
    0% { box-shadow: 0 0 0 0 rgba(27, 208, 196, 0.45); }
    70% { box-shadow: 0 0 0 14px rgba(27, 208, 196, 0); }
    100% { box-shadow: 0 0 0 0 rgba(27, 208, 196, 0); }
}

/* Forgot modal */
.st-login-forgot-modal .modal-content {
    border: none;
    border-radius: 18px;
    background: rgba(17, 22, 31, 0.98);
    color: var(--st-text);
}

.st-login-forgot-modal .modal-header { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.st-login-forgot-modal .modal-title { font-weight: 700; color: var(--st-text); }
.st-auth__subnote { color: var(--st-muted); font-size: 0.9rem; }

.st-login-forgot-modal .form-control {
    height: 48px;
    border-radius: 10px;
    background: var(--st-field-bg);
    border: 1px solid var(--st-field-border);
    color: var(--st-text);
}

.st-login-forgot-modal label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-muted);
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1100px) {
    .st-login-layout { grid-template-columns: 1fr 420px; }
    .st-hero {
        padding: 2.5rem;
        background-position: right center;
    }
    .st-hero__title { font-size: 2.4rem; }
    /* Push the junction markers right so they don't sit under the left text */
    .st-hero__markers { transform: translateX(24%); }
}

@media (max-width: 980px) {
    .st-hero__markers { transform: translateX(30%); }
    /* Keep marker labels from spilling off the right edge */
    .st-hero__markers .st-marker { white-space: nowrap; }
}

@media (max-width: 860px) {
    .st-login-layout { grid-template-columns: 1fr; }
    .st-hero {
        display: none;
    }
    .st-auth {
        border-left: none;
        min-height: 100vh;
        background:
            linear-gradient(180deg, rgba(6, 9, 15, 0.92), rgba(6, 9, 15, 0.92));
    }
    .st-login-page {
        background: #06080d;
    }
}
