/* 
 * Estilos y animaciones para el login de AAT
 * Sistema de Gestión Integral ISO 9001, 14001, 45001
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Configuración base */
* {
    font-family: 'Inter', sans-serif;
}

/* Fondo degradado con animación */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

/* Animaciones principales */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes drift {
    0% { transform: translateX(0px); }
    100% { transform: translateX(60px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Patrón de fondo ISO */
.iso-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: drift 30s linear infinite;
}

/* Contenedor del login */
.login-container {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideIn 0.8s ease-out;
}

/* Logo */
.logo-container {
    animation: fadeInDown 1s ease-out;
}

/* EFECTOS INDUSTRIALES PARA EL LOGO */
.logo-industrial {
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 
        0 0 30px rgba(102, 126, 234, 0.5),
        0 0 60px rgba(102, 126, 234, 0.3),
        0 0 90px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    animation: logoPulse 2s ease-in-out infinite;
    position: relative;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-industrial:hover {
    transform: scale(1.1) !important;
    box-shadow: 
        0 0 40px rgba(102, 126, 234, 0.8),
        0 0 80px rgba(102, 126, 234, 0.5),
        0 0 120px rgba(102, 126, 234, 0.3);
}

/* Efecto de resplandor dinámico */
.logo-industrial::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 22px;
    z-index: -1;
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Efecto de shimmer en el logo */
.logo-industrial::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: logoShimmer 4s ease-in-out infinite;
}

@keyframes logoShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Contenedor del logo mejorado */
.logo-wrapper-enhanced {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 12px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 25px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.logo-wrapper-enhanced:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.2),
        0 15px 35px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Efecto de pulso en el contenedor del logo */
.logo-pulse-container {
    animation: containerPulse 4s ease-in-out infinite;
}

@keyframes containerPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
    }
    50% { 
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.4);
    }
}

/* Campos del formulario */
.form-field {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.form-field:nth-child(1) { animation-delay: 0.2s; }
.form-field:nth-child(2) { animation-delay: 0.4s; }
.form-field:nth-child(3) { animation-delay: 0.6s; }
.form-field:nth-child(4) { animation-delay: 0.8s; }

/* Campos de entrada */
.input-field {
    transition: all 0.3s ease;
    position: relative;
}

.input-field:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Botón principal */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: all 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Badges ISO */
.iso-badge {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.iso-9001 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.iso-14001 {
    top: 40%;
    right: 10%;
    animation-delay: 0.5s;
}

.iso-45001 {
    bottom: 30%;
    left: 15%;
    animation-delay: 1s;
}

/* Iconos flotantes */
.floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.3);
    animation: floatIcon 6s ease-in-out infinite;
}

.icon-1 { top: 25%; left: 85%; animation-delay: 0s; }
.icon-2 { top: 65%; right: 85%; animation-delay: 2s; }
.icon-3 { bottom: 20%; left: 5%; animation-delay: 4s; }

/* Efectos de texto */
.title-glow {
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* Información del sistema */
.system-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    animation: fadeIn 1.2s ease-out;
}

/* Badges de características */
.feature-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    margin: 4px;
    font-size: 0.75rem;
    color: white;
    font-weight: 500;
    animation: fadeInScale 0.8s ease-out;
    animation-fill-mode: both;
}

.feature-badge:nth-child(1) { animation-delay: 0.1s; }
.feature-badge:nth-child(2) { animation-delay: 0.2s; }
.feature-badge:nth-child(3) { animation-delay: 0.3s; }
.feature-badge:nth-child(4) { animation-delay: 0.4s; }

/* Mensajes de error y éxito */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    color: #dc2626;
    animation: shake 0.5s ease-in-out;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    color: #059669;
    animation: slideDown 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .iso-badge {
        font-size: 0.65rem;
        padding: 6px 8px;
    }
    
    .floating-icon {
        display: none;
    }
    
    .system-info {
        padding: 15px;
    }
    
    .login-container {
        padding: 20px;
    }
}

/* Efectos hover adicionales */
.input-field input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Animación de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease-out 2s forwards;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

/* Efectos de partículas */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle 8s linear infinite;
}

@keyframes particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Variables CSS personalizadas */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #333;
    --bg-overlay: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
} 