:root {
    --blue: #205197;
    --cyan: #27b4c8;
    --ink: #08162e;
    --gold: #e6b64d;
    --line: rgba(180, 218, 255, 0.28);
    --panel: rgba(255, 255, 255, 0.14);
    --panel-border: rgba(255, 255, 255, 0.32);
}

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

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #fff;
    background: linear-gradient(120deg, rgba(8, 22, 46, 0.94), rgba(24, 71, 132, 0.8)),
    linear-gradient(32deg, rgba(39, 180, 200, 0.2), transparent 34%, rgba(230, 182, 77, 0.16) 72%, transparent),
    #0a1934;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 78%, transparent);
    opacity: 0.42;
    transform: perspective(760px) rotateX(58deg) translateY(-14%);
    transform-origin: top;
    animation: gridFlow 16s linear infinite;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 18px);
    opacity: 0.24;
}

@keyframes gridFlow {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 0 72px, 72px 0;
    }
}

.network-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-shell {
    position: relative;
    z-index: 2;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 20px 10px;
    width: 100%;
}

.login-panel {
    width: min(570px, 100%);
    padding: 34px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    var(--panel);
    box-shadow: 0 28px 80px rgba(1, 11, 28, 0.42);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    text-align: center;
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 188px;
    height: 74px;
    margin-bottom: 26px;
}

.logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.22));
}

.page-title {
    font-size: 1.7rem;
    font-weight: 750;
    line-height: 1.15;
    margin: 0 0 10px;
    letter-spacing: 0;
}

.page-info {
    font-size: 1.4rem;
    font-weight: 750;
    line-height: 1.15;
    margin: 0 0 10px;
    letter-spacing: 0;
}

.page-subtitle {
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, 0.76);
    max-width: 340px;
    font-size: 1.2rem;
    line-height: 1.55;
}

.alert {
    text-align: left;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.92);
    color: #842029;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
}

.digital-login-btn {
    position: relative;
    width: 100%;
    min-height: 58px;
    padding: 18px 18px 12px 18px;
    border: 0;
    border-radius: 8px;
    color: #10254c;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 720;
    box-shadow: 0 18px 44px rgba(4, 19, 45, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    overflow: hidden;
}

.digital-login-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0 28%, rgba(39, 180, 200, 0.16) 44%, rgba(230, 182, 77, 0.18) 56%, transparent 72% 100%);
    transform: translateX(-100%);
    transition: transform 0.45s ease;
}

.digital-login-btn img,
.digital-login-btn span,
.digital-login-btn i {
    position: relative;
    z-index: 1;
}

.digital-login-btn img {
    height: 24px;
}

.digital-login-btn:hover {
    color: #10254c;
    background: #f8fbff;
    box-shadow: 0 22px 54px rgba(4, 19, 45, 0.42);
    transform: translateY(-2px);
}

.digital-login-btn:hover::before {
    transform: translateX(100%);
}

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 18px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
}

.classic-login-link {
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.93rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.48);
    transition: color 0.18s ease, border-color 0.18s ease;
}

.classic-login-link:hover {
    color: #fff;
    border-color: #fff;
}

.login-footer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 100%;
    padding: 8px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.78rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}

.status-mark {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 18px rgba(230, 182, 77, 0.85);
}

.login-form label {
    text-align: left;
}

.login-form .form-label {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 0.3rem;
}

.login-form .form-control {
    background: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #1e293b !important;
    border-radius: 6px;
}

.login-form .form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

.login-form .form-control:focus {
    background: #ffffff !important;
    border-color: var(--cyan) !important;
    box-shadow: 0 0 0 3px rgba(39, 180, 200, 0.25) !important;
    color: #0f172a !important;
}

.login-form .form-check-input {
    background-color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    cursor: pointer;
}

.login-form .form-check-input:checked {
    background-color: var(--blue) !important;
    border-color: var(--blue) !important;
}

.login-form .invalid-feedback {
    color: #fecaca;
    font-size: 0.78rem;
    text-align: left;
}

.remember-me {
    color: #fff !important;
}

.remember-div, .form-input {
    text-align: left !important;
}

@media (max-height: 840px) {
    .login-shell {
        padding: 16px 16px 6px;
    }
    .login-panel {
        padding: 20px 24px;
        max-width: 490px;
        box-shadow: 0 16px 44px rgba(1, 11, 28, 0.35);
    }
    .logo-wrap {
        width: 125px;
        height: 46px;
        margin-bottom: 10px;
    }
    .page-title {
        font-size: 1.15rem;
        margin-bottom: 4px;
        line-height: 1.25;
    }
    .page-info {
        font-size: 0.95rem;
        margin-bottom: 3px;
    }
    .page-subtitle {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    .login-form .mb-3 {
        margin-bottom: 0.7rem !important;
    }
    .login-form .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    .form-label {
        font-size: 0.82rem;
        margin-bottom: 0.2rem;
    }
    .form-control {
        padding: 0.42rem 0.75rem;
        font-size: 0.85rem;
    }
    .digital-login-btn {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    .divider {
        margin: 10px 0 8px;
        font-size: 0.76rem;
    }
    .classic-login-link {
        font-size: 0.84rem;
        min-height: 30px;
    }
    .login-footer {
        padding: 6px 20px 12px;
        font-size: 0.74rem;
    }
    .status-chip {
        padding: 4px 10px;
        font-size: 0.72rem;
    }
}

@media (max-width: 630px) {
    .login-shell {
        padding: 14px 12px 6px;
    }

    .login-panel {
        padding: 18px 16px;
        border-radius: 8px;
        max-width: 430px;
    }

    .logo-wrap {
        width: 120px;
        height: 44px;
        margin-bottom: 8px;
    }

    .page-title {
        font-size: 1.05rem;
        line-height: 1.25;
        margin: 0 0 4px;
    }

    .page-info {
        font-size: 0.88rem;
        line-height: 1.25;
        margin: 0 0 3px;
    }

    .page-subtitle {
        font-size: 0.8rem;
        margin: 0 auto 10px;
    }

    .alert {
        padding: 8px 12px;
        font-size: 0.78rem;
        margin-bottom: 8px !important;
    }

    .login-form .mb-3 {
        margin-bottom: 0.55rem !important;
    }

    .login-form .mb-4 {
        margin-bottom: 0.65rem !important;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    .form-control {
        padding: 0.38rem 0.65rem;
        font-size: 0.84rem;
    }

    .digital-login-btn {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.86rem;
    }

    .digital-login-btn img {
        height: 18px;
    }

    .divider {
        margin: 8px 0 6px;
        font-size: 0.74rem;
    }

    .classic-login-link {
        min-height: 28px;
        font-size: 0.8rem;
    }

    .login-footer {
        padding: 6px 12px 12px;
        margin-top: 0;
        flex-direction: column;
        text-align: center;
        gap: 4px;
        font-size: 0.7rem;
    }

    .status-chip {
        padding: 3px 8px;
        font-size: 0.68rem;
    }
}

@media (max-width: 380px) {
    .page-title {
        font-size: 0.92rem;
    }
    .page-info {
        font-size: 0.8rem;
    }
    .page-subtitle {
        font-size: 0.74rem;
    }
    .login-panel {
        padding: 15px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
