/* ===== ATRIXSYSTEM UI ENHANCEMENTS ===== */

/* Smooth scroll para toda la página */
html {
    scroll-behavior: smooth;
}

/* Variables CSS para colores consistentes */
:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --success-green: #059669;
    --error-red: #dc2626;
    --warning-orange: #d97706;
    --gray-light: #f9fafb;
    --gray-medium: #6b7280;
    --gray-dark: #374151;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-all: all 0.3s ease;
}

/* ===== ANIMACIONES SUTILES ===== */

/* Fade in animation para elementos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== FORMULARIO MEJORADO ===== */

/* Efectos de foco mejorados */
.form-input {
    transition: var(--transition-all);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.form-input.error {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input.success {
    border-color: var(--success-green);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Labels mejorados */
.form-label {
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 8px;
    display: block;
    transition: var(--transition-all);
}

/* Botones mejorados */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition-all);
    position: relative;
    overflow: hidden;
    transform: perspective(1px) translateZ(0);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== ALERTAS Y NOTIFICACIONES ===== */

.alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid;
    animation: slideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background: currentColor;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

/* ===== TARJETAS Y CONTENEDORES ===== */

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: var(--transition-all);
    border: 1px solid #f3f4f6;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

/* ===== EFECTOS DE HOVER MEJORADOS ===== */

.feature-card {
    transition: var(--transition-all);
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-2px) scale(1.02);
    background-color: rgba(255, 255, 255, 0.15);
}

/* ===== NAVEGACIÓN MÓVIL ===== */

#mobile-hamburger {
    display: none;
    transition: var(--transition-all);
}

#mobile-hamburger:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    #mobile-hamburger {
        display: flex;
    }
    
    .card {
        margin: 10px;
    }
    
    .btn-primary {
        width: 100%;
        padding: 16px;
    }
    
    .form-input {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* ===== SCROLL ANIMATIONS ===== */

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== TOOLTIPS ===== */

.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--gray-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-all);
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-dark);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-all);
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ===== LOADING STATES ===== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-all);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para mejor accesibilidad */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */

@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
}

/* Navegación mejorada */
.nav-link.active {
    background-color: rgb(219 234 254); /* bg-blue-50 */
    color: rgb(37 99 235); /* text-blue-600 */
    border-radius: 0.375rem;
}

.nav-link:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Botón de regreso al inicio */
.back-to-home {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin: 2rem 0;
}

.back-to-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.back-to-home i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.back-to-home:hover i {
    transform: translateX(-2px);
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #6b7280;
}

/* Páginas legales - estilos específicos */
.legal-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.legal-header {
    position: relative;
    overflow: hidden;
}

.legal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.legal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin-top: -4rem;
    position: relative;
    z-index: 10;
}

.legal-section {
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.legal-section:last-child {
    border-bottom: none;
}

.legal-section h2 {
    color: #1f2937;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 3rem;
}

.legal-section h2::before {
    content: attr(data-number);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.legal-highlight {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-left: 4px solid #3b82f6;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.legal-important {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.legal-contact-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.legal-date {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Animaciones para páginas legales */
.legal-content {
    animation: slideUpFade 0.6s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-section {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.legal-section:nth-child(1) { animation-delay: 0.1s; }
.legal-section:nth-child(2) { animation-delay: 0.2s; }
.legal-section:nth-child(3) { animation-delay: 0.3s; }
.legal-section:nth-child(4) { animation-delay: 0.4s; }
.legal-section:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive para páginas legales */
@media (max-width: 768px) {
    .legal-content {
        margin-top: -2rem;
        border-radius: 12px;
    }
    
    .legal-section {
        padding: 1.5rem 0;
    }
    
    .legal-section h2 {
        font-size: 1.5rem;
        padding-left: 2.5rem;
    }
    
    .legal-section h2::before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
    
    .back-to-home {
        width: 100%;
        justify-content: center;
        margin: 1.5rem 0;
    }
}