:root {
    --brand-color: #004a7c;
    --brand-gradient: linear-gradient(135deg, #004a7c 0%, #0069b0 100%);
    --bg-overlay: rgba(0, 74, 124, 0.03);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.bg-pattern {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgb(239, 246, 255) 0%, rgb(255, 255, 255) 90%);
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--brand-gradient);
    opacity: 0.05;
    z-index: -1;
    animation: float 10s infinite ease-in-out;
}
.circle-1 { width: 400px; height: 400px; top: -100px; right: -100px; }
.circle-2 { width: 300px; height: 300px; bottom: -50px; left: -50px; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid #fff;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 74, 124, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    position: relative;
}

.brand-logo {
    height: 45px;
    margin-bottom: 1.5rem;
    transition: transform 0.3s;
}
.brand-logo:hover { transform: scale(1.05); }

.login-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-group-custom {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    transition: all 0.2s;
    margin-bottom: 1.2rem;
}

.input-group-custom:focus-within {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 4px rgba(0, 74, 124, 0.1);
    transform: translateY(-1px);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    color: #94a3b8;
    font-size: 1.1rem;
}

.input-group-custom:focus-within .input-icon { color: var(--brand-color); }

.form-control-custom {
    border: none;
    height: 48px;
    width: 100%;
    padding-left: 0;
    font-size: 0.95rem;
    color: #334155;
    background: transparent;
    outline: none;
}
.form-control-custom::placeholder { color: #cbd5e1; }

.btn-toggle-pass {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 10px;
}
.btn-toggle-pass:hover { color: var(--brand-color); }

.btn-login {
    background: var(--brand-gradient);
    border: none;
    border-radius: 12px;
    height: 52px;
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 20px -10px rgba(0, 74, 124, 0.4);
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(0, 74, 124, 0.5);
    background: linear-gradient(135deg, #003a62 0%, #005a96 100%);
}

.form-check-input:checked {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
}

.footer-login {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}
.footer-login a { color: var(--brand-color); text-decoration: none; font-weight: 600; }

.recaptcha-box { display: flex; justify-content: center; margin-bottom: 1.5rem; }

.alert-custom { 
    border: none; 
    border-radius: 12px; 
    font-size: 0.9rem;
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.loading-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
    max-width: 400px;
}

.spinner-premium {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #004a7c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #004a7c;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.loading-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    min-height: 30px;
    transition: all 0.3s ease;
}

.loading-submessage {
    font-size: 0.85rem;
    color: #64748b;
    min-height: 20px;
}

.steps-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.step-dot.active {
    width: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #004a7c 0%, #0069b0 100%);
}

.step-dot.completed {
    background: #10b981;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
}
[data-theme="dark"] .loading-overlay .loading-message { color: #f1f5f9; }
[data-theme="dark"] .loading-overlay .loading-submessage { color: #cbd5e1; }
[data-theme="dark"] .loading-overlay .spinner-circle {
    border-color: #334155;
    border-top-color: #60a5fa;
}
[data-theme="dark"] .loading-overlay .spinner-icon { color: #60a5fa; }
[data-theme="dark"] .loading-overlay .step-dot { background: #334155; }
[data-theme="dark"] .loading-overlay .step-dot.active { background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); }
[data-theme="dark"] .loading-overlay .step-dot.completed { background: #34d399; }

.input-group-custom.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-group-custom.success {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.feedback-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    margin-left: 0.5rem;
    display: none;
}

.feedback-text.show {
    display: block;
}

.feedback-text.error {
    color: #ef4444;
}

.feedback-text.success {
    color: #10b981;
}

.caps-warning {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #f59e0b;
    font-size: 0.85rem;
    display: none;
}

@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .login-title {
        font-size: 1.25rem;
    }
    
    .decoration-circle {
        display: none;
    }
}

.form-control-custom:focus,
.btn-login:focus,
.form-check-input:focus {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

[data-theme="dark"] body {
    background-color: #0f172a !important;
}

[data-theme="dark"] .bg-pattern {
    background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e293b 90%) !important;
}

[data-theme="dark"] .decoration-circle {
    opacity: 0.03 !important;
}

[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(51, 65, 85, 0.6) !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .login-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .login-subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .input-group-custom {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .input-group-custom:focus-within {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .form-control-custom {
    color: #f1f5f9 !important;
    background: transparent !important;
}

[data-theme="dark"] .form-control-custom::placeholder {
    color: #475569 !important;
}

[data-theme="dark"] .input-icon {
    color: #475569 !important;
}

[data-theme="dark"] .input-group-custom:focus-within .input-icon {
    color: #60a5fa !important;
}

[data-theme="dark"] .btn-toggle-pass {
    color: #475569 !important;
}

[data-theme="dark"] .btn-toggle-pass:hover {
    color: #60a5fa !important;
}

[data-theme="dark"] .form-check-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-check-input {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .form-check-input:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .caps-warning {
    color: #fbbf24 !important;
}

[data-theme="dark"] .feedback-text.error {
    color: #f87171 !important;
}

[data-theme="dark"] .feedback-text.success {
    color: #34d399 !important;
}