/**
 * AUTH.CSS - Estilos unificados para Login, Forgot Password, Reset Password, Verify Email
 * Diseño profesional, responsive, compatible con tablet y smartphone
 */

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

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 20px;
    line-height: 1.6;
}

/* Container principal */
.auth-container {
    width: 100%;
    max-width: 420px;
}

/* Card principal */
.auth-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

/* Header con logo */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Logo sin fondo */
.logo-wrapper {
    margin-bottom: 20px;
}

.logo-wrapper img {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}

.logo-fallback {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.logo-fallback i {
    font-size: 35px;
    color: white;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

/* Badge de seguridad */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 15px;
}

/* Iconos de página */
.page-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.page-icon.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.page-icon.success {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}

.page-icon.warning {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.page-icon.danger {
    background: linear-gradient(135deg, #e53935, #ef5350);
}

.page-icon i {
    font-size: 28px;
    color: white;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fafafa;
    color: #333;
}

[dir="rtl"] .form-input {
    padding: 14px 45px 14px 14px;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

[dir="rtl"] .input-icon {
    left: auto;
    right: 15px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #667eea;
}

[dir="rtl"] .toggle-password {
    right: auto;
    left: 15px;
}

/* Botones */
.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #eee;
}

.btn-success {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 160, 71, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn + .btn {
    margin-top: 10px;
}

/* Alertas */
.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
}

.alert i {
    margin-top: 2px;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* Links */
.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 25px 0;
}

/* Selector de idiomas */
.lang-section {
    text-align: center;
}

.lang-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.lang-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* 2FA / Code input */
.code-input {
    width: 100%;
    padding: 18px;
    font-size: 28px;
    text-align: center;
    letter-spacing: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: #fafafa;
}

.code-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Timer */
.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

.timer.warning {
    color: #f57c00;
}

.timer.expired {
    color: #c62828;
}

/* Resend button */
.resend-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    transition: color 0.2s;
}

.resend-btn:hover {
    color: #764ba2;
    text-decoration: underline;
}

.resend-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Password strength */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-fill.weak { width: 25%; background: #e53935; }
.strength-fill.fair { width: 50%; background: #ff9800; }
.strength-fill.good { width: 75%; background: #43a047; }
.strength-fill.strong { width: 100%; background: #2e7d32; }

.strength-text {
    font-size: 11px;
    margin-top: 4px;
    text-align: right;
}

/* Success state */
.success-container {
    text-align: center;
    padding: 20px 0;
}

.success-container .page-icon {
    margin-bottom: 25px;
}

.success-container h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.success-container p {
    color: #666;
    margin-bottom: 25px;
}

/* Responsive */
@media (max-width: 480px) {
    body.auth-page {
        padding: 15px;
    }
    
    .auth-card {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .logo-wrapper img {
        max-width: 100px;
        max-height: 70px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .form-input {
        padding: 12px 12px 12px 40px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    [dir="rtl"] .form-input {
        padding: 12px 40px 12px 12px;
    }
    
    .code-input {
        font-size: 22px;
        letter-spacing: 8px;
        padding: 15px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .lang-buttons {
        flex-direction: column;
    }
    
    .lang-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .auth-card {
        padding: 25px 15px;
    }
    
    .code-input {
        font-size: 18px;
        letter-spacing: 6px;
    }
    
    .page-icon {
        width: 60px;
        height: 60px;
    }
    
    .page-icon i {
        font-size: 24px;
    }
}

/* RTL Support */
[dir="rtl"] .auth-card {
    text-align: right;
}

[dir="rtl"] .auth-header,
[dir="rtl"] .auth-links,
[dir="rtl"] .lang-section,
[dir="rtl"] .success-container {
    text-align: center;
}

[dir="rtl"] .alert {
    flex-direction: row-reverse;
}
