/* TMS — корпоративная страница входа */
:root {
    --login-gradient-start: #4f46e5;
    --login-gradient-mid: #5B5FEF;
    --login-gradient-end: #7B61FF;
    --login-accent: #5B5FEF;
    --login-accent-hover: #4a47a0;
    --login-text: #0f172a;
    --login-muted: #64748b;
    --login-border: #e2e8f0;
    --login-input-bg: #f0f4ff;
    --login-radius: 20px;
    --login-radius-sm: 12px;
    --login-font: "Commissioner", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --login-shadow: 0 24px 60px rgba(91, 95, 239, 0.14), 0 8px 24px rgba(15, 23, 42, 0.06);
    --login-glass: rgba(255, 255, 255, 0.82);
}

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

html,
body.auth-page {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: var(--login-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--login-text);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    opacity: 0;
    animation: authPageIn 0.65s ease forwards;
}

@keyframes authPageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-animate {
    opacity: 0;
    transform: translateY(12px);
    animation: authFadeUp 0.65s ease forwards;
}

.auth-animate--1 { animation-delay: 0.08s; }
.auth-animate--2 { animation-delay: 0.14s; }
.auth-animate--3 { animation-delay: 0.2s; }
.auth-animate--4 { animation-delay: 0.26s; }
.auth-animate--5 { animation-delay: 0.32s; }
.auth-animate--6 { animation-delay: 0.38s; }
.auth-animate--7 { animation-delay: 0.44s; }

@keyframes authFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Левая панель (50%) ========== */
.auth-hero {
    position: relative;
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    color: #fff;
}

.auth-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 48% 94%;
    display: block;
    filter: contrast(1.14) saturate(1.18) brightness(1.06);
    transform: scale(1.02);
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        165deg,
        rgba(43, 38, 120, 0.4) 0%,
        rgba(67, 56, 202, 0.32) 38%,
        rgba(79, 70, 229, 0.28) 62%,
        rgba(49, 46, 129, 0.22) 100%
    );
    pointer-events: none;
}

.auth-hero__text-scrim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 62%;
    z-index: 2;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.45) 0%,
        rgba(30, 27, 75, 0.28) 45%,
        transparent 100%
    );
    pointer-events: none;
}

.auth-hero__glow {
    position: absolute;
    z-index: 3;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
    animation: authGlowPulse 8s ease-in-out infinite;
}

.auth-hero__glow--1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    background: rgba(129, 140, 248, 0.45);
}

.auth-hero__glow--2 {
    width: 280px;
    height: 280px;
    bottom: 20%;
    left: -80px;
    background: rgba(56, 189, 248, 0.25);
    animation-delay: -3s;
}

@keyframes authGlowPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

.auth-hero__map-wrap {
    position: absolute;
    inset: 0;
    z-index: 4;
    opacity: 0.72;
    pointer-events: none;
}

.auth-route-map {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-route-line {
    stroke-dasharray: 10 14;
    animation: authRouteDash 22s linear infinite;
}

.auth-route-line--alt {
    animation-duration: 28s;
    animation-direction: reverse;
}

.auth-route-line--slow {
    animation-duration: 34s;
}

@keyframes authRouteDash {
    to { stroke-dashoffset: -240; }
}

.auth-gps-pulse {
    animation: authGpsBlink 2.4s ease-in-out infinite;
}

.auth-gps-pulse--ring {
    animation: authGpsRing 2.4s ease-out infinite;
}

.auth-gps-pulse--d1 { animation-delay: 0.5s; }
.auth-gps-pulse--d2 { animation-delay: 1s; }

@keyframes authGpsBlink {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.95; }
}

@keyframes authGpsRing {
    0% { r: 8; opacity: 0.5; }
    100% { r: 22; opacity: 0; }
}

.auth-cargo-dot {
    filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.9));
}

.auth-cargo-dot--glow {
    filter: drop-shadow(0 0 8px rgba(196, 181, 253, 0.85));
}

.auth-hero__top {
    position: relative;
    z-index: 5;
    height: 100%;
    padding: clamp(1.75rem, 3vh, 2.5rem) clamp(1.75rem, 3vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.15rem;
    overflow: hidden;
}

.auth-hero__badge .auth-icon {
    width: 1rem;
    height: 1rem;
    color: #fff;
}

.auth-panel__logo .auth-icon--logo {
    width: 1.75rem;
    height: 1.75rem;
    color: #fff;
}

/* SVG-иконки (не зависят от шрифта Bootstrap Icons) */
.auth-icon {
    display: block;
    flex-shrink: 0;
}

.auth-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.05rem;
    margin-bottom: 0;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
}

.auth-hero__title {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vw, 2.2rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
    max-width: 26rem;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.auth-hero__subtitle {
    margin: 0;
    font-size: clamp(0.95rem, 1.65vw, 1.08rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.94);
    max-width: 30rem;
    font-weight: 400;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.auth-hero__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 32rem;
}

.auth-hero__feature {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-hero__feature-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-hero__feature-icon .auth-icon {
    width: 20px;
    height: 20px;
}

.auth-hero__feature--routes .auth-hero__feature-icon .auth-icon {
    color: #60a5fa;
}

.auth-hero__feature--fleet .auth-hero__feature-icon .auth-icon {
    color: #22c55e;
}

.auth-hero__feature--finance .auth-hero__feature-icon .auth-icon {
    color: #f59e0b;
}

.auth-hero__feature-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-hero__feature strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.12rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.22);
}

.auth-hero__feature span {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: #fff;
    opacity: 0.85;
    font-weight: 400;
}

/* KPI dashboard */
.auth-kpi {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-top: 0.5rem;
    max-width: 34rem;
}

.auth-kpi__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(14px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 24px rgba(125, 211, 252, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-kpi__card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 32px rgba(125, 211, 252, 0.15);
}

.auth-kpi__value {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 0 20px rgba(125, 211, 252, 0.35);
}

.auth-kpi__label {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.82);
}

/* ========== Правая панель (50%) ========== */
.auth-panel {
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;
    max-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(1.25rem, 2.5vh, 2rem) clamp(1.5rem, 3vw, 2.5rem);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
}

.auth-panel__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 28.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    justify-content: flex-start;
    margin-top: clamp(3.5rem, 9vh, 5.5rem);
    padding-bottom: 0.5rem;
}

.auth-panel__brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-panel__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    margin-bottom: 0.85rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #5B5FEF, #7B61FF);
    color: #fff;
    box-shadow:
        0 12px 32px rgba(91, 95, 239, 0.4),
        0 0 40px rgba(123, 97, 255, 0.25);
    animation: logoGlow 3.5s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        box-shadow:
            0 12px 32px rgba(91, 95, 239, 0.4),
            0 0 40px rgba(123, 97, 255, 0.2);
    }
    50% {
        box-shadow:
            0 14px 36px rgba(91, 95, 239, 0.5),
            0 0 56px rgba(123, 97, 255, 0.38);
    }
}

.auth-panel__name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--login-text);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.auth-panel__short {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--login-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Карточка входа — glassmorphism */
.auth-card {
    background: var(--login-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-radius: var(--login-radius);
    padding: 2.5rem 2.5rem 2.25rem;
    box-shadow: var(--login-shadow);
    border: 1px solid rgba(255, 255, 255, 0.65);
    width: 100%;
}

.auth-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--login-text);
}

.auth-card__subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--login-muted);
    line-height: 1.5;
}

.auth-card form {
    display: flex;
    flex-direction: column;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
}

.login-field__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.login-field input[type="text"],
.login-field input[type="password"],
.login-field input[type="email"],
.login-field input.field-input,
.login-field input:not([type="hidden"]):not([type="checkbox"]) {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--login-text);
    background: var(--login-input-bg);
    border: 1px solid transparent;
    border-radius: var(--login-radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-field input::placeholder {
    color: #94a3b8;
}

.login-field input:hover {
    background: #e8eeff;
}

.login-field input:focus {
    outline: none;
    background: #fff;
    border-color: var(--login-accent);
    box-shadow: 0 0 0 4px rgba(92, 89, 182, 0.15);
}

.login-field .errorlist,
.login-field ul.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    color: #dc2626;
}

.auth-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.auth-form-actions--single .login-btn--primary {
    width: 100%;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--login-radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.login-btn--primary {
    flex: 1 1 58%;
    min-width: 11rem;
    min-height: 3.25rem;
    padding: 1rem 1.85rem;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, #5B5FEF, #7B61FF);
    background-size: 120% 120%;
    box-shadow:
        0 10px 28px rgba(91, 95, 239, 0.42),
        0 0 32px rgba(123, 97, 255, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-position 0.35s ease;
}

.login-btn--primary:hover {
    background-position: 100% 50%;
    transform: scale(1.02);
    box-shadow:
        0 14px 36px rgba(91, 95, 239, 0.52),
        0 0 48px rgba(123, 97, 255, 0.32);
    color: #fff;
}

.login-btn--primary:active {
    transform: scale(1);
}

.login-btn--ghost {
    min-height: 3.15rem;
    padding: 0.95rem 1.15rem;
    background: #fff;
    color: var(--login-muted);
    border: 1px solid var(--login-border);
    font-weight: 500;
}

.login-btn--ghost:hover {
    background: #f8fafc;
    color: var(--login-text);
    border-color: #cbd5e1;
}

.auth-footer-link {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.auth-footer-link a {
    color: var(--login-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
    color: var(--login-accent-hover);
}

.auth-devices {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--login-border);
}

.auth-devices__label {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: var(--login-muted);
}

.auth-devices .login-btn--ghost {
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
}

.auth-panel__skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.5rem;
    z-index: 1;
    opacity: 0.42;
    pointer-events: none;
}

.auth-kz-skyline {
    width: 100%;
    height: auto;
    display: block;
}

.auth-panel__copy {
    position: relative;
    z-index: 2;
    margin-top: 1.25rem;
    padding-top: 0.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* 1920×1080 — всё на экран без прокрутки */
@media (min-width: 1600px) and (max-height: 1080px) {
    .auth-hero__bg {
        object-position: 46% 96%;
    }

    .auth-hero__top {
        padding: 2rem 2.75rem 1.25rem;
        gap: 1rem;
    }

    .auth-hero__title {
        font-size: 2rem;
    }

    .auth-hero__subtitle {
        font-size: 1rem;
    }

    .auth-hero__features {
        gap: 16px;
    }

    .auth-kpi {
        margin-top: 0.35rem;
        gap: 0.55rem;
    }

    .auth-kpi__value {
        font-size: 1.35rem;
    }

    .auth-kpi__label {
        font-size: 0.72rem;
    }

    .auth-panel__inner {
        max-width: 30rem;
        margin-top: 7.5vh;
    }

    .auth-panel__brand {
        margin-bottom: 1.25rem;
    }

    .auth-card {
        padding: 2.35rem 2.35rem 2.1rem;
    }
}

@media (min-width: 1600px) and (min-height: 1081px) {
    .auth-hero__bg {
        object-position: 48% 94%;
    }

    .auth-hero__top {
        padding-left: 3.5rem;
        padding-top: 2.5rem;
    }

    .auth-panel__inner {
        max-width: 30rem;
        margin-top: 10vh;
    }

    .auth-card {
        padding: 2.6rem 2.6rem 2.35rem;
    }
}

/* ========== Адаптив ========== */
@media (max-width: 900px) {
    html,
    body.auth-page {
        overflow: auto;
        height: auto;
    }

    .auth-shell {
        flex-direction: column;
        height: auto;
        max-height: none;
        min-height: 100vh;
    }

    .auth-hero,
    .auth-panel {
        flex: none;
        width: 100%;
        height: auto;
        max-height: none;
    }

    .auth-hero {
        min-height: 52vh;
    }

    .auth-hero__bg {
        object-position: 60% 85%;
    }

    .auth-kpi {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }

    .auth-panel {
        min-height: auto;
        padding-bottom: 4.5rem;
    }

    .auth-panel__inner {
        margin-top: 2rem;
        max-width: 28rem;
    }

    .auth-panel__skyline {
        bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1.35rem;
    }

    .auth-form-actions {
        flex-direction: column-reverse;
    }

    .login-btn--ghost,
    .login-btn--primary {
        width: 100%;
    }

    .auth-hero__features {
        gap: 14px;
    }
}
