/* =================================================================
   KamioSystems — styles.css
   Landing de una sola página. Objetivo único: agendar una llamada.
   Mobile-first. Breakpoints: 375 / 768 / 1280.
   ================================================================= */

/* -----------------------------------------------------------------
   1. VARIABLES (paleta fija — no cambiar valores)
   ----------------------------------------------------------------- */
:root {
  --bg-primary:     #FFFFFF;
  --bg-secondary:   #F0F2F5;
  --border:         #D0D8E8;
  --accent:         #1A4FCC;
  --text-secondary: #3A3A4A;
  --text-primary:   #0A0A14;

  /* Derivados de la paleta para estados (sin introducir colores nuevos) */
  --accent-soft:    rgba(26, 79, 204, 0.12);
  --accent-ring:    rgba(26, 79, 204, 0.45);
  --shadow-cta:     0 12px 28px rgba(26, 79, 204, 0.28);
  --shadow-card:    0 8px 30px rgba(10, 10, 20, 0.06);

  /* Sistema tipográfico y de espacio */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1120px;
  --pad-x: 1.25rem;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* -----------------------------------------------------------------
   2. RESET / BASE
   ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text-secondary);
  background: var(--bg-primary);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { color: var(--text-primary); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
em { font-style: normal; color: var(--accent); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }

/* Foco visible accesible (no se elimina el outline, se reemplaza) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

/* -----------------------------------------------------------------
   3. SECCIONES Y TÍTULOS
   ----------------------------------------------------------------- */
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--alt { background: var(--bg-secondary); }

main { display: flex; flex-direction: column; gap: clamp(3rem, 6vw, 5rem); }

.section__title {
  font-size: clamp(1.6rem, 4.4vw, 2.6rem);
  max-width: 18ch;
  margin-bottom: 2.5rem;
}
.solution .section__title,
.cta-final .section__title { max-width: 24ch; }

/* -----------------------------------------------------------------
   4. BOTONES (todos los CTA apuntan a agendar)
   ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}
.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.92rem; }
.btn--lg { padding: 1rem 1.8rem; font-size: 1.06rem; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-cta);
  background: #1545b0;
}

.btn--ghost { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn--ghost:hover { transform: scale(1.03); border-color: var(--accent); color: var(--accent); }

/* -----------------------------------------------------------------
   5. PRELOADER
   ----------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg-primary);
}
.preloader__inner { text-align: center; width: min(80vw, 360px); }

.preloader__brand {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.preloader__word { display: inline-flex; overflow: hidden; }
.preloader__char {
  display: inline-block;
  transform: translateY(110%);
  /* Reveal de letras controlado por JS (GSAP). Estado base oculto. */
}
.preloader__bar {
  height: 3px;
  width: 100%;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.preloader__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}
.preloader__count {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Estado de salida: lo gestiona JS (clase .is-hidden) con fallback CSS */
.preloader.is-hidden { opacity: 0; transform: translateY(-30px); pointer-events: none; }

/* -----------------------------------------------------------------
   6. CURSOR PERSONALIZADO (solo desktop, activado por JS)
   ----------------------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid var(--accent);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
/* Activo solo cuando JS añade .cursor-enabled al body */
body.cursor-enabled .cursor-dot,
body.cursor-enabled .cursor-ring { opacity: 1; }
body.cursor-enabled { cursor: none; }
body.cursor-enabled a,
body.cursor-enabled button { cursor: none; }

/* Estado hover sobre CTA (JS añade .cursor-hover) */
.cursor-ring.cursor-hover {
  width: 60px; height: 60px;
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cursor-dot.cursor-hover { opacity: 0; }

/* -----------------------------------------------------------------
   7. HEADER
   ----------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding-block: 0.85rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(10, 10, 20, 0.04);
}
.site-header__row { display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text-primary); }
.brand__name { font-size: 1.05rem; letter-spacing: -0.02em; }
.brand__mark {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: var(--bg-primary);
}

/* -----------------------------------------------------------------
   8. HERO
   ----------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 4rem;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; max-width: 760px; }

.hero__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.hero__title {
  font-size: clamp(2.1rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero__title .line { display: block; }
.hero__subtitle {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 2.25rem;
}
.hero__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem; }
.hero__trust { font-size: 0.88rem; color: var(--text-secondary); opacity: 0.85; }

/* Decoración de flujos con parallax */
.hero__decor {
  position: absolute;
  top: 50%;
  right: -8%;
  transform: translateY(-50%);
  width: min(50vw, 560px);
  z-index: 1;
  opacity: 0.5;
  pointer-events: none;
}
.flow-node { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.flow-line { stroke: var(--border); stroke-width: 1.5; stroke-dasharray: 5 6; fill: none; }

/* Indicador de scroll */
.hero__scroll {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  display: grid;
  place-items: start center;
  padding-top: 6px;
  z-index: 2;
}
.hero__scroll-line { width: 3px; height: 8px; background: var(--accent); border-radius: 999px; animation: scrollPulse 1.8s var(--ease) infinite; }
@keyframes scrollPulse { 0%,100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(6px); } }

/* -----------------------------------------------------------------
   9. BLOQUE 2 — PROBLEMA
   ----------------------------------------------------------------- */
.problem__list { display: grid; gap: 0.85rem; max-width: 760px; }
.problem__item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-size: clamp(1rem, 2.3vw, 1.15rem);
  color: var(--text-primary);
}
.problem__icon { color: var(--accent); font-weight: 700; flex: none; }
.problem__close {
  margin-top: 2rem;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-weight: 600;
  color: var(--text-primary);
}

/* -----------------------------------------------------------------
   10. BLOQUE 3 — SOLUCIÓN
   ----------------------------------------------------------------- */
.steps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
.step {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.6rem;
}
.step__num {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.step__title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.step__text { font-size: 1rem; color: var(--text-secondary); }

/* Comparativa */
.compare__title {
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  text-align: center;
  margin-bottom: 2rem;
}
.compare__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}
.compare__col {
  border-radius: var(--radius);
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--border);
}
.compare__col--them { background: var(--bg-secondary); }
.compare__col--us { background: var(--accent); color: #fff; border-color: var(--accent); }
.compare__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  opacity: 0.85;
}
.compare__col--us .compare__label { opacity: 0.9; }
.compare__list { display: grid; gap: 0.7rem; }
.compare__list li {
  font-size: 1.02rem;
  font-weight: 500;
  padding-left: 1.5rem;
  position: relative;
}
.compare__col--them .compare__list li { color: var(--text-secondary); }
.compare__col--them .compare__list li::before { content: "✕"; position: absolute; left: 0; color: var(--text-secondary); opacity: 0.6; }
.compare__col--us .compare__list li { color: #fff; }
.compare__col--us .compare__list li::before { content: "✓"; position: absolute; left: 0; color: #fff; }
.compare__vs {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* -----------------------------------------------------------------
   11. BLOQUE 4 — PRUEBA
   ----------------------------------------------------------------- */
.proof__metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.metric {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.metric__value {
  display: block;
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.6rem;
}
.metric__label { font-size: 0.98rem; color: var(--text-secondary); }

/* Banda de autoridad RGPD — tratamiento accent para dar peso y confianza */
.rgpd {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.5rem);
  margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
  box-shadow: var(--shadow-cta);
}
.rgpd__icon {
  flex: none;
  width: 46px; height: 46px;
  color: #fff;
}
.rgpd__icon svg { width: 100%; height: 100%; }
.rgpd__tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.rgpd__title { color: #fff; font-size: clamp(1.25rem, 3.2vw, 1.7rem); margin-bottom: 0.6rem; }
.rgpd__text { color: rgba(255, 255, 255, 0.92); font-size: 1.02rem; max-width: 62ch; }

.proof__quotes { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; }
.quote {
  margin: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}
.quote blockquote { margin: 0 0 1rem; font-size: 1.1rem; color: var(--text-primary); font-weight: 500; }
.quote figcaption { display: flex; flex-direction: column; }
.quote__author { font-weight: 700; color: var(--text-primary); }
.quote__role { font-size: 0.9rem; color: var(--text-secondary); }

.proof__logos { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; justify-content: center; margin-bottom: 2rem; opacity: 0.7; }
.proof__logos img { height: 32px; width: auto; }
.proof__note { font-size: 0.9rem; color: var(--text-secondary); opacity: 0.8; max-width: 60ch; }

/* -----------------------------------------------------------------
   12. BLOQUE 5 — CTA FINAL + FILTRO
   ----------------------------------------------------------------- */
.cta-final__subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 56ch;
  margin-bottom: 2.5rem;
}
.filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
}
.filter__col {
  border-radius: var(--radius);
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}
.filter__col--yes { border-top: 3px solid var(--accent); }
.filter__col--no { background: var(--bg-secondary); }
.filter__head { font-size: 1.2rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.6rem; }
.filter__col--yes .filter__head span { color: var(--accent); }
.filter__col--no .filter__head span { color: var(--text-secondary); }
.filter__list { display: grid; gap: 0.7rem; }
.filter__list li { font-size: 1.02rem; color: var(--text-secondary); padding-left: 1.4rem; position: relative; }
.filter__col--yes .filter__list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.filter__col--no .filter__list li::before { content: "✗"; position: absolute; left: 0; color: var(--text-secondary); opacity: 0.6; }

.cta-final__action { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; text-align: center; margin-bottom: 2.5rem; }

/* Embed de calendario */
.calendar-embed { width: 100%; border-radius: var(--radius); overflow: hidden; min-height: 0; }
.calendar-embed.is-open { min-height: 640px; border: 1px solid var(--border); }
.calendar-embed iframe { width: 100%; min-height: 640px; border: 0; display: block; }
.calendar-embed__fallback {
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
}

/* -----------------------------------------------------------------
   13. FOOTER
   ----------------------------------------------------------------- */
.site-footer { background: var(--text-primary); color: #fff; padding-block: 2.5rem; }
.site-footer .brand__name, .site-footer__tag { color: #fff; }
.site-footer__row { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.12); }
.site-footer__tag { font-size: 0.95rem; opacity: 0.7; }
.site-footer .brand__mark::after { background: var(--text-primary); }
.site-footer__legal { font-size: 0.85rem; opacity: 0.5; margin-top: 1.25rem; }
.site-footer .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.25); }
.site-footer .btn--ghost:hover { color: var(--accent); background: #fff; border-color: #fff; }

/* -----------------------------------------------------------------
   14. ANIMACIÓN REVEAL (estado base; GSAP lo anima)
   ----------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(40px); }
.reveal.is-visible { opacity: 1; transform: none; }

/* -----------------------------------------------------------------
   15. RESPONSIVE
   ----------------------------------------------------------------- */
@media (min-width: 768px) {
  body { font-size: 18px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .compare__grid { grid-template-columns: 1fr auto 1fr; }
  .proof__metrics { grid-template-columns: repeat(3, 1fr); }
  .proof__quotes { grid-template-columns: 1fr 1fr; }
  .rgpd { flex-direction: row; align-items: flex-start; gap: 1.75rem; }
  .filter { grid-template-columns: 1fr 1fr; }
  .site-footer__row { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 1280px) {
  .hero__decor { right: 0; opacity: 0.7; }
}

/* -----------------------------------------------------------------
   16. PREFERS-REDUCED-MOTION (fallback estático)
   ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .preloader__char { transform: none; }
  .hero__scroll-line { animation: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
