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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #02997f 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #02997f, #764ba2);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.logo p {
    color: #666;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #02997f;
    background: white;
    box-shadow: 0 0 0 3px rgba(2, 153, 127, 0.1);
}

.password-field {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1.1rem;
}

.toggle-password:hover {
    color: #333;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #02997f 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(2, 153, 127, 0.3);
}

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

.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid #3c3;
}

.loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #02997f;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #02997f;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.forgot-password a:active {
    color: #027a66;
}

.footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
    color: #666;
    font-size: 0.8rem;
}

/* Estilos para 2FA */
.two-factor-header {
    text-align: center;
    margin-bottom: 2rem;
}

.two-factor-header i {
    font-size: 3rem;
    color: #02997f;
    margin-bottom: 1rem;
    display: block;
}

.two-factor-header h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.two-factor-header p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.two-factor-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 1rem !important;
}

.two-factor-input:focus {
    letter-spacing: 0.5rem;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.two-factor-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.two-factor-actions .btn-secondary {
    flex: 1;
    padding: 0.875rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.two-factor-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.two-factor-actions .btn-login {
    flex: 1;
    margin-top: 0;
}

/* Animaciones para transición entre pasos */
#loginStep, #twoFactorStep {
    animation: fadeIn 0.3s ease;
}

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

/* Estilos para campos deshabilitados */
.form-group input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

/* Estilos para recuperación de contraseña */
.forgot-password-header {
    text-align: center;
    margin-bottom: 2rem;
}

.forgot-password-header i {
    font-size: 3rem;
    color: #02997f;
    margin-bottom: 1rem;
    display: block;
}

.forgot-password-header h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.forgot-password-header p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.forgot-password-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.forgot-password-actions .btn-secondary {
    width: 100%;
    padding: 0.875rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.forgot-password-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

#emailError {
    font-size: 0.85rem;
    padding: 0.5rem;
}

@media (max-width: 480px) {
    .login-container {
        margin: 1rem;
        padding: 2rem;
    }

    .two-factor-actions {
        flex-direction: column;
    }

    .two-factor-actions .btn-secondary,
    .two-factor-actions .btn-login {
        width: 100%;
    }

    .two-factor-input {
        font-size: 1.2rem;
        letter-spacing: 0.3rem;
    }
}
