* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #017223 0%, #014d1a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #017223, #014d1a);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 160px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 16px;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #999;
    font-size: 20px;
    z-index: 1;
}

.input-container input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.input-container input:focus {
    outline: none;
    border-color: #017223;
    background: white;
    box-shadow: 0 0 0 3px rgba(1, 114, 35, 0.1);
}

.input-container input::placeholder {
    color: #999;
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #017223;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #017223 0%, #014d1a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(1, 114, 35, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #fee;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c53030;
}

.login-footer {
    border-top: 1px solid #e1e5e9;
    padding-top: 20px;
    margin-top: 20px;
}

.login-footer > p {
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

.demo-accounts {
    display: grid;
    gap: 16px;
}

.demo-section {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #017223;
}

.demo-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.demo-section p {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

/* Role-specific styling */
.login-card.business-analyst::before {
    background: linear-gradient(90deg, #017223, #014d1a);
}

.login-card.compliance-department::before {
    background: linear-gradient(90deg, #017223, #014d1a);
}

.login-card.hr-department::before {
    background: linear-gradient(90deg, #017223, #014d1a);
}

/* Loading state */
.login-btn.loading {
    position: relative;
    color: transparent;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .demo-accounts {
        grid-template-columns: 1fr;
    }
}

/* Success animation */
.login-card.success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Forgot link on login */
.form-row-forgot {
    margin: -8px 0 16px;
    text-align: right;
}

.link-forgot {
    color: #017223;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.link-forgot:hover {
    text-decoration: underline;
}

/* MFA step */
.login-step-mfa .login-header h1 {
    font-size: 24px;
}

.mfa-lead {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.mfa-masked-line {
    margin-top: 0;
}

/* Six-digit OTP (MFA + forgot password) */
.otp-form-group {
    margin-bottom: 8px;
}

.otp-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.otp-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 14px 12px;
    border: 2px solid #017223;
    border-radius: 12px;
    background: #fafbfc;
}

.otp-digit {
    width: 44px;
    height: 52px;
    box-sizing: border-box;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    border: 1px solid #c5d4c8;
    border-radius: 8px;
    background: #fff;
}

.otp-digit::placeholder {
    color: #c8ccc9;
}

.otp-digit:focus {
    outline: none;
    border-color: #017223;
    box-shadow: 0 0 0 2px rgba(1, 114, 35, 0.15);
}

.otp-helper {
    color: #017223 !important;
    margin-top: 12px;
}

.otp-helper .helper-icon {
    margin-top: 1px;
}

@media (max-width: 420px) {
    .otp-box {
        gap: 8px;
        padding: 12px 8px;
    }

    .otp-digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
}

.mfa-code-wrap .mfa-code-input {
    padding: 18px 16px;
    font-size: 22px;
    letter-spacing: 0.35em;
    text-align: center;
    font-weight: 600;
    border: 2px solid #017223;
    border-radius: 12px;
    background: #fafbfc;
}

.mfa-code-wrap .mfa-code-input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(1, 114, 35, 0.15);
}

.helper-with-icon {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.helper-with-icon .helper-icon {
    font-size: 18px;
    color: #017223;
    flex-shrink: 0;
}

.mfa-expires {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
    margin-bottom: 16px;
}

.mfa-timer-icon {
    font-size: 20px;
    color: #017223;
}

.remember-row {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #017223;
}

.helper-small {
    font-size: 12px;
    color: #777;
    margin-top: 6px;
    margin-left: 28px;
}

.mfa-divider {
    border-top: 1px solid #e1e5e9;
    margin: 24px 0 16px;
}

.mfa-resend-prompt {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.btn-outline-full {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #017223;
    background: #fff;
    color: #017223;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-outline-full:hover {
    background: #f0f7f2;
}

.btn-outline-full:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-footer-links.mfa-footer-extra {
    justify-content: flex-start;
    margin-top: 20px;
}

.back-login-wrap {
    margin-top: 28px;
    text-align: left;
}

.link-back-login {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #017223;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.link-back-login .material-icons {
    font-size: 18px;
}

.link-back-login:hover {
    text-decoration: underline;
}

/* Password strength (reset page) */
.pwd-strength-bar {
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.pwd-strength-fill {
    height: 100%;
    width: 0;
    background: #017223;
    transition: width 0.2s;
}

.pwd-match {
    font-size: 13px;
    margin-top: 8px;
}

.pwd-match.ok { color: #017223; }
.pwd-match.bad { color: #c53030; }

/* Forgot password — multi-step */
.reset-step .reset-subline {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.reset-step .reset-subline strong {
    color: #1a1a1a;
    font-weight: 600;
}

.reset-code-field {
    width: 100%;
    padding: 16px 18px;
    font-size: 18px;
    letter-spacing: 0.25em;
    text-align: center;
    border: 2px solid #017223;
    border-radius: 12px;
    background: #fafbfc;
}

.reset-code-field:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(1, 114, 35, 0.12);
}

.reset-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.link-inline {
    color: #017223;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.link-inline:hover {
    text-decoration: underline;
}

.reset-pwd-rules {
    margin-top: 10px;
    line-height: 1.4;
} 