/* ============= LOGIN LOADING OVERLAY ============= */
.login-loader {
    display: none;
    view-transition-name: loading-screen;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.login-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.login-loader .spinner-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(167, 139, 250, 0.15);
    border-top-color: #a78bfa;
    animation: spin 1s linear infinite;
}

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

.login-loader .loader-msg-primary {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a78bfa;
    text-align: center;
    min-height: 20px;
    transition: opacity 0.4s ease;
}

.login-loader .loader-msg-secondary {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    min-height: 18px;
    transition: opacity 0.4s ease;
    letter-spacing: 0.01em;
}

.login-loader .loader-msg-primary.fade-out,
.login-loader .loader-msg-secondary.fade-out {
    opacity: 0;
}

.login-loader .loader-dots {
    display: flex;
    gap: 6px;
}

.login-loader .loader-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(167, 139, 250, 0.25);
    transition: background 0.3s ease;
}

.login-loader .loader-dot.active {
    background: #a78bfa;
}

/* ============= LOGIN PAGE SPECIFIC STYLES ============= */

.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(30, 41, 59, 0.8) 100%);
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    padding: 50px 40px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.2);
    width: 100%;
    max-width: 450px;
}

.logo {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.logo-icon {
    width: auto;
    max-width: 200px;
    height: 120px;
    object-fit: contain;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #8b5cf6 !important;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

/* ============= LOGIN FORM ============= */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.form-group input {
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: #000000;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input::placeholder {
    color: #999999;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group input:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.form-group input[type="email"]:-webkit-autofill,
.form-group input[type="password"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #000000 !important;
}

.form-group input[type="email"]:-webkit-autofill:focus,
.form-group input[type="password"]:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
}

.error-text {
    font-size: 12px;
    color: var(--danger);
    min-height: 16px;
    text-align: left;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 12px;
    color: #fca5a5;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

/* ============= LOGIN BUTTONS & LINKS ============= */
.login-form .btn-primary {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.test-credentials {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.test-credentials p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.forgot-password-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.test-credentials small {
    color: var(--primary-light);
    font-weight: 600;
}

/* ============= RESPONSIVE DESIGN ============= */
@media (max-width: 768px) {
    .login-card {
        padding: 35px 25px;
    }

    .login-card .logo-icon {
        max-width: 150px;
        height: 90px;
    }

    .form-group input {
        font-size: 16px; /* Prevents mobile zoom */
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ============= ACCOUNT LOCKOUT MODAL ============= */
.lockout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lockout-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.lockout-modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #2a1620 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(239, 68, 68, 0.12);
    width: 100%;
    max-width: 380px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.lockout-modal.open .lockout-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.lockout-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: #fca5a5;
    animation: lockoutFloat 2.4s ease-in-out infinite;
}

@keyframes lockoutFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.lockout-title {
    margin: 0 0 10px 0;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.lockout-message {
    margin: 0 0 22px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #d1d5db;
}

.lockout-timer {
    font-size: 40px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: #fca5a5;
    margin-bottom: 18px;
}

.lockout-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.lockout-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 999px;
    transition: width 1s linear;
}

.lockout-modal.lockout-expired .lockout-icon-wrap {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
    animation: none;
}

.lockout-modal.lockout-expired .lockout-timer {
    font-size: 18px;
    color: #86efac;
}

.lockout-modal.lockout-expired .lockout-progress-fill {
    background: linear-gradient(90deg, #22c55e, #86efac);
}

@media (max-width: 480px) {
    .lockout-modal-content {
        max-width: 92%;
        padding: 26px 20px;
    }

    .lockout-timer {
        font-size: 32px;
    }
}
