:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --accent: #3b82f6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.login-container {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

/* Decorative background pattern */
.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse-bg 15s ease-in-out infinite;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 500px;
}

.login-right {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    padding: 3rem;
    position: relative;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.top-logo {
    position: absolute;
    top: 2rem;
    right: 2rem;
    max-width: 100px;
    height: auto;
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: auto;
    position: relative;
    padding: 2rem;
    background: white;
    border-radius: 16px;
}

.logo {
    max-width: 60px;
    height: auto;
    margin-bottom: 1.5rem;
}

.brand-logo {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -3px;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.brand-logo-container {
    text-align: center;
}

.company-tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.login-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 2rem 0;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    height: 3rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control:hover {
    border-color: #d1d5db;
    background: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Auth Method Toggle */
.btn-group {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
}

.btn-group .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-group .btn-outline-primary {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    background: #f9fafb;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.btn-group .btn-check:checked + .btn-outline-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.btn-group .btn-outline-primary:hover {
    background: #e5e7eb;
    color: #374151;
}

.btn-group .btn-check:checked + .btn-outline-primary:hover {
    background: var(--primary-hover);
    color: white;
}

/* Fix first/last button border radius */
.btn-group .btn-outline-primary:first-of-type {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn-outline-primary:last-of-type {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.btn-primary {
    width: 100%;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
    min-height: 48px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

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

.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes pulse-bg {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.3; }
}

.alert {
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

.alert-info {
    background-color: #eff6ff;
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
}

.error-message {
    display: none;
}

.error-message.show {
    display: block;
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

.mfa-code-input {
    text-align: center;
    font-size: 1.125rem;
    letter-spacing: 0.1em;
}

.text-center {
    text-align: center;
}

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

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.d-none { display: none; }

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

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

.footer-links {
    text-align: center;
    margin-top: 2rem;
}

.footer-links p {
    margin-bottom: 0.5rem;
}

.footer-links hr {
    margin: 2rem 0 1.5rem 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

.register-section {
    margin-top: 1rem;
}

.register-section p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white !important;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    letter-spacing: 0.025em;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white !important;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-success span {
    color: white !important;
    font-weight: 700;
}

.btn-success i {
    color: white !important;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.footer-links .separator {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.progress {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
}

.success-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left {
        padding: 2rem 1rem;
        text-align: center;
        min-height: 40vh;
    }
    
    .login-right {
        padding: 2rem 1rem;
        min-height: 60vh;
    }
    
    .top-logo {
        position: static;
        margin: 0 auto 2rem auto;
        display: block;
        max-width: 80px;
    }
    
    .brand-logo {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
}
