/* ============================================
   iLove Telecom - Sistema de Autenticacion
   Estilo Profesional Tigo / Claro / Movistar
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #0066FF;
    --primary-light: #4D94FF;
    --primary-dark: #0052CC;
    --secondary: #7C3AED;
    --accent: #00D4AA;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px -10px rgba(0, 102, 255, 0.3);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* ============================================
   LADO IZQUIERDO - HERO SECTION
   ============================================ */

.auth-side {
    flex: 1;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #312E81 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 50%;
}

/* Patron de fondo animado */
.auth-side::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 102, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 212, 170, 0.05) 0%, transparent 60%);
    animation: bgFloat 20s ease-in-out infinite;
    z-index: 1;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* Grid decorativo */
.auth-side::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
}

.auth-side-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    padding: 3rem;
    color: var(--white);
}

/* Branding */
.auth-side-content .brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-side-content .brand img {
    max-height: 44px;
    display: block;
}

@media (max-width: 991px) {
    .auth-side-content .brand {
        margin: 0 auto 2rem;
        justify-content: center;
    }
}

/* Titulos */
.auth-side-content h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #94A3B8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-side-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 3rem;
    font-weight: 400;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
    cursor: default;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.feature-item i {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-sm);
    color: white;
    flex-shrink: 0;
}

.feature-item span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Decoraciones flotantes */
.auth-side .floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    z-index: 0;
    animation: float 8s ease-in-out infinite;
}

.auth-side .shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 10%;
    right: -100px;
    animation-delay: 0s;
}

.auth-side .shape-2 {
    width: 200px;
    height: 200px;
    background: var(--secondary);
    bottom: 20%;
    left: -50px;
    animation-delay: -3s;
}

.auth-side .shape-3 {
    width: 150px;
    height: 150px;
    background: var(--accent);
    top: 50%;
    left: 30%;
    animation-delay: -5s;
    opacity: 0.2;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}

/* ============================================
   LADO DERECHO - FORMULARIO
   ============================================ */

.auth-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gray-50);
    min-width: 50%;
    position: relative;
}

.auth-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

/* Logo mobile */
.auth-mobile-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-mobile-logo i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-mobile-logo h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin-top: 1rem;
    letter-spacing: -0.02em;
}

/* Header del formulario */
.auth-header {
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--gray-500);
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.auth-header p strong {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    z-index: 2;
    transition: var(--transition);
}

.auth-form .form-control {
    height: 56px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.auth-form .form-control:hover {
    border-color: var(--gray-300);
}

.auth-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1), var(--shadow-md);
    outline: none;
}

.auth-form .form-control:focus + .input-icon,
.auth-form .form-control:focus ~ .input-icon {
    color: var(--primary);
}

.auth-form .form-control::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.auth-form .form-control:disabled {
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: not-allowed;
}

/* Toggle password */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
}

/* Checkbox personalizado */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary);
    border-color: var(--primary);
}

.custom-control-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    font-weight: 500;
    padding-left: 0.5rem;
}

.custom-control-label::before {
    border: 2px solid var(--gray-300);
    border-radius: 4px !important;
    width: 1.25rem;
    height: 1.25rem;
}

/* Links */
.forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.forgot-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.forgot-link:hover::after {
    width: 100%;
}

/* ============================================
   BOTONES
   ============================================ */

.btn-auth {
    height: 56px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.25), 0 0 0 0 rgba(0, 102, 255, 0.4);
    transition: var(--transition);
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.btn-auth::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: var(--transition-slow);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.35), 0 0 0 4px rgba(0, 102, 255, 0.1);
}

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

.btn-auth:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 102, 255, 0.25);
}

.btn-auth-outline {
    height: 56px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    background: var(--white);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-auth-outline:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Boton con icono */
.btn-auth i,
.btn-auth-outline i {
    transition: var(--transition);
}

.btn-auth:hover i {
    transform: translateX(4px);
}

/* ============================================
   DIVIDER
   ============================================ */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.75rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--gray-400);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================
   FOOTER Y EXTRAS
   ============================================ */

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-footer p {
    color: var(--gray-500);
    font-size: 0.9375rem;
    font-weight: 500;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.auth-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

.auth-footer a:hover::after {
    width: 100%;
}

.auth-footer .small {
    font-size: 0.8125rem;
}

/* Form text helper */
.form-text {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.04) 100%);
    color: #DC2626;
    border-left: 4px solid #EF4444;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
    color: #059669;
    border-left: 4px solid #10B981;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
    color: #D97706;
    border-left: 4px solid #F59E0B;
}

.alert-info {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.08) 0%, rgba(0, 102, 255, 0.04) 100%);
    color: #2563EB;
    border-left: 4px solid #3B82F6;
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.auth-form-container {
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-side-content {
    animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .auth-wrapper {
        flex-direction: column;
    }
    
    .auth-side {
        min-height: 280px;
        padding: 2rem 0;
    }
    
    .auth-side-content {
        padding: 2rem;
        text-align: center;
    }
    
    .auth-side-content h2 {
        font-size: 2rem;
    }
    
    .auth-side-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    

    .features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feature-item {
        flex: 1;
        min-width: 200px;
        max-width: 280px;
    }
    
    .feature-item:hover {
        transform: translateY(-4px);
    }
    
    .auth-form-wrapper {
        min-height: auto;
        padding: 2.5rem 1.5rem;
    }
    
    .auth-form-container {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .auth-side {
        min-height: 220px;
        padding: 1.5rem 0;
    }
    
    .auth-side-content {
        padding: 1.5rem;
    }
    
    .auth-side-content h2 {
        font-size: 1.75rem;
    }
    
    .auth-side-content p {
        display: none;
    }
    
    .features {
        display: none;
    }
    
    .auth-form-wrapper {
        padding: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .btn-auth,
    .btn-auth-outline {
        font-size: 0.9375rem;
        height: 52px;
    }
    
    .auth-form .form-control {
        height: 52px;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* Focus visible para accesibilidad */
.auth-form .form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Spinner de carga */
.btn-auth .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
}

/* Estado de carga del boton */
.btn-auth.loading {
    pointer-events: none;
    opacity: 0.8;
}
