/* SaaS Organic Theme - Kommo Inspired */
:root {
    --bg-main: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-accent: #f0f4f8;
    --text-main: #1a1b1e;
    --text-muted: #6b7280;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #eef2ff;
    --border: #e5e7eb;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 40px rgba(79, 70, 229, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --font-sans: 'Inter', system-ui, sans-serif;
}

:root[data-theme="dark"] {
    --bg-main: #0B0E14;
    --bg-secondary: #151A23;
    --bg-accent: #1C222D;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --secondary: rgba(99, 102, 241, 0.1);
    --border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 10px 40px rgba(99, 102, 241, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.4s, color 0.4s;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 700; line-height: 1.2; }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-secondary { background: var(--secondary); color: var(--primary); font-weight: 600;}
.btn-secondary:hover { background: var(--primary); color: white; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(var(--bg-secondary), 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    height: 70px;
    display: flex;
    align-items: center;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo-area { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 1.25rem;}
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--text-main); text-decoration: none; font-size: 0.95rem; font-weight: 500;}
.theme-toggle { background: transparent; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; }

/* Hero Section */
.hero {
    padding: 180px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pointer-glow {
    position: absolute;
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(67, 56, 202, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    top: -1000px; /* Hidden initially */
    left: -1000px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s ease;
    filter: blur(60px);
}

:root[data-theme="dark"] .pointer-glow {
    background: radial-gradient(circle, rgba(147, 51, 234, 0.25) 0%, rgba(88, 28, 135, 0) 70%);
}

:root[data-theme="dark"] .logo-area img {
    filter: brightness(0) invert(1);
    transition: filter 0.4s ease;
}

.relative-z {
    position: relative;
    z-index: 10;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero h1 { font-size: clamp(4rem, 6vw, 6rem); max-width: 1000px; margin: 0 auto 1.5rem; letter-spacing: -0.03em; line-height: 1.1; }
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* Custom Shapes / Integration Graphics */
.integration-nodes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 5rem;
    align-items: center;
    flex-wrap: wrap;
    opacity: 0.8;
}

.node-box {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
}

.node-connector {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.5rem;
}

/* Trust Logos (Marquee) */
.trust-section { padding: 4rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-secondary); overflow: hidden; }
.trust-title { text-align: center; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2.5rem; }

.marquee-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%); /* Hace que rompa el contenedor y ocupe todo el ancho de la pantalla */
    overflow: hidden;
    position: relative;
    display: flex;
}

/* Efecto de desvanecimiento en los bordes */
.marquee-container::before,
.marquee-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-secondary) 0%, transparent 100%);
}
.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-secondary) 0%, transparent 100%);
}

.marquee-track {
    display: flex;
    width: fit-content;
    animation: scroll 40s linear infinite;
}

/* Pausar la animación al pasar el mouse */
.marquee-container:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    display: flex;
    gap: 5rem;
    padding-right: 5rem; /* Espacio exacto para el loop */
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

/* Iluminar toda la barra al hacer hover en el contenedor */
.marquee-container:hover .marquee-group {
    opacity: 1;
}

.marquee-group h2 {
    color: var(--text-muted);
    font-size: 1.6rem;
    white-space: nowrap;
    margin: 0;
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: default;
}

/* Efecto en el texto individual */
.marquee-group h2:hover {
    color: var(--primary);
    transform: scale(1.1);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Use Cases / Projects */
.cases-section { padding: 100px 0 40px; }
.case-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
}
.case-block:last-child { margin-bottom: 0; }
.case-block.reverse { direction: rtl; }
.case-block.reverse > * { direction: ltr; }

.case-content h3 { font-size: 2.5rem; margin-bottom: 1.5rem; }
.case-content p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.7; }
.case-content ul { list-style: none; margin-bottom: 2rem; }
.case-content li { display: flex; align-items: flex-start; gap: 0.8rem; margin-bottom: 1rem; color: var(--text-main); font-weight: 500; }
.case-content li::before { content: "✓"; color: var(--primary); font-weight: bold; }

.case-media {
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
}
.case-media img { width: 100%; border-radius: var(--radius-md); display: block; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

/* --- CSS UI Mockups --- */
.css-mockup { width: 100%; font-family: var(--font-sans); }

/* Workflow Mockup */
.workflow-mockup { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.workflow-mockup > div { background: var(--bg-secondary); padding: 0.8rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid var(--border); font-weight: 500; font-size: 0.9rem; box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 0.5rem; }
.workflow-mockup .icon { font-size: 1.2rem; }
.workflow-mockup .n8n-node { border-left: 4px solid #F95046; }
.workflow-mockup .stripe-node { border-left: 4px solid #635bff; }
.workflow-mockup .hubspot-node { border-left: 4px solid #ff7a59; }
.workflow-mockup .slack-node { border-left: 4px solid #e01e5a; }
.workflow-mockup .line { width: 2px; height: 30px; background: var(--border); padding: 0 !important; border: none !important; box-shadow: none !important; }
.workflow-mockup .branches { display: flex; gap: 2rem; padding: 0 !important; background: transparent !important; border: none !important; box-shadow: none !important; }

/* Chat Mockup */
.chat-mockup { background: var(--bg-secondary); border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; flex-direction: column; height: 300px; overflow: hidden; box-shadow: var(--shadow-soft); }
.chat-header { background: var(--bg-accent); padding: 1rem; font-weight: 600; border-bottom: 1px solid var(--border); display:flex; align-items:center; gap: 0.5rem; }
.chat-header::before { content: ''; display: inline-block; width: 10px; height: 10px; background: #10b981; border-radius: 50%; }
.chat-history { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; }
.chat-history .bubble { padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.9rem; max-width: 85%; }
.bubble.bot { background: var(--bg-accent); border-bottom-left-radius: 2px; align-self: flex-start; }
.bubble.user { background: var(--primary); color: white; border-bottom-right-radius: 2px; align-self: flex-end; }
.chat-input { padding: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; }

/* Dashboard Mockup */
.dashboard-mockup { display: flex; flex-direction: column; gap: 1.5rem; }
.dash-top { display: flex; gap: 1rem; }
.stat-card { flex: 1; background: var(--bg-secondary); padding: 1.5rem; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-soft); font-size: 0.85rem; color: var(--text-muted); }
.stat-card b { display: block; font-size: 1.8rem; color: var(--text-main); margin-top: 0.5rem; }
.dash-chart { height: 120px; background: var(--bg-secondary); border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; align-items: flex-end; gap: 1rem; padding: 1.5rem; box-shadow: var(--shadow-soft); }
.dash-chart .bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; opacity: 0.8; transition: height 0.5s ease; }
.dash-chart .bar:hover { opacity: 1; background: var(--primary-hover); }

/* Process Section */
.process-section { padding: 60px 0 100px; background: var(--bg-main); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 3rem; margin-top: 4rem; }
.process-step { display: flex; flex-direction: column; text-align: left; }
.step-number { color: var(--primary); font-size: 2.2rem; font-weight: 700; margin-bottom: 0.8rem; line-height: 1; }
.process-step h4 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--text-main); }
.process-step p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; flex-grow: 1; }
.step-footer { font-style: italic; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0 !important; }

@media (max-width: 900px) {
    .process-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
}
@media (max-width: 600px) {
    .process-grid { grid-template-columns: 1fr; gap: 3rem; }
}

/* FAQ */
.faq-section { padding: 100px 0; background: var(--bg-secondary); }
.section-title { text-align: center; margin-bottom: 4rem; }
.section-title h2 { font-size: 3rem; margin-bottom: 1rem; }
.section-title p { color: var(--text-muted); font-size: 1.2rem; }

.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); padding: 1.5rem 0; cursor: pointer; }
.faq-q { display: flex; justify-content: space-between; align-items: center; font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
.faq-icon { color: var(--primary); transition: transform 0.3s; font-size: 1.5rem; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; color: var(--text-muted); }
.faq-a p { padding-top: 1rem; line-height: 1.6; }
.faq-item.active .faq-icon { transform: rotate(45deg); }

/* CTA */
.cta { padding: 60px 0 100px; text-align: center; }
.cta-box { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 5rem 2rem; box-shadow: var(--shadow-soft); }
.cta-box h2 { font-size: 3rem; margin-bottom: 1.5rem; }
.cta-box p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; }

/* Footer */
footer { padding: 4rem 0 2rem; background: var(--bg-secondary); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-text { color: var(--text-muted); margin-top: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 1rem; }
.footer-links strong { color: var(--text-main); margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }

@media (max-width: 768px) {
    .nav-links a { display: none; }
    .hero { padding: 120px 0 60px; }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .hero-actions { flex-direction: column; width: 100%; max-width: 300px; margin: 0 auto; }
    .hero-actions .btn { width: 100%; }
    
    .section-title h2 { font-size: 1.6rem; text-wrap: balance; }
    .case-content h3 { font-size: 1.8rem; }
    
    .cases-section { padding: 60px 0 20px; }
    .process-section { padding: 40px 0 60px; }
    .case-block { grid-template-columns: 1fr; gap: 0; margin-bottom: 3rem; }
    .case-content ul { margin-bottom: 0; }
    .case-block.reverse { direction: ltr; }
    .case-media { min-height: 0 !important; padding: 0 !important; }
    
    .integration-nodes { gap: 1rem; }
    .dash-top { flex-direction: column; }
    
    .cta-box { padding: 3rem 1.5rem; }
    .cta-box h2 { font-size: 2rem; }
    
    footer { padding: 2.5rem 0 1.5rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; text-align: center; }
    .footer-grid > div:first-child { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; margin-bottom: 0.5rem; }
    .footer-links { gap: 0.4rem; }
    .footer-links strong { margin-bottom: 0.3rem; font-size: 0.95rem; }
    .footer-links a { font-size: 0.85rem; }
}

/* --- Contact Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] .cookie-banner {
    background: rgba(21, 26, 35, 0.95);
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    flex: 1;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }
    .cookie-actions {
        justify-content: center;
    }
}
