/* ========================================================
   MATRIX TRACKER — LOGIN
======================================================== */

.signin {
    --si-paper: #f3f1ec;
    --si-ink: #16191b;
    --si-ink-2: #3a3f43;
    --si-muted: #6f6c66;
    --si-line: #d6d1c7;
    --si-panel: #1b1f22;
    --si-accent: #d9622b;
    --si-error: #a3301b;

    min-height: 100vh;
    display: grid;
    /* RTL: first column (form) sits on the right */
    grid-template-columns: minmax(380px, 46%) minmax(0, 1fr);
    background: var(--si-paper);
    color: var(--si-ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Brand mark: 3x3 grid, one cell lit */

.mt-mark {
    width: 30px;
    height: 30px;
    flex: none;
    fill: currentColor;
    stroke: none;
}

.mt-mark .lit {
    fill: var(--si-accent, #d9622b);
}

/* ---------- Side panel (map) ---------- */

.signin-side {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    background: var(--si-panel);
    color: #ece9e2;
}

.signin-map {
    position: absolute !important;
    inset: 0;
    z-index: 0;
    background: var(--si-panel);
    cursor: default;
}

/* Warm the Esri dark-gray tiles toward the panel charcoal */
.signin-map .leaflet-tile-pane {
    filter: sepia(.4) saturate(.55) brightness(.72) contrast(1.1);
}

/* app.css sizes every <svg> to 1.35rem; let Leaflet's overlay keep its own size */
.signin-map svg {
    width: auto;
    height: auto;
}

/* Fade the bottom so the name and footer stay readable */
.signin-side::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(27, 31, 34, 0), rgba(27, 31, 34, .92) 55%);
    pointer-events: none;
}

.signin-side > *:not(.signin-map) {
    position: relative;
    z-index: 2;
}

.signin-map .leaflet-control-attribution {
    margin: 8px 0 0 10px;
    padding: 0;
    background: none;
    color: #6f6c66;
    font-size: 10.5px;
}

.signin-map .leaflet-control-attribution a {
    color: inherit;
}

.signin-map path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-district span,
.login-stop-time span {
    display: block;
    white-space: nowrap;
    pointer-events: none;
    text-shadow:
        0 0 3px #1b1f22,
        0 0 3px #1b1f22,
        0 0 6px #1b1f22;
}

.login-district span {
    transform: translate(-50%, -50%);
    color: rgba(236, 233, 226, .38);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.login-stop-time span {
    transform: translate(9px, -50%);
    color: #a7a29a;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    direction: ltr;
}

.login-agent span {
    display: block;
    width: 14px;
    height: 14px;
    border: 3px solid #121517;
    border-radius: 50%;
}

.login-agent.is-live span {
    animation: agentPulse 1.8s ease-out infinite;
}

@keyframes agentPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(217, 98, 43, .55);
    }

    100% {
        box-shadow: 0 0 0 16px rgba(217, 98, 43, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-agent.is-live span {
        animation: none;
    }
}

.signin-side-copy {
    margin: auto 0 32px;
}

.signin-side-copy h1 {
    margin: 0 0 12px;
    font-size: 44px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.01em;
    direction: ltr;
    text-align: right;
}

.signin-side-copy p {
    max-width: 420px;
    margin: 0;
    color: #b3afa6;
    font-size: 15px;
    line-height: 1.9;
}

.signin-side-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid rgba(236, 233, 226, .14);
    color: #8d8a83;
    font-size: 12.5px;
}

/* ---------- Form side ---------- */

.signin-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.signin-form-wrap {
    width: min(100%, 380px);
}

.signin-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    font-size: 17px;
    font-weight: 700;
}

.signin-mobile-brand span {
    direction: ltr;
}

.signin-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
}

.signin-sub {
    margin: 0 0 32px;
    color: var(--si-muted);
    font-size: 14.5px;
    line-height: 1.8;
}

.signin-error {
    margin-bottom: 20px;
    padding: 10px 14px;
    border-inline-start: 3px solid var(--si-error);
    background: #f7e6df;
    color: var(--si-error);
    font-size: 14px;
    line-height: 1.6;
}

.signin-field {
    margin-bottom: 20px;
}

.signin-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--si-ink-2);
    font-size: 13.5px;
    font-weight: 600;
}

.signin-input-wrap {
    position: relative;
}

.signin-field input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--si-line);
    border-radius: 4px;
    outline: none;
    background: #fbfaf7;
    color: var(--si-ink);
    font-size: 15px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.signin-field input::placeholder {
    color: #aaa59b;
}

.signin-field input:hover {
    border-color: #bdb7ab;
}

.signin-field input:focus {
    border-color: var(--si-ink);
    box-shadow: 0 0 0 1px var(--si-ink);
}

.signin-input-wrap input {
    padding-inline-end: 72px;
}

.signin-reveal {
    position: absolute;
    top: 50%;
    inset-inline-end: 6px;
    transform: translateY(-50%);
    padding: 6px 10px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--si-muted);
    font-size: 13px;
    font-weight: 600;
}

.signin-reveal:hover {
    background: #e8e5de;
}

.signin-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 8px;
    border: 0;
    border-radius: 4px;
    background: var(--si-ink);
    color: #f3f1ec;
    font-size: 15px;
    font-weight: 600;
    transition: background 120ms ease;
}

.signin-submit:hover {
    background: #2b3033;
}

.signin-submit:disabled {
    cursor: wait;
    background: #4a4f53;
}

.signin-submit .button-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(243, 241, 236, .3);
    border-top-color: #f3f1ec;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.signin-submit:focus-visible,
.signin-reveal:focus-visible {
    outline: 2px solid var(--si-accent);
    outline-offset: 2px;
}

.signin-help {
    margin: 28px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--si-line);
    color: var(--si-muted);
    font-size: 13px;
    line-height: 1.8;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .signin {
        grid-template-columns: 1fr;
    }

    .signin-side {
        display: none;
    }

    .signin-mobile-brand {
        display: flex;
    }

    .signin-main {
        align-items: flex-start;
        padding: 12vh 16px 32px;
    }
}
