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

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow: hidden;
    background: #0c1638;
}

.login-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #0c1638;
    background-image: url('../img/login-hero.svg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.login-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 14, 40, 0.35) 0%,
        rgba(8, 14, 40, 0.5) 50%,
        rgba(8, 14, 40, 0.4) 100%
    );
    pointer-events: none;
}

.card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    background: rgba(8, 4, 42, 0.94);
    border: 1px solid rgba(92, 180, 255, 0.28);
    border-radius: 20px;
    padding: 36px 34px 30px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 24px 64px rgba(0, 0, 0, 0.55),
        0 0 48px rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(16px);
    animation: slideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(92, 180, 255, 0.12);
}

.brand img {
    height: 58px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(92, 180, 255, 0.4));
}

.brand-tagline {
    margin-top: 8px;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(160, 180, 255, 0.52);
    max-width: 260px;
}

.brand-sub {
    margin-top: 10px;
    font-size: 0.72rem;
    color: rgba(160, 190, 255, 0.5);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.card-body {
    flex: 1;
}

.card-body h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.42rem;
    font-weight: 700;
    color: #e8eeff;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 6px;
}

.card-body .subtitle {
    font-size: 0.84rem;
    color: rgba(160, 180, 255, 0.55);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.4;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    line-height: 1.45;
    background: rgba(252, 129, 129, 0.1);
    border: 1px solid rgba(252, 129, 129, 0.28);
    color: #fca5a5;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(160, 180, 255, 0.65);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(92, 180, 255, 0.22);
    border-radius: 10px;
    padding: 12px 14px;
    color: #e8eeff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
    color: rgba(160, 180, 255, 0.28);
}

.field input:focus {
    border-color: #5cb4ff;
    box-shadow: 0 0 0 3px rgba(92, 180, 255, 0.12);
}

.btn-login {
    width: 100%;
    margin-top: 4px;
    padding: 13px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #5b6af7 50%, #6366f1 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 22px rgba(59, 130, 246, 0.4);
}

.btn-login:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.5);
}

.security-badge {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(92, 180, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.68rem;
    color: rgba(160, 180, 255, 0.38);
    text-align: center;
}

.loading-popup {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 30;
}

.loading-popup.show {
    display: flex;
}

.loading-box {
    width: min(300px, 88vw);
    background: #0b1024;
    color: #e8eeff;
    border: 1px solid rgba(92, 180, 255, 0.35);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
}

.loading-box p {
    font-size: 0.95rem;
    margin-top: 12px;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #5cb4ff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 20px 16px;
    }

    .card {
        padding: 28px 22px 24px;
        border-radius: 18px;
    }

    .brand img {
        height: 52px;
    }
}
