﻿:root {
    --bg: #F6F7F9;
    --surface: #FFFFFF;
    --surface-2: #F1F3F6;
    --surface-3: #E8EBEF;
    --border: #E4E7EC;
    --text: #1A1F29;
    --text-muted: #5B6472;
    --text-faint: #8A93A3;
    --accent: #1B3E70;
    --accent-dim: rgba(27,62,112,0.12);
    --good: #189A6C;
    --bad: #DC3B34;
    --info: #2B7FD9;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,0.05), 0 1px 3px rgba(16,24,40,0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input {
    font-family: inherit;
}

    a:focus-visible, button:focus-visible, input:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
        border-radius: 4px;
    }

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- form side ---------- */
.auth-form-panel {
    flex: 1 1 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-form-wrap {
    width: 100%;
    max-width: 380px;
    animation: rise .45s ease both;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    position: relative;
    flex-shrink: 0;
}

    .brand-dot::before {
        content: '';
        position: absolute;
        inset: -5px;
        border-radius: 50%;
        background: var(--accent);
        opacity: .4;
        animation: pulse-ring 2.2s ease-out infinite;
    }

.status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-faint);
    margin-bottom: 30px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

    .dot.good {
        background: var(--good);
    }

    .dot.pulse::before {
        content: '';
        position: absolute;
        inset: -4px;
        border-radius: 50%;
        background: currentColor;
        opacity: .4;
        animation: pulse-ring 1.8s ease-out infinite;
    }

    .dot.good.pulse {
        color: var(--good);
    }

.auth-form-wrap h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px;
}

.auth-sub {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0 0 28px;
}

.field {
    margin-bottom: 18px;
}

    .field label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-muted);
        margin-bottom: 7px;
    }

    .field input[type="email"], .field input[type="password"] {
        width: 100%;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 11px 13px;
        color: var(--text);
        font-size: 14px;
        transition: border-color .15s ease;
    }

    .field input::placeholder {
        color: var(--text-faint);
    }

    .field input:focus {
        border-color: var(--accent);
        outline: none;
    }

.password-wrap {
    position: relative;
}

    .password-wrap input {
        padding-right: 42px;
    }

.toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-faint);
    padding: 6px;
    border-radius: 6px;
    display: flex;
}

    .toggle-pass:hover {
        color: var(--text-muted);
    }

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

    .checkbox input {
        width: 15px;
        height: 15px;
        accent-color: var(--accent);
        cursor: pointer;
    }

.link-muted {
    font-size: 13px;
    color: var(--text-muted);
}

    .link-muted:hover {
        color: var(--accent);
    }

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: opacity .15s ease;
}

    .btn-primary:hover {
        opacity: .92;
    }

    .btn-primary:disabled {
        opacity: .75;
        cursor: default;
    }

.spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
    display: none;
}

.btn-primary.loading .spinner {
    display: inline-block;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-faint);
    font-size: 12.5px;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

.btn-secondary {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 11px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: var(--shadow-sm);
}

    .btn-secondary:hover {
        background: var(--surface-2);
    }

.auth-footer {
    margin: 26px 0 0;
    font-size: 13px;
    color: var(--text-faint);
    text-align: center;
}

    .auth-footer a {
        color: var(--accent);
        font-weight: 500;
    }

        .auth-footer a:hover {
            text-decoration: underline;
        }

/* ---------- decorative brand side ---------- */
.auth-brand-panel {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    display: none;
    background: radial-gradient(circle at 18% 22%, var(--accent-dim), transparent 55%), radial-gradient(circle at 82% 78%, var(--accent-dim), transparent 50%), var(--surface-2);
    border-left: 1px solid var(--border);
}

.dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .9;
}

.route-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .45;
}

    .route-svg path {
        fill: none;
        stroke: var(--accent);
        stroke-width: 1.6;
        stroke-dasharray: 5 6;
    }

    .route-svg circle {
        fill: var(--accent);
    }

.brand-panel-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
}

    .brand-panel-content h2 {
        font-family: var(--font-display);
        font-size: 26px;
        font-weight: 600;
        margin: 0 0 12px;
        line-height: 1.3;
    }

    .brand-panel-content p {
        color: var(--text-muted);
        font-size: 14px;
        line-height: 1.6;
        margin: 0 0 32px;
    }

.stat-chip-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    flex: 1;
    min-width: 108px;
    box-shadow: var(--shadow-sm);
}

.stat-chip-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stat-chip-label {
    font-size: 11.5px;
    color: var(--text-faint);
    margin-top: 4px;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.6);
        opacity: .6;
    }

    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
