/* Estilos para el sistema de autenticación */

/* === VALIDACIÓN DE FORMULARIOS === */
.field-error {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Estados de validación para inputs */
.border-green-500 {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.border-red-500 {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.focus\:border-green-500:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.focus\:border-red-500:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* === INDICADOR DE FORTALEZA DE CONTRASEÑA === */
.password-strength {
    margin-top: 8px;
}

.password-strength .bg-red-500 { background-color: #ef4444; }
.password-strength .bg-orange-500 { background-color: #f97316; }
.password-strength .bg-yellow-500 { background-color: #eab308; }
.password-strength .bg-blue-500 { background-color: #3b82f6; }
.password-strength .bg-green-500 { background-color: #10b981; }

/* === BOTONES DE TOGGLE DE CONTRASEÑA === */
/* Estilos específicos para inputs de contraseña */
input[type="password"],
input[type="text"][data-original-type="password"] {
    padding-right: 48px !important;
}

/* Contenedor relativo para posicionamiento */
.relative,
div:has(input[type="password"]),
div:has(input[type="text"][data-original-type="password"]) {
    position: relative !important;
}

/* Forzar posición relativa en contenedores de inputs de contraseña */
input[type="password"]:parent,
input[type="text"][data-original-type="password"]:parent {
    position: relative !important;
}

/* Estilos para el botón toggle */
.password-toggle {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 8px !important;
    color: #6b7280 !important;
    transition: color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    width: 40px !important;
    height: 40px !important;
    outline: none !important;
}

/* Hover effect */
.password-toggle:hover {
    color: #374151 !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-radius: 4px !important;
}

/* Focus effect */
.password-toggle:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* SVG dentro del botón */
.password-toggle svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
    pointer-events: none !important;
}

/* === BOTONES DE CARGA === */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === NOTIFICACIONES === */
.auth-notification {
    min-width: 300px;
    max-width: 400px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === MODAL DE RECUPERACIÓN === */
.recovery-modal {
    backdrop-filter: blur(4px);
}

.recovery-modal .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === FORMULARIOS === */
.auth-form {
    transition: all 0.3s ease;
}

.auth-form input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.auth-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.auth-form .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-form .form-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.auth-form .form-input.success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* === BOTONES SOCIALES === */
.social-auth-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.social-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.social-auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-auth-btn:hover::before {
    left: 100%;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .auth-notification {
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }
    
    .recovery-modal .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .auth-form {
        padding: 1rem;
    }
}

/* === ANIMACIONES ADICIONALES === */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* === ESTADOS DE HOVER MEJORADOS === */
.auth-form .form-input:hover {
    border-color: #9ca3af;
}

.auth-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-form a:hover {
    text-decoration: underline;
}

/* === ACCESIBILIDAD === */
.auth-form input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.auth-form button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* === TEMA OSCURO (OPCIONAL) === */
@media (prefers-color-scheme: dark) {
    .auth-form .form-input {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .auth-form .form-label {
        color: #f9fafb;
    }
    
    .auth-notification {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }
}

/* === MEJORAS VISUALES === */
.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-border {
    position: relative;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4);
    border-radius: 8px;
    padding: 2px;
}

.gradient-border .form-input {
    background: #ffffff;
    border: none;
    border-radius: 6px;
}

/* === ESTADOS DE VALIDACIÓN AVANZADOS === */
.validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

.validation-icon.success {
    color: #10b981;
}

.validation-icon.error {
    color: #ef4444;
}

.validation-icon.loading {
    animation: spin 1s linear infinite;
    color: #6b7280;
}
