/* ============================================================
   Converso — styles.css
   Tokens y reglas según DESIGN.md. La marca gana en colores y
   tipografía; las referencias ganan en layout y sensación.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Marca (fijos) */
  --lime: #C1FA49;
  --green: #015940;
  --white: #FFFFFF;

  /* Derivados */
  --green-deep: #013D2C;
  --green-soft: #0A6B50;
  --mint: #EAF7F0;
  --mint-deep: #D8EFE4;
  --lime-soft: #E3FDA8;
  --ink: #062E22;
  --ink-60: #4A6B5F;
  --paper-60: #CFE2DA;

  /* Tipografía */
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Radios */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 999px;

  /* Sombra (solo widget/dropdowns) */
  --shadow-float: 0 8px 24px rgba(6, 46, 34, 0.12);

  --container: 1200px;
}

/* ---------- Reset básico ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Idiomas ----------
   ES es el idioma por defecto en el markup (SEO).
   El toggle pone data-lang="en" en <html>. */
html[data-lang="es"] [lang="en"] { display: none !important; }
html[data-lang="en"] [lang="es"] { display: none !important; }

/* ---------- Tipografía ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 800; line-height: 1.05; }
h2 { font-size: clamp(28px, 3.4vw, 36px); }
h3 { font-size: clamp(20px, 2vw, 24px); }
p  { max-width: 65ch; }
.lead { font-size: clamp(18px, 1.6vw, 20px); }
.small { font-size: 14px; }

/* ---------- Focus / accesibilidad ---------- */
:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--lime); color: var(--green);
  padding: 12px 20px; border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.section { padding-block: 64px; }
.section--mint { background: var(--mint); }
.section--dark { background: var(--green); color: var(--white); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p { color: var(--paper-60); }
.section-head { margin-bottom: 48px; }
.section-head p { margin-top: 12px; color: var(--ink-60); }
.section--dark .section-head p { color: var(--paper-60); }

@media (min-width: 968px) {
  .section { padding-block: 96px; }
}

.grid-3, .grid-2 { display: grid; gap: 24px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 968px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  padding: 14px 28px; border-radius: var(--radius-full);
  border: 0; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  min-height: 44px;
}
.btn--primary { background: var(--lime); color: var(--green); }
.btn--primary:hover { background: var(--lime-soft); transform: translateY(-2px); }
.btn--secondary { background: transparent; border: 2px solid var(--lime); color: var(--lime); }
.btn--secondary:hover { background: rgba(193, 250, 73, 0.1); transform: translateY(-2px); }
.on-light .btn--secondary, .section--mint .btn--secondary, .btn--secondary.btn--on-light {
  border-color: var(--green); color: var(--green);
}
.btn--on-light:hover { background: rgba(1, 89, 64, 0.06); }
.btn--block { width: 100%; justify-content: center; }
.btn .wa-ico { flex: 0 0 auto; }

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--green);
  border-bottom: 1px solid var(--green-soft);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 72px;
}
.nav-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  color: var(--lime); text-decoration: none; line-height: 1;
  display: flex; align-items: center; gap: 10px;
}
.nav-links {
  display: none; list-style: none; padding: 0;
  gap: 28px; align-items: center;
}
.nav-links a {
  color: var(--white); text-decoration: none; font-weight: 500; font-size: 15px;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--lime); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-cta { padding: 10px 20px; font-size: 15px; }

/* Toggle idioma */
.lang-toggle {
  display: inline-flex; border: 1px solid var(--green-soft);
  border-radius: var(--radius-full); overflow: hidden;
}
.lang-toggle button {
  background: transparent; border: 0; color: var(--white);
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  min-height: 32px;
}
.lang-toggle button[aria-pressed="true"] { background: var(--lime); color: var(--green); }

/* Menú móvil */
.nav-burger {
  background: none; border: 0; cursor: pointer; padding: 10px;
  display: inline-flex; flex-direction: column; gap: 5px;
}
.nav-burger span {
  width: 22px; height: 2px; background: var(--white); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav.is-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 967px) {
  .nav.is-open .nav-links {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--green-deep); padding: 24px; gap: 20px;
    border-bottom: 1px solid var(--green-soft);
  }
  .nav-cta { display: none; }
}
@media (min-width: 968px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}

/* ---------- Hero (scroll-expansion, D-13) ---------- */
.hero {
  background: var(--green);
  color: var(--white);
  position: relative;
}
.hero-sticky {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 24px;
  padding: 56px 24px 48px;
}
.hero h1 { color: var(--white); max-width: 17ch; margin-inline: auto; }
.hero .lead { color: var(--paper-60); max-width: 52ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero-note { font-size: 14px; color: var(--paper-60); }

/* Línea typewriter (D-14) */
.typeline {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2.6vw, 30px); color: var(--white);
  min-height: 1.4em;
}
.typeline .type-target { color: var(--lime); }
.type-cursor {
  color: var(--lime); font-weight: 700; margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Desktop: sección alta + sticky para la expansión */
@media (min-width: 968px) {
  .hero--scroll { height: 190vh; }
  .hero--scroll .hero-sticky {
    position: sticky; top: 73px; height: calc(100vh - 73px);
    justify-content: flex-start; overflow: hidden;
    padding-top: 32px;
  }
  .hero--scroll h1 { font-size: clamp(36px, 3.8vw, 52px); }
  .hero--scroll .hero-copy {
    opacity: calc(1 - var(--hero-p, 0) * 1.6);
    transform: translateY(calc(var(--hero-p, 0) * -60px));
  }
  /* --hero-travel y --hero-scale-delta los mide main.js según el viewport,
     para que el mockup quede centrado y completo al expandirse. */
  .hero--scroll .phone {
    transform:
      translateY(calc(var(--hero-p, 0) * -1 * var(--hero-travel, 0px)))
      scale(calc(0.78 + var(--hero-p, 0) * var(--hero-scale-delta, 0.3)));
    transform-origin: top center;
  }
  .hero--scroll .phone-caption {
    opacity: var(--hero-p, 0);
    transform: translateY(calc(var(--hero-p, 0) * -1 * var(--hero-travel, 0px)));
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero--scroll { height: auto !important; }
  .hero--scroll .hero-sticky { position: static; height: auto; }
  .hero--scroll .hero-copy, .hero--scroll .phone { opacity: 1 !important; transform: none !important; }
  .type-cursor { animation: none; }
}

/* ---------- Mockup de teléfono / WhatsApp ---------- */
.phone {
  width: min(360px, 88vw);
  background: var(--green-deep);
  border-radius: 40px;
  padding: 10px;
  box-shadow: none;
}
.phone-screen {
  background: var(--mint);
  border-radius: 32px;
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 480px;
}
.chat-header {
  background: var(--green);
  color: var(--white);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--white);
  display: grid; place-items: center; overflow: hidden;
}
.chat-header .name {
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.1;
}
.chat-header .status { font-size: 11px; color: var(--lime); }
.chat-body {
  flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px;
  background:
    radial-gradient(circle at 20% 20%, rgba(1, 89, 64, 0.04) 0 2px, transparent 2px),
    var(--mint);
  background-size: 48px 48px, auto;
}
.msg {
  max-width: 82%; padding: 10px 14px; font-size: 14px; line-height: 1.45;
  border-radius: var(--radius-md);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.msg.visible { opacity: 1; transform: none; }
.msg--in {
  align-self: flex-start; background: var(--white);
  border-bottom-left-radius: 6px; color: var(--ink);
}
.msg--out {
  align-self: flex-end; background: var(--lime-soft);
  border-bottom-right-radius: 6px; color: var(--ink);
}
.msg time { display: block; font-size: 10px; color: var(--ink-60); margin-top: 4px; text-align: right; }
.typing {
  align-self: flex-end; background: var(--lime-soft);
  border-radius: var(--radius-md); border-bottom-right-radius: 6px;
  padding: 12px 16px; display: none; gap: 4px;
}
.typing.visible { display: inline-flex; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: typedot 1s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typedot { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .msg { opacity: 1; transform: none; transition: none; }
  .typing { display: none !important; }
  .typing i { animation: none; }
}
.phone-caption {
  text-align: center; font-size: 13px; color: var(--paper-60); margin-top: 14px;
}
.phone-caption strong { color: var(--lime); font-weight: 600; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--mint-deep);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-4px); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-60); font-size: 15px; }
.section--dark .card { background: var(--green-deep); }
.section--dark .card h3 { color: var(--white); }
.section--dark .card p { color: var(--paper-60); }
.section--mint .card { background: var(--white); }
.card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: var(--lime);
  display: grid; place-items: center; margin-bottom: 18px;
  font-size: 22px;
}
.section--dark .card-icon { background: var(--lime); color: var(--green); }

/* ---------- Pasos numerados (Rivian, D-06) ---------- */
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; }
.step {
  display: grid; grid-template-columns: 72px 1fr; gap: 20px;
  position: relative; padding-bottom: 48px;
}
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 35px; top: 76px; bottom: 8px;
  width: 2px; background: var(--mint-deep);
}
.step:last-child::before { display: none; }
.step-num {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--green); color: var(--lime);
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
  display: grid; place-items: center;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-60); }

/* ---------- CTA band (D-07) ---------- */
.cta-band { background: var(--green-deep); color: var(--white); text-align: center; }
.cta-band h2 { color: var(--white); max-width: 24ch; margin-inline: auto; }
.cta-band p { color: var(--paper-60); margin: 16px auto 28px; }
.cta-band .btn { margin-inline: auto; }

/* ---------- Precios ---------- */
.price-card { display: flex; flex-direction: column; gap: 16px; }
.price-card ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.price-card li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-60); }
.price-card li::before { content: "✓"; color: var(--green); font-weight: 700; }
.price-tag {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--green); background: var(--lime);
  align-self: flex-start; padding: 4px 14px; border-radius: var(--radius-full);
}

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.faq details {
  background: var(--mint); border-radius: var(--radius-md); overflow: hidden;
}
.section--mint .faq details { background: var(--white); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  padding: 20px 24px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 24px; color: var(--green);
  font-family: var(--font-display); font-weight: 700;
  flex: 0 0 auto;
}
.faq details[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 24px 20px; color: var(--ink-60); }

/* ---------- Formulario ---------- */
.form-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 32px; color: var(--ink);
}
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--mint-deep); border-radius: var(--radius-sm);
  background: var(--white); min-height: 44px;
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--green); outline: 2px solid var(--lime); outline-offset: 1px;
}
.form-ok, .form-error {
  display: none; background: var(--mint); border-radius: var(--radius-md);
  padding: 20px; margin-top: 16px; color: var(--ink);
}
.form-ok.visible, .form-error.visible { display: block; }
.form-error { background: var(--lime-soft); }
/* Honeypot antispam: oculto para personas, visible para bots. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Chips de integraciones ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; list-style: none; }
.chips li {
  background: var(--mint-deep); color: var(--ink);
  border-radius: var(--radius-full); padding: 10px 20px;
  font-weight: 600; font-size: 15px;
}
.section--dark .chips li { background: var(--green-deep); color: var(--paper-60); }

/* ---------- Slots de clientes (D-09) ---------- */
.client-slot {
  border: 2px dashed var(--mint-deep); border-radius: var(--radius-md);
  padding: 32px; text-align: center; color: var(--ink-60);
  display: grid; place-items: center; min-height: 120px;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer { background: var(--green-deep); color: var(--paper-60); }
.footer-inner { padding-block: 64px 32px; display: grid; gap: 40px; }
.footer-brand .wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--lime);
}
.footer-brand .tagline { color: var(--white); font-size: 14px; margin-top: 4px; }
.footer-cols { display: grid; gap: 32px; }
.footer-cols h3 { color: var(--white); font-size: 15px; margin-bottom: 12px; }
.footer-cols ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-cols a { color: var(--paper-60); text-decoration: none; font-size: 14px; }
.footer-cols a:hover { color: var(--lime); }
.footer-close {
  border-top: 1px solid var(--green-soft); padding-block: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 13px;
}
.footer-close .motto { color: var(--lime); font-family: var(--font-display); font-weight: 700; }
@media (min-width: 640px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 968px) {
  .footer-inner { grid-template-columns: 1.2fr 2fr; align-items: start; }
}

/* ---------- Widget de chat (D-12) ---------- */
.chatw-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--lime);
  cursor: pointer; box-shadow: var(--shadow-float);
  display: grid; place-items: center;
  transition: transform 0.15s ease;
}
.chatw-btn:hover { transform: scale(1.06); }
.chatw-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 60;
  width: min(340px, calc(100vw - 40px));
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-float); overflow: hidden;
  display: none; flex-direction: column;
}
.chatw-panel.open { display: flex; }
.chatw-head {
  background: var(--green); color: var(--white);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.chatw-head .name { font-family: var(--font-display); font-weight: 700; }
.chatw-head .status { font-size: 11px; color: var(--lime); }
.chatw-body {
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  max-height: 320px; overflow-y: auto; background: var(--mint);
}
.chatw-msg {
  background: var(--white); border-radius: var(--radius-md);
  border-bottom-left-radius: 6px;
  padding: 10px 14px; font-size: 14px; max-width: 90%;
}
.chatw-replies { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; background: var(--mint); }
.chatw-replies button {
  border: 1.5px solid var(--green); color: var(--green); background: var(--white);
  border-radius: var(--radius-full); padding: 8px 16px; font-size: 13px;
  font-weight: 600; cursor: pointer; min-height: 36px;
}
.chatw-replies button:hover { background: var(--lime); border-color: var(--lime); }

/* ---------- Animación de aparición ----------
   Solo se oculta si hay JS (html.js). Sin JS, el contenido se ve siempre. */
.js .fade-up { opacity: 0; transform: translateY(16px); transition: opacity 0.2s ease, transform 0.2s ease; }
.js .fade-up.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .fade-up { opacity: 1; transform: none; transition: none; }
}

/* ---------- Página interior: hero corto ---------- */
.page-hero { background: var(--green); color: var(--white); padding-block: 72px; }
.page-hero h1 { color: var(--white); max-width: 20ch; }
.page-hero .lead { color: var(--paper-60); margin-top: 16px; }

/* ---------- Split contacto (Handshake) ---------- */
.contact-split { display: grid; gap: 40px; align-items: start; }
@media (min-width: 968px) { .contact-split { grid-template-columns: 1fr 1fr; } }
