/* ========== CSS VARIABLES ========== */
:root {
    --bg-primary: #050505;
    --bg-secondary: #0F172A;
    --primary-500: #3B82F6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent-cyan: #06B6D4;
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========== PARTICLES CANVAS ========== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.2rem 0;
    transition: all 0.3s;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    transition: transform 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    object-fit: contain;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-500);
}

.nav-links a:not(.btn-primary-small)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-500);
    transition: width 0.3s;
}

.nav-links a:not(.btn-primary-small):hover::after {
    width: 100%;
}

.btn-primary-small {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    color: var(--text-primary) !important;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    transition: all 0.3s;
}

.btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
}

.btn-primary-small::after {
    display: none !important;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ========== HERO SECTION ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    filter: blur(100px);
    animation: pulse-glow 8s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, black, transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(10deg); }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.6);
}

.pulse {
    animation: pulse-btn 2s ease-in-out infinite;
}

@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 50px rgba(59, 130, 246, 0.8); }
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 2.5rem;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-outline:hover {
    border-color: var(--primary-500);
    background: rgba(59, 130, 246, 0.1);
}

/* ========== FLOATING NODES ========== */
.floating-nodes {
    position: relative;
    width: 100%;
    height: 400px;
}

.node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
    border: 2px solid var(--primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 6s ease-in-out infinite;
}

.node-pulse {
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--primary-500);
    box-shadow: 0 0 20px var(--primary-500);
    animation: pulse-node 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse-node {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.node-1 { top: 10%; left: 10%; animation-delay: 0s; }
.node-2 { top: 20%; right: 15%; animation-delay: 1s; }
.node-3 { top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: 2s; }
.node-4 { bottom: 20%; left: 20%; animation-delay: 1.5s; }
.node-5 { bottom: 15%; right: 10%; animation-delay: 0.5s; }

/* ========== SECTIONS ========== */
section {
    position: relative;
    z-index: 1;
    padding: 120px 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 1rem;
}

/* ========== COMPARISON SECTION ========== */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.comparison-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    transition: all 0.3s;
}

.comparison-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.comparison-card.chaos {
    border-top: 4px solid #F43F5E;
}

.comparison-card.order {
    border-top: 4px solid var(--accent-cyan);
}

.comparison-card ul {
    list-style: none;
    padding: 0;
}

.comparison-card li {
    padding: 0.75rem 0;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* ========== SERVICES SECTION ========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.service-card {
    height: 400px;
    perspective: 1500px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.service-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 32px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.card-front {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}

.card-back {
    background: linear-gradient(135deg, #0F172A, #020617);
    transform: rotateY(180deg);
    border: 1px solid var(--primary-500);
}

.service-icon {
    width: 100px;
    height: 100px;
    font-size: 3.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 2px solid var(--primary-500);
}

.card-front h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-front p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.card-back h4 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent-cyan);
}

.card-back p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-back ul {
    list-style: none;
    padding: 0;
    text-align: left;
    width: 100%;
}

.card-back li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========== TECH STACK ========== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.tech-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid transparent;
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.tech-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-500);
    background: rgba(59, 130, 246, 0.05);
}

.tech-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
    margin-bottom: 1rem;
}

.tech-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== CTA SECTION ========== */
.cta-section {
    position: relative;
}

.cta-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.cta-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent);
    filter: blur(80px);
}

.cta-content {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 48px;
    padding: 80px 40px;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.footer-logo img {
    object-fit: contain;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

.footer-links h4,
.footer-contact h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-links a,
.footer-contact a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--primary-500);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: block;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    max-height: 90vh;  /* ✅ Limita altura */
    margin: 80px auto;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    overflow-y: auto;  /* ✅ Scroll interno */
    animation: slideDown 0.4s ease-out;
}

/* Custom Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-500) rgba(255, 255, 255, 0.05);
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;  /* Asegura que el botón de cerrar siempre esté visible */
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.audit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: "Inter", sans-serif;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    margin-top: 1rem;
}

.form-success {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1.5rem;
}

.form-success h3 {
    margin-bottom: 0.5rem;
}

.form-success p {
    color: var(--text-secondary);
}

/* ========== SCROLL REVEAL ========== */
[data-scroll-reveal] {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

[data-scroll-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 968px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-top: 1px solid var(--glass-border);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .floating-nodes {
        display: none;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .comparison-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-content {
        padding: 40px 20px;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 20px;
        padding: 2rem 1.5rem;
    }
}