:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #0f172a;
    --accent-color: #06b6d4;
    --text-color: #ffffff;
    --text-dark: #e2e8f0;
    --text-muted: #cbd5e1;
    --dark-bg: #0f172a;
    --darker-bg: #020617;
    --card-bg: #1e293b;
    --border-color: #334155;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #6366f1, #06b6d4);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --radius-md: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.3) 0%, rgba(30, 41, 59, 0.25) 50%, rgba(15, 23, 42, 0.3) 100%),
                url('../images/login-background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.login-box:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.logo-section {
    text-align: center;
    margin-bottom: 20px;
}

.logo-section img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.brand-name {
    color: var(--accent-color);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.logo-section h2 {
    color: var(--text-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: 'Orbitron', sans-serif;
}

.logo-section p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

/* Bootstrap Nav Pills Styling */
.nav-pills {
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
}

.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.nav-pills .nav-link:hover {
    color: var(--text-color);
    background: rgba(99, 102, 241, 0.1);
}

.nav-pills .nav-link.active {
    background: var(--gradient-primary);
    color: var(--text-color);
    box-shadow: var(--shadow-glow);
}

/* Form Styling */
.form-label {
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: #ffffff !important;
    font-size: 14px;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    color: #ffffff !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control-wrapper {
    position: relative;
    display: block;
    flex: 1;
}

.password-field-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Password Field Wrapper */
.password-field-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field-container .form-control {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Remember Me & Forgot Password */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.forgot-password {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-light);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: var(--text-color);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Back to Home */
.back-to-home {
    text-align: center;
    margin-top: 20px;
}

.back-to-home a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-to-home a:hover {
    color: var(--primary-light);
}

/* Bootstrap Alert Overrides */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left: 3px solid var(--danger-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-left: 3px solid var(--success-color);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
    border-left: 3px solid #f59e0b;
}

.alert .btn-close {
    filter: invert(1);
    opacity: 0.7;
}

/* Back to Home Link Animation */
.back-to-home a i {
    transition: transform 0.3s ease;
}

.back-to-home a:hover i {
    transform: translateX(-3px);
}

/* Loading Modal */
.loading-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

.loading-modal.active {
    display: flex;
}

.loading-modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 50px 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(51, 65, 85, 1);
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

.loading-modal-content h4 {
    color: var(--text-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: 'Orbitron', sans-serif;
}

.loading-modal-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reset Password Modal */
.reset-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.reset-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(99, 102, 241, 0.1);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.reset-modal-header {
    padding: 30px;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reset-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Orbitron', sans-serif;
}

.reset-modal-close {
    font-size: 28px;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.reset-modal-close:hover {
    color: var(--text-color);
    background: rgba(99, 102, 241, 0.1);
    transform: rotate(90deg);
}

.reset-modal-body {
    padding: 30px;
    background: transparent;
}

.reset-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.reset-modal-icon i {
    font-size: 36px;
    color: white;
}

.reset-modal-description {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.6;
    text-align: center;
}

.reset-error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
    border-left: 3px solid var(--danger-color);
}

.reset-success-message {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
    border-left: 3px solid var(--success-color);
}

.reset-auto-close {
    display: none;
    margin-bottom: 15px;
}

.auto-close-text {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    margin-bottom: 8px;
}

.auto-close-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.auto-close-progress {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.1s linear;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 576px) {
    .login-box {
        padding: 30px 20px;
    }

    .logo-section h2 {
        font-size: 24px;
    }
    
    .nav-pills .nav-link {
        font-size: 14px;
        padding: 10px 16px;
    }
}