/**
 * ============================================
 * Archivo: login.css
 * Ruta: /ligueo/public/css/login.css
 * Descripción: Estilos personalizados para la página de login
 *              Incluye animaciones, efectos y diseño responsivo
 * ============================================
 */

/* ===================================
   Variables CSS
   =================================== */
:root {
    --ligueo-400: #fb7193;
    --ligueo-500: #f43f6b;
    --ligueo-600: #e11d52;
    --midnight-800: #1a1625;
    --midnight-900: #0f0d13;
    --gradient-primary: linear-gradient(135deg, var(--ligueo-400) 0%, var(--ligueo-600) 100%);
}

/* ===================================
   Base Styles
   =================================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--midnight-900);
    background-image: 
        radial-gradient(ellipse at 20% 80%, rgba(244, 63, 107, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(251, 113, 147, 0.05) 0%, transparent 50%);
}

/* ===================================
   Text Gradient
   =================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shadow {
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Image Side Styles
   =================================== */
.image-side {
    position: relative;
    overflow: hidden;
}

.overlay-gradient {
    background: linear-gradient(
        135deg,
        rgba(15, 13, 19, 0.7) 0%,
        rgba(15, 13, 19, 0.4) 50%,
        rgba(244, 63, 107, 0.2) 100%
    );
}

/* ===================================
   Particle Animation
   =================================== */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--ligueo-400);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite;
}

.particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.particle:nth-child(2) {
    left: 30%;
    top: 60%;
    animation-delay: 2s;
    animation-duration: 18s;
    width: 8px;
    height: 8px;
}

.particle:nth-child(3) {
    left: 70%;
    top: 30%;
    animation-delay: 4s;
    animation-duration: 14s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(4) {
    left: 50%;
    top: 80%;
    animation-delay: 1s;
    animation-duration: 16s;
}

.particle:nth-child(5) {
    left: 85%;
    top: 50%;
    animation-delay: 3s;
    animation-duration: 20s;
    width: 10px;
    height: 10px;
    opacity: 0.2;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-30px) translateX(10px) scale(1.1);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-15px) translateX(-10px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-40px) translateX(5px) scale(1.05);
        opacity: 0.3;
    }
}

/* ===================================
   Form Side Styles
   =================================== */
.form-side {
    background: var(--midnight-900);
    position: relative;
}

.form-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(244, 63, 107, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ===================================
   Input Field Styles
   =================================== */
.input-field {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 4px rgba(244, 63, 107, 0.15),
        0 0 30px rgba(244, 63, 107, 0.1);
}

.input-focused .input-field {
    transform: translateY(-1px);
}

/* Input icon animation */
.form-group:focus-within [data-lucide] {
    color: var(--ligueo-400);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* ===================================
   Button Styles
   =================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    box-shadow: 
        0 0 0 4px rgba(244, 63, 107, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===================================
   Checkbox Custom Style
   =================================== */
input[type="checkbox"] + div {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:checked + div {
    box-shadow: 0 0 15px rgba(244, 63, 107, 0.4);
}

input[type="checkbox"]:focus + div {
    box-shadow: 0 0 0 3px rgba(244, 63, 107, 0.2);
}

/* ===================================
   Animations
   =================================== */

/* Slide up animation */
.slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay {
    animation: fadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error shake animation */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===================================
   Stats Animation
   =================================== */
.stat-item {
    opacity: 0;
    animation: statFadeIn 0.6s ease-out forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.3s; }
.stat-item:nth-child(2) { animation-delay: 0.5s; }
.stat-item:nth-child(3) { animation-delay: 0.7s; }

@keyframes statFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Logo Animation
   =================================== */
.logo-container {
    animation: logoSlide 0.8s ease-out forwards;
}

@keyframes logoSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================
   Password Toggle
   =================================== */
#togglePassword {
    cursor: pointer;
    transition: all 0.2s ease;
}

#togglePassword:hover {
    transform: scale(1.1);
}

#togglePassword:active {
    transform: scale(0.95);
}

/* ===================================
   Link Hover Effects
   =================================== */
a {
    position: relative;
}

a[href*="registro"]::after,
a[href*="recuperar"]::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

a[href*="registro"]:hover::after,
a[href*="recuperar"]:hover::after {
    width: 100%;
}

/* ===================================
   Scrollbar Styles
   =================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--midnight-900);
}

::-webkit-scrollbar-thumb {
    background: var(--ligueo-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ligueo-500);
}

/* ===================================
   Selection Styles
   =================================== */
::selection {
    background: var(--ligueo-500);
    color: white;
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 1024px) {
    .form-side {
        background: 
            linear-gradient(
                to bottom,
                rgba(15, 13, 19, 0.95),
                rgba(15, 13, 19, 0.98)
            ),
            url('https://images.unsplash.com/photo-1516589178581-6cd7833ae3b2?q=80&w=1920&auto=format&fit=crop');
        background-size: cover;
        background-position: center;
    }
}

@media (max-width: 640px) {
    .stat-item span:first-child {
        font-size: 1.5rem;
    }
}

/* ===================================
   Focus Visible for Accessibility
   =================================== */
:focus-visible {
    outline: 2px solid var(--ligueo-400);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible {
    outline: none;
}

/* ===================================
   Placeholder Animation
   =================================== */
.input-field::placeholder {
    transition: all 0.3s ease;
}

.input-field:focus::placeholder {
    opacity: 0.5;
    transform: translateX(5px);
}

/* ===================================
   Glass Effect (optional enhancement)
   =================================== */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   Button Loading State
   =================================== */
.btn-primary:disabled {
    animation: none !important;
    transform: none !important;
}

.btn-primary:disabled:hover {
    transform: none !important;
}

.btn-primary:disabled::before {
    display: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===================================
   Pulse Animation for CTA
   =================================== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(244, 63, 107, 0.3);
    }
    50% {
        box-shadow: 0 10px 60px rgba(244, 63, 107, 0.5);
    }
}

.btn-primary:not(:hover) {
    animation: pulse-glow 3s ease-in-out infinite;
}

.btn-primary:hover {
    animation: none;
    box-shadow: 0 15px 50px rgba(244, 63, 107, 0.4);
}