/* ============================================
   VARIABLES Y TEMA
   ============================================ */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --primary-soft: rgba(79, 70, 229, 0.08);

    --accent: #fbbf24;
    --accent-dark: #f59e0b;
    --accent-light: #fde68a;
    --accent-soft: rgba(251, 191, 36, 0.15);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);

    --danger: #ef4444;

    --bkg: #ffffff;
    --bkg-alt: #f8fafc;
    --bkg-alt-2: #f1f5f9;
    --surface: #ffffff;
    --surface-elevated: #ffffff;

    --ink: #0f172a;
    --ink-light: #475569;
    --ink-lighter: #64748b;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.14);
    --shadow-primary: 0 12px 32px rgba(79, 70, 229, 0.25);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.175, 0.885, 0.32, 1.1);

    --container: 1200px;
}

[data-theme="dark"] {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --primary-soft: rgba(129, 140, 248, 0.12);

    --accent: #fbbf24;
    --accent-dark: #f59e0b;
    --accent-soft: rgba(251, 191, 36, 0.12);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);

    --bkg: #0a0f1e;
    --bkg-alt: #0f172a;
    --bkg-alt-2: #131a2e;
    --surface: #131a2e;
    --surface-elevated: #1a2338;

    --ink: #f1f5f9;
    --ink-light: #cbd5e1;
    --ink-lighter: #94a3b8;

    --border: #1e293b;
    --border-strong: #334155;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.6);
    --shadow-primary: 0 12px 32px rgba(129, 140, 248, 0.3);
}

/* ============================================
   RESET Y BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bkg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   CONTENEDOR Y UTILIDADES
   ============================================ */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.highlight {
    position: relative;
    color: var(--primary);
    z-index: 1;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0.1em;
    left: 0;
    width: 100%;
    height: 0.35em;
    background: var(--accent-soft);
    z-index: -1;
    border-radius: 2px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: color-mix(in srgb, var(--bkg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.header.scrolled {
    padding: 0.75rem 0;
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.logo img {
    height: 38px;
    width: auto;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bkg-alt);
    color: var(--ink);
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: rotate(15deg) scale(1.05);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: all var(--transition);
    position: absolute;
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.mobile-toggle:hover {
    background: var(--bkg-alt);
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.2;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    padding: 10rem 0 6rem;
    overflow: hidden;
    background: var(--bkg);
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float-slow 12s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float-slow 15s ease-in-out infinite reverse;
}

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

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
}

.hero-circle {
    position: absolute;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-soft) 0%, transparent 65%);
    animation: pulse-slow 4s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 1; }
}

.hero-screenshot {
    position: relative;
    width: 100%;
    max-width: 560px;
    z-index: 2;
    animation: hero-float 6s ease-in-out infinite;
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ============================================
   TARJETAS FLOTANTES
   ============================================ */
.float-card {
    position: absolute;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: float-oscillate 4s ease-in-out infinite;
}

.float-card svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.float-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.float-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-lighter);
}

.float-card-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
}

.float-card-success .float-card-value {
    color: var(--success);
}

.float-card-1 {
    top: 5%;
    left: -5%;
}

.float-card-2 {
    bottom: 8%;
    right: -5%;
    animation-delay: 2s;
}

@keyframes float-oscillate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* ============================================
   SYSTEM FEATURES (usado en hero)
   ============================================ */
.system-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.system-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.125rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.system-feature:hover {
    border-color: var(--primary);
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.system-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.system-feature-icon svg {
    width: 20px;
    height: 20px;
}

.system-feature-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.system-feature-text {
    font-size: 0.85rem;
    color: var(--ink-lighter);
    line-height: 1.4;
}

/* ============================================
   ANIMACIONES ON SCROLL
   ============================================ */
.fade-in-up {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.fade-in-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.scale-in.in-view {
    opacity: 1;
    transform: scale(1);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }

/* ============================================
   ICONOS ANIMADOS EN MÓDULOS
   ============================================ */
.module-icon-animated {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px dashed color-mix(in srgb, var(--primary) 40%, transparent);
    animation: icon-ring-spin 8s linear infinite;
}

.module-icon-ring::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

.module-icon-core {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    animation: icon-pulse 3s ease-in-out infinite;
}

.module-icon-core svg {
    width: 18px;
    height: 18px;
}

@keyframes icon-ring-spin {
    to { transform: rotate(360deg); }
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.module-icon-animated-success .module-icon-ring {
    border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.module-icon-animated-success .module-icon-ring::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.module-icon-animated-success .module-icon-core {
    background: var(--success-soft);
    color: var(--success);
}

.module-icon-animated-accent .module-icon-ring {
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.module-icon-animated-accent .module-icon-ring::before {
    background: var(--accent-dark);
    box-shadow: 0 0 8px var(--accent);
}

.module-icon-animated-accent .module-icon-core {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.module-icon-animated-danger .module-icon-ring {
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.module-icon-animated-danger .module-icon-ring::before {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.module-icon-animated-danger .module-icon-core {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Maximo PH */
.module-section#maximo-ph .module-icon-animated .module-icon-ring {
    border-color: color-mix(in srgb, #8b5cf6 40%, transparent);
}

.module-section#maximo-ph .module-icon-animated .module-icon-ring::before {
    background: #8b5cf6;
    box-shadow: 0 0 8px #8b5cf6;
}

.module-section#maximo-ph .module-icon-animated .module-icon-core {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.module-section#maximo-ph .module-eyebrow {
    color: #8b5cf6;
}

/* ============================================
   TEASER ORBIT
   ============================================ */
.teaser-orbit {
    position: relative;
    padding: 4rem 0;
    background: var(--bkg-alt);
    overflow: hidden;
}

[data-theme="dark"] .teaser-orbit {
    background: var(--bkg-alt-2);
}

.teaser-orbit-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 0.9fr 1fr;
    gap: 3rem;
    align-items: center;
}

.teaser-orbit-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    aspect-ratio: 1;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
}

.teaser-orbit-glow {
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
    animation: pulse-slow 5s ease-in-out infinite;
    pointer-events: none;
}

.teaser-orbit-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px dashed color-mix(in srgb, var(--primary) 25%, transparent);
    animation: orbit-spin 30s linear infinite;
    pointer-events: none;
}

.teaser-orbit-ring::before,
.teaser-orbit-ring::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.teaser-orbit-ring::before {
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
}

.teaser-orbit-ring::after {
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
}

.teaser-orbit-ring-inner {
    inset: 14%;
    border-style: solid;
    border-color: color-mix(in srgb, var(--primary) 12%, transparent);
    animation-duration: 20s;
    animation-direction: reverse;
}

@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

.teaser-orbit-invoice {
    position: relative;
    width: 52%;
    z-index: 2;
    animation: invoice-pulse 5s ease-in-out infinite;
}

.teaser-orbit-invoice img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    background: white;
    box-shadow:
        0 20px 40px -12px rgba(79, 70, 229, 0.30),
        0 10px 20px -8px rgba(0, 0, 0, 0.12),
        0 0 0 1px color-mix(in srgb, var(--border) 60%, transparent);
}

@keyframes invoice-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.teaser-orbit-satellite {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    animation: orbit-satellite-rotate 24s linear infinite;
    z-index: 3;
    pointer-events: none;
}

.teaser-orbit-satellite-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 20px rgba(79, 70, 229, 0.25),
        0 0 0 3px var(--bkg-alt),
        0 0 0 5px color-mix(in srgb, var(--primary) 15%, transparent);
    animation: orbit-satellite-counter-rotate 24s linear infinite;
    padding: 10px;
    color: var(--primary);
}

.teaser-orbit-satellite-inner svg {
    width: 100%;
    height: 100%;
}

.teaser-orbit-satellite-2 .teaser-orbit-satellite-inner {
    color: var(--success);
    box-shadow:
        0 8px 20px rgba(16, 185, 129, 0.25),
        0 0 0 3px var(--bkg-alt),
        0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent);
}

.teaser-orbit-satellite-3 .teaser-orbit-satellite-inner {
    color: var(--accent-dark);
    box-shadow:
        0 8px 20px rgba(251, 191, 36, 0.30),
        0 0 0 3px var(--bkg-alt),
        0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}

.teaser-orbit-satellite-4 .teaser-orbit-satellite-inner {
    color: var(--danger);
    box-shadow:
        0 8px 20px rgba(239, 68, 68, 0.25),
        0 0 0 3px var(--bkg-alt),
        0 0 0 5px color-mix(in srgb, var(--danger) 15%, transparent);
}

@keyframes orbit-satellite-rotate {
    from { transform: rotate(0deg) translateX(130px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(130px) rotate(0deg); }
}

@keyframes orbit-satellite-counter-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

.teaser-orbit-satellite-2 { animation-delay: -6s; }
.teaser-orbit-satellite-2 .teaser-orbit-satellite-inner { animation-delay: -6s; }
.teaser-orbit-satellite-3 { animation-delay: -12s; }
.teaser-orbit-satellite-3 .teaser-orbit-satellite-inner { animation-delay: -12s; }
.teaser-orbit-satellite-4 { animation-delay: -18s; }
.teaser-orbit-satellite-4 .teaser-orbit-satellite-inner { animation-delay: -18s; }

.teaser-orbit-content {
    padding-left: 0.5rem;
}

.teaser-orbit-title {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.875rem;
    text-wrap: balance;
}

.teaser-orbit-text {
    font-size: 0.95rem;
    color: var(--ink-light);
    line-height: 1.65;
    max-width: 480px;
}

/* ============================================
   MÓDULOS (texto)
   ============================================ */
.module-section {
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
    z-index: 1;
    background: transparent;
}

.module-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.module-grid.reverse {
    direction: rtl;
}

.module-grid.reverse > * {
    direction: ltr;
}

.module-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.module-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

.module-lead {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.module-outro {
    font-size: 0.95rem;
    color: var(--ink-light);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-style: italic;
    padding-left: 1rem;
    border-left: 3px solid var(--primary);
}

.module-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    box-shadow: var(--shadow-primary);
    transition: all var(--transition);
    text-decoration: none;
}

.module-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(79, 70, 229, 0.35);
}

.module-cta svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
}

.module-cta:hover svg {
    transform: translateX(4px);
}

.module-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0;
}

.module-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.module-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-feature-icon svg {
    width: 20px;
    height: 20px;
}

.module-feature-icon-success {
    background: var(--success-soft);
    color: var(--success);
}

.module-feature-icon-accent {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.module-feature-icon-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.module-feature-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.module-feature-text {
    font-size: 0.8rem;
    color: var(--ink-lighter);
    line-height: 1.4;
}

/* ============================================
   VISUAL DE MÓDULO — Imagen única adaptativa
   ============================================ */
.module-visual {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    min-height: 0;
}

/* === MODO 1: IMAGEN ÚNICA (POS) === */
.module-visual-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.module-visual:hover .module-visual-frame {
    transform: scale(1.015);
}

.module-visual-single {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 8px;
}

/* === MODO 2: DOBLE IMAGEN CRUZADA (Facturación, Contabilidad, Nómina) === */
.module-visual-images {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
}

.module-visual-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 78%;
    height: 78%;
    object-fit: cover;
    object-position: top left;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    background: var(--surface);
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.module-visual-img.secondary {
    top: 22%;
    left: 22%;
    z-index: 3;
}

.module-visual:hover .module-visual-img:not(.secondary) {
    transform: translate(20%, 20%);
    z-index: 1;
}

.module-visual:hover .module-visual-img.secondary {
    transform: translate(-18%, -18%);
}

/* === FALLBACK === */
.module-visual .module-visual-fallback {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
    color: var(--primary);
    z-index: 2;
}

.module-visual .module-visual-fallback svg {
    width: 80px;
    height: 80px;
    opacity: 0.4;
}

/* ============================================
   MODULES WRAPPER + RAMA SVG
   ============================================ */
.modules-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--bkg);
}

.module-bg-stripe {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--bkg-alt);
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .module-bg-stripe {
    background: var(--bkg-alt-2);
}

.module-bg-stripe-1 { top: 0; height: 20%; }
.module-bg-stripe-2 { top: 20%; height: 20%; }
.module-bg-stripe-3 { top: 40%; height: 20%; }
.module-bg-stripe-4 { top: 60%; height: 20%; }

.modules-branch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    color: var(--primary);
    transition: color 0.6s ease;
}

.modules-branch svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.branch-path-base {
    stroke: color-mix(in srgb, var(--primary) 12%, transparent);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: blur(0.5px);
}

.branch-path-active {
    stroke: currentColor;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter:
        drop-shadow(0 0 4px currentColor)
        drop-shadow(0 0 12px color-mix(in srgb, currentColor 60%, transparent));
    transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                stroke 0.6s ease;
}

.branch-node {
    fill: var(--bkg);
    stroke: currentColor;
    stroke-width: 3;
    opacity: 0;
    transform: scale(0.4);
    transform-origin: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    filter: drop-shadow(0 0 8px currentColor);
}

.branch-node.active {
    opacity: 1;
    transform: scale(1);
    fill: currentColor;
}

/* ============================================
   ESTADÍSTICAS
   ============================================ */
.stats-section {
    background: var(--bkg);
    padding: 5rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-block {
    position: relative;
}

.stat-block:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: var(--border);
}

.stat-number-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 0.125rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.stat-suffix {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--ink-light);
    font-weight: 500;
    max-width: 220px;
    margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bkg-alt-2);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
}

[data-theme="dark"] .footer {
    background: #050810;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 320px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bkg);
    color: var(--ink-light);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
}

.footer-social svg {
    width: 16px;
    height: 16px;
}

.footer-column h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink);
    margin-bottom: 1.25rem;
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-column a {
    font-size: 0.9rem;
    color: var(--ink-light);
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.footer-column svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--primary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--ink-lighter);
}

/* ============================================
   BOTONES FLOTANTES
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    z-index: 999;
    transition: all var(--transition);
    animation: pulse-whatsapp 2.5s infinite;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6);
    animation-play-state: paused;
}

@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45), 0 0 0 14px rgba(37, 211, 102, 0);
    }
}

.scroll-top-btn {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 998;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--shadow-primary);
}

.scroll-top-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-grid,
    .module-grid,
    .teaser-orbit-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .module-grid.reverse {
        direction: ltr;
    }

    .module-visual {
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-visual {
        order: -1;
        min-height: 380px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .system-features {
        text-align: left;
    }

    .teaser-orbit-visual {
        max-width: 300px;
        min-height: 300px;
        order: -1;
    }

    .teaser-orbit-content {
        text-align: center;
        padding-left: 0;
    }

    .teaser-orbit-text {
        margin-left: auto;
        margin-right: auto;
    }

    .teaser-orbit-content .module-eyebrow {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .stat-block:not(:last-child)::after {
        display: none;
    }

    .modules-branch {
        left: 20px;
        transform: translateX(0);
        width: 100px;
        opacity: 0.35;
    }

    .branch-path-base { stroke-width: 6; }
    .branch-path-active { stroke-width: 3.5; }
}

@media (max-width: 768px) {
    .nav { display: none; }

    .nav.active {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 73px;
        left: 0;
        right: 0;
        padding: 1.5rem;
        background: var(--bkg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-xl);
        animation: slide-down 0.3s ease-out;
        gap: 0.25rem;
        max-height: calc(100vh - 73px);
        overflow-y: auto;
    }

    @keyframes slide-down {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .nav.active .nav-link {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        text-align: left;
    }

    .nav-actions {
        flex-direction: column;
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .nav-actions .btn { width: 100%; }

    .theme-toggle { align-self: center; }

    .mobile-toggle { display: flex; }

    .module-section,
    .teaser-orbit {
        padding: 2.5rem 0;
    }

    .hero { padding: 8rem 0 4rem; }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn { width: 100%; }

    .float-card { padding: 0.75rem 1rem; }

    .float-card-1 { top: 0; left: -2%; }
    .float-card-2 { bottom: 0; right: -2%; }

    .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .whatsapp-float {
        width: 54px;
        height: 54px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float svg { width: 28px; height: 28px; }

    .scroll-top-btn {
        bottom: 86px;
        right: 20px;
        width: 44px;
        height: 44px;
    }

    .module-visual { max-width: 100%; }

    .module-cta {
        width: 100%;
        justify-content: center;
    }

    .teaser-orbit-satellite {
        width: 48px;
        height: 48px;
        margin: -24px 0 0 -24px;
    }

    .teaser-orbit-satellite-inner { padding: 8px; }

    @keyframes orbit-satellite-rotate {
        from { transform: rotate(0deg) translateX(115px) rotate(0deg); }
        to   { transform: rotate(360deg) translateX(115px) rotate(0deg); }
    }

    .module-icon-animated { width: 40px; height: 40px; }
    .module-icon-core { width: 30px; height: 30px; }
    .module-icon-core svg { width: 16px; height: 16px; }

    .modules-branch { display: none; }

    /* ↓↓↓ FIX PARA EVITAR ESPACIO VACÍO EN MÓVIL ↓↓↓ */
    .module-visual {
        min-height: 0 !important;
    }

    .module-visual-images {
        aspect-ratio: auto !important;
        min-height: 0 !important;
    }

    .module-visual-frame {
        aspect-ratio: 4 / 3;
    }

    .module-visual .module-visual-fallback {
        aspect-ratio: 4 / 3;
    }

    /* Ocultar visual de Maximo PH si está vacío en móvil */
    #maximo-ph .module-visual:empty,
    #maximo-ph .module-visual > *:empty {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Reducir espacio extra entre secciones */
    .module-section + .module-section {
        margin-top: 0;
    }

    .module-section:last-child {
        padding-bottom: 2rem;
    }
}

@media (max-width: 640px) {
    .teaser-orbit-visual {
        max-width: 260px;
        min-height: 260px;
    }

    .teaser-orbit-satellite {
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
    }

    .teaser-orbit-satellite-inner { padding: 6px; }

    @keyframes orbit-satellite-rotate {
        from { transform: rotate(0deg) translateX(95px) rotate(0deg); }
        to   { transform: rotate(360deg) translateX(95px) rotate(0deg); }
    }

    .teaser-orbit-title { font-size: 1.35rem; }
    .teaser-orbit-text { font-size: 0.875rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in-up,
    .scale-in {
        opacity: 1;
        transform: none;
    }
}