/* Base compartida APEX: reset, revelado, palabras, modo día/noche utilitario,
   botón de WhatsApp, barra de progreso y distintivo de maqueta.
   Cada propuesta define sus tokens en :root y [data-theme="dark"]. */
*, *::before, *::after { box-sizing: border-box; }
/* touch-action: manipulation quita el zoom con doble toque en el celular. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; touch-action: manipulation; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); transition: background-color .4s, color .4s; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.18em; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 999; padding: .6rem 1rem; background: var(--surf); color: var(--text); border-radius: .5rem; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--focus, #E23B3B); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Logos según modo */
.logo-night { display: none; }
[data-theme="dark"] .logo-day { display: none; }
[data-theme="dark"] .logo-night { display: block; }

/* Botón de modo */
.theme-toggle { position: relative; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surf); cursor: pointer; display: grid; place-items: center; overflow: hidden; transition: border-color .3s, background .3s; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle span { position: absolute; display: grid; place-items: center; transition: transform .5s cubic-bezier(.3,1.4,.5,1), opacity .3s; }
.theme-toggle .tt-moon { transform: translateY(140%) rotate(-90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .tt-sun { transform: translateY(-140%) rotate(90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .tt-moon { transform: none; opacity: 1; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }

/* Revelado (sólo con JS activo; nada queda oculto sin JS) */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.js [data-reveal="left"] { transform: translateX(-36px); }
.js [data-reveal="right"] { transform: translateX(36px); }
.js [data-reveal="scale"] { transform: scale(.94); }
/* Los insets negativos dejan el recuadro de recorte fuera de la caja: la cortina baja igual,
   pero al terminar nada queda recortado (sombras, glow y el movimiento del boton magnetico). */
.js [data-reveal="clip"] { transform: none; clip-path: inset(0 -100% 100% -100%); transition: opacity .6s, clip-path 1.1s cubic-bezier(.7,0,.2,1) var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="clip"].is-in { clip-path: inset(-100% -100% -100% -100%); }
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
[data-split] .w > span { display: inline-block; transition: transform .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i) * 55ms); }
.js [data-split]:not(.is-in) .w > span { transform: translateY(110%); }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }

/* Tarjetas con inclinación al pasar el puntero */
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.js [data-tilt][data-reveal]:not(.is-in) { transform: translateY(26px); }

/* FAQ */
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-a { overflow: hidden; transition: height .32s cubic-bezier(.2,.7,.2,1); }
.faq-ico .ico { transition: transform .35s; }
.faq-item[open] .faq-ico .ico { transform: rotate(45deg); }

/* Formularios */
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #E23B3B !important; }
.field.has-error::after { content: 'Revisa este campo'; display: block; margin-top: .3rem; color: #E23B3B; font-size: .82rem; }
.form-done { text-align: center; padding: 2rem 1rem; }
.form-done .ico { width: 3.2rem; height: 3.2rem; padding: .75rem; border-radius: 50%; background: var(--accent); color: #fff; margin-bottom: 1rem; animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.form-done small { display: block; margin-top: .8rem; opacity: .65; }
@keyframes pop { from { transform: scale(0); } }

/* Flotantes */
.scroll-progress { position: fixed; left: 0; top: 0; right: 0; height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(0); z-index: 80; pointer-events: none; }
.wa-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: inline-flex; align-items: center; gap: .55rem; padding: .8rem 1.05rem; border-radius: 999px; background: #1F9D55; color: #fff; text-decoration: none; font-weight: 600; font-size: .92rem; box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); transition: transform .3s, box-shadow .3s; }
.wa-float .ico { width: 1.35em; height: 1.35em; }
.wa-float:hover { transform: translateY(-3px); }
@media (max-width: 640px) { .wa-float span { display: none; } .wa-float { padding: .85rem; bottom: 4rem; } }
.demo-badge { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; padding: .45rem .8rem; border-radius: 999px; background: rgba(20,20,22,.9); color: #fff; font: 500 12px/1.2 system-ui, sans-serif; text-decoration: none; backdrop-filter: blur(6px); }
.demo-badge b { color: #FF6B6B; margin-right: .25rem; }

/* Marquesina */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee ul { display: flex; width: max-content; list-style: none; margin: 0; padding: 0; animation: marquee 45s linear infinite; }
.marquee:hover ul { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.partner img { filter: grayscale(1); opacity: .62; transition: filter .3s, opacity .3s; }
.partner:hover img { filter: none; opacity: 1; }
[data-theme="dark"] .partner img { filter: grayscale(1) invert(1) brightness(1.4); opacity: .55; }
[data-theme="dark"] .partner:hover img { opacity: .95; }
