/* =========================================================
   MELTFORM · Estilos
   Paleta de marca: azul marino #0F2A43, turquesa #17B8A6,
   gris azulado #5B6B7A, blanco hueso #F6F8F9.
   ========================================================= */
:root {
  --bg: #071a2b;               /* azul marino profundo: fondo general */
  --bg-raised: #0f2a43;        /* Azul marino de marca: bloques elevados */
  --glass: rgba(15, 42, 67, .55);
  --glass-strong: rgba(15, 42, 67, .82);
  --ink: #f6f8f9;              /* Blanco hueso: texto principal */
  --muted: #a3b3c1;            /* gris azulado aclarado para leerse sobre oscuro */
  --slate: #5b6b7a;            /* Gris azulado de marca: detalles */
  --line: rgba(246, 248, 249, .1);
  --line-strong: rgba(246, 248, 249, .22);
  --accent: #17b8a6;           /* Turquesa */
  --accent-ink: #0f2a43;       /* texto sobre turquesa */
  --accent-soft: rgba(23, 184, 166, .14);
  --accent-glow: rgba(23, 184, 166, .45);
  --error: #ff7a85;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;

  --radius-s: 8px;
  --radius-m: 18px;
  --radius-l: 28px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-space: clamp(80px, 11vw, 144px);
  --header-h: 76px;

  color-scheme: dark;
}

/* Transición suave entre páginas (navegadores compatibles) */
@view-transition { navigation: auto; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* lo que lleva el atributo hidden siempre queda oculto, aunque su clase defina display */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* Cuadrícula de fondo que se desvanece hacia los bordes */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, rgba(23, 184, 166, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(23, 184, 166, .07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  pointer-events: none;
}
main { flex: 1; }
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.03em;
}
h1 { font-size: clamp(2rem, 4.1vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.3vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-s); }
.skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .25s ease, transform .15s ease, background-color .2s ease, border-color .2s ease;
}
.btn:hover { box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 32px -6px var(--accent-glow); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: rgba(246, 248, 249, .03); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-small { padding: 10px 18px; font-size: .9375rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-weight: 600; text-decoration: none;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Cabecera flotante ---------- */
.site-header {
  position: sticky; top: 14px; z-index: 50;
  padding: 0 var(--gutter);
  margin-top: 14px;
}
.header-inner {
  max-width: calc(var(--wrap) - 2 * var(--gutter));
  margin: 0 auto;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 20px;
  background: rgba(7, 26, 43, .62);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: border-color .3s ease, background-color .3s ease;
}
.site-header.is-scrolled .header-inner { border-color: var(--line-strong); background: rgba(7, 26, 43, .82); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: auto; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.03em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .96875rem;
  transition: color .2s ease, background-color .2s ease;
}
.nav a:not(.btn):hover { color: var(--ink); background: rgba(246, 248, 249, .05); }
.nav a:not(.btn)[aria-current="page"] { color: var(--ink); }
.nav a:not(.btn)[aria-current="page"]::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    background: none; border: 0; cursor: pointer; color: var(--ink);
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .2s ease, background-color .2s ease;
  }
  .nav-toggle-bar { position: relative; }
  .nav-toggle-bar::before { position: absolute; top: -6px; }
  .nav-toggle-bar::after { position: absolute; top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

  .nav {
    position: absolute; top: 74px; left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px;
    background: #0c2338;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .6);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-m);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 14px 16px; border-radius: var(--radius-s); color: var(--ink); }
  .nav a:not(.btn)[aria-current="page"] { background: var(--accent-soft); }
  .nav a:not(.btn)[aria-current="page"]::after { display: none; }
  .nav .btn { margin: 8px 0 0; }
}

/* ---------- Paneles de cristal con borde luminoso ---------- */
.glass {
  position: relative;
  background:
    linear-gradient(var(--glass), var(--glass)) padding-box,
    linear-gradient(145deg, rgba(23, 184, 166, .55), rgba(246, 248, 249, .08) 35%, rgba(246, 248, 249, .04) 70%, rgba(23, 184, 166, .25)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Hero de inicio ---------- */
.hero {
  position: relative;
  padding: clamp(40px, 7vw, 88px) 0 var(--section-space);
}
/* aurora turquesa */
.hero::before {
  content: "";
  position: absolute; z-index: -1;
  width: 720px; height: 720px;
  right: -180px; top: -200px;
  background: radial-gradient(circle, rgba(23, 184, 166, .28), transparent 62%);
  filter: blur(40px);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy h1 { max-width: 11ch; font-size: clamp(2.6rem, 6vw, 4.6rem); }
.lead { margin-top: 26px; font-size: 1.1875rem; color: var(--muted); max-width: 50ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.hero-stage { position: relative; aspect-ratio: 1 / .9; }
.hero-stage canvas { width: 100%; height: 100%; cursor: pointer; }
.hero-stage::after {
  /* suelo reflectante bajo el logo */
  content: "";
  position: absolute; left: 12%; right: 12%; bottom: 8%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(23, 184, 166, .35), transparent 70%);
  filter: blur(14px);
  z-index: -1;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { order: -1; max-width: 460px; width: 100%; margin: 0 auto; aspect-ratio: 1 / .7; }
}

/* ---------- Cabecera de páginas interiores ---------- */
.page-hero {
  position: relative;
  padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 88px);
}
.page-hero::before {
  content: "";
  position: absolute; z-index: -1;
  width: 640px; height: 520px;
  left: 50%; top: -260px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(23, 184, 166, .22), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { max-width: 58ch; }

/* Página 404 */
.error-page { min-height: 62vh; display: grid; align-items: center; }
.error-code {
  font: 600 clamp(5rem, 16vw, 9rem)/1 var(--font-display);
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--accent), rgba(23, 184, 166, .15));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.error-page .hero-actions { margin-top: 32px; }

/* ---------- Secciones ---------- */
.section { padding: var(--section-space) 0; position: relative; }
.section-tight { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.section-head p { color: var(--muted); max-width: 52ch; margin-top: 14px; }
.section-intro { margin-top: 16px; color: var(--muted); max-width: 56ch; font-size: 1.125rem; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); border: 0; margin: 0; }

/* Tarjetas de servicio (inicio) */
/* 6 columnas: 3 tarjetas arriba (2 col. cada una) y 2 anchas abajo (3 col. cada una) */
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.cards .card { grid-column: span 2; }
.cards .card-wide { grid-column: span 3; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 30px;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 24px 60px -24px var(--accent-glow); }
.card p { color: var(--muted); }
.card .link-arrow { margin-top: auto; padding-top: 12px; }
.icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(23, 184, 166, .35);
  color: var(--accent);
}
.icon svg { width: 26px; height: 26px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } .cards .card, .cards .card-wide { grid-column: auto; } }

/* Calculadora de ahorro (inicio) */
.calc { display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; }
.calc-inputs { padding: clamp(24px, 4vw, 40px); display: grid; gap: 28px; align-content: start; }
.calc-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.calc-label label, .calc-auto legend { font-weight: 600; }
.calc-label output { font: 600 1.15rem var(--font-display); color: var(--accent); white-space: nowrap; }
.calc-hint { color: var(--muted); font-size: .875rem; margin-top: 8px; }
/* deslizadores: --fill lo actualiza main.js */
.calc input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--fill, 20%), rgba(246, 248, 249, .12) var(--fill, 20%));
}
.calc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 4px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px var(--accent-glow);
}
.calc input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); border: 4px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px var(--accent-glow);
}
.calc input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.calc-auto legend { margin-bottom: 12px; padding: 0; }
.calc-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.calc-options label { position: relative; }
.calc-options input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.calc-options span {
  display: block; text-align: center; padding: 10px 8px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-weight: 600; font-size: .9375rem; color: var(--muted);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.calc-options input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.calc-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.calc-results {
  padding: clamp(24px, 4vw, 40px);
  background: radial-gradient(circle at 70% 20%, rgba(23, 184, 166, .22), transparent 60%), rgba(7, 26, 43, .55);
  border-left: 1px solid var(--line);
  display: grid; align-content: start; gap: 18px; justify-items: start;
}
.calc-results-title { color: var(--muted); font-weight: 600; }
.calc-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-top: -8px; }
.calc-num {
  font: 600 clamp(3rem, 7vw, 4.6rem)/1 var(--font-display); letter-spacing: -0.04em;
  color: var(--accent); text-shadow: 0 0 32px var(--accent-glow);
  font-variant-numeric: tabular-nums;
}
.calc-unit { font: 600 1.1rem var(--font-display); color: var(--ink); }
.calc-stats { margin: 0; width: 100%; display: grid; gap: 0; border-top: 1px solid var(--line); }
.calc-stats div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.calc-stats dt { color: var(--muted); }
.calc-stats dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-note { color: var(--muted); font-size: .8125rem; }
@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; }
  .calc-results { border-left: 0; border-top: 1px solid var(--line); }
}

/* Pasos compactos (inicio) */
.steps-inline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.steps-inline li { counter-increment: step; padding-top: 22px; position: relative; }
.steps-inline li::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(23, 184, 166, .1));
}
.steps-inline li::after {
  content: counter(step);
  position: absolute; top: -13px; left: 0;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg); border: 1px solid var(--accent);
  font: 600 .8rem var(--font-display); color: var(--accent);
}
.steps-inline h3 { margin-top: 12px; }
.steps-inline p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
@media (max-width: 900px) { .steps-inline { grid-template-columns: 1fr 1fr; row-gap: 40px; } }
@media (max-width: 520px) { .steps-inline { grid-template-columns: 1fr; } }
/* Animación al aparecer por primera vez (main.js añade will-animate y luego is-visible):
   cada círculo se enciende, aparece su texto y la línea avanza hasta el siguiente paso */
.steps-inline li:nth-child(1) { --i: 0; }
.steps-inline li:nth-child(2) { --i: 1; }
.steps-inline li:nth-child(3) { --i: 2; }
.steps-inline li:nth-child(4) { --i: 3; }
.steps-inline li::before { transform-origin: left; transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.steps-inline li::after { transition: transform .35s cubic-bezier(.2, .8, .2, 1), background-color .3s ease, color .3s ease, box-shadow .3s ease; z-index: 1; }
.steps-inline h3, .steps-inline p { transition: opacity .45s ease, transform .45s cubic-bezier(.2, .8, .2, 1), color .25s ease; }
.steps-inline.will-animate li::before { transform: scaleX(0); }
.steps-inline.will-animate li::after { transform: scale(.55); opacity: .35; }
.steps-inline.will-animate h3, .steps-inline.will-animate p { opacity: 0; transform: translateY(10px); }
.steps-inline.is-visible li::before { transform: scaleX(1); transition-delay: calc(var(--i) * .55s + .2s); }
.steps-inline.is-visible li::after {
  transform: scale(1); opacity: 1;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px var(--accent-glow);
  transition-delay: calc(var(--i) * .55s);
}
.steps-inline.is-visible h3, .steps-inline.is-visible p { opacity: 1; transform: none; transition-delay: calc(var(--i) * .55s + .1s); }
/* al pasar el ratón por un paso */
.steps-inline li:hover::after { transform: scale(1.15); transition-delay: 0s; }
.steps-inline li:hover h3 { color: var(--accent); transition-delay: 0s; }
.steps-inline li:hover p { color: var(--ink); transition-delay: 0s; }

/* Bloque dividido texto + panel */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split p + p { margin-top: 16px; }
.split .muted { color: var(--muted); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Llamada a la acción final */
.cta-band {
  padding: clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute; inset: auto -10% -120% auto;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(23, 184, 166, .3), transparent 65%);
  pointer-events: none;
}
.cta-band p { color: var(--muted); margin-top: 14px; max-width: 48ch; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* ---------- Servicios (página) ---------- */
.service-block {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 5vw, 72px);
  padding: clamp(56px, 8vw, 96px) 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.service-block:first-child { border-top: 0; padding-top: 0; }
.service-block .icon { margin-bottom: 24px; }
.service-block h2 + p { margin-top: 18px; color: var(--muted); max-width: 48ch; }
.feature-list { list-style: none; margin: 0; padding: 28px; display: grid; gap: 16px; }
.feature-list li { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; }
.feature-list li::before {
  content: "";
  width: 22px; height: 22px; margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317B8A6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 13px no-repeat;
  border: 1px solid rgba(23, 184, 166, .4);
}
.feature-list strong { display: block; font-weight: 600; }
.feature-list span { color: var(--muted); font-size: .96875rem; }
.service-side { display: grid; gap: 20px; }
/* recuadro «Pruébalo ahora» de Agentes de IA */
.service-demo {
  margin-top: 28px; padding: 20px 22px;
  border: 1px solid rgba(23, 184, 166, .35); border-radius: var(--radius-m);
  background: var(--accent-soft);
  display: grid; gap: 14px; justify-items: start;
}
.service-block .service-demo p { margin: 0; color: var(--ink); font-size: .96875rem; }
@media (max-width: 860px) { .service-block { grid-template-columns: 1fr; } }

.tags-label { color: var(--muted); font-size: .9375rem; margin-bottom: -8px; }
.tags-label strong { color: var(--ink); font-weight: 600; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .9rem; color: var(--muted);
  background: rgba(246, 248, 249, .02);
}

/* Demo de flujo: tareas sueltas que se ordenan */
.flow { margin: 0; padding: clamp(22px, 3.5vw, 32px); overflow: hidden; }
/* en móvil el desorden es más suave para que las tareas no se salgan del recuadro */
@media (max-width: 560px) {
  .flow .flow-item { transform: translate(calc(var(--x) * .35), calc(var(--y) * .5)) rotate(calc(var(--r) * .5)); }
}
.flow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; }
.flow-list::before {
  content: "";
  position: absolute; left: 21px; top: 24px; bottom: 24px;
  width: 2px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform-origin: top; transform: scaleY(0);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1) .35s;
}
.flow-item {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px 13px 44px;
  background: rgba(7, 26, 43, .6);
  border: 1px dashed var(--slate);
  border-radius: var(--radius-s);
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), border-color .3s ease;
}
.flow-item:nth-child(2) { transition-delay: .06s; }
.flow-item:nth-child(3) { transition-delay: .12s; }
.flow-item:nth-child(4) { transition-delay: .18s; }
.flow-item::before {
  content: "";
  position: absolute; left: 15px; top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%;
  border: 2px solid var(--slate);
  background: var(--bg);
  z-index: 1;
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.flow-task { font-weight: 500; }
.flow-state {
  flex-shrink: 0;
  font-size: .8125rem; font-weight: 600; color: var(--accent);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .3s ease, transform .3s ease;
}
.flow-caption {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .96875rem;
}
.flow-toggle {
  background: none; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; white-space: nowrap;
  font: 600 .9375rem var(--font-body); color: var(--ink);
}
.flow-toggle:hover { border-color: var(--accent); }
.flow.is-formed .flow-list::before { transform: scaleY(1); }
.flow.is-formed .flow-item { transform: none; border-style: solid; border-color: var(--line-strong); }
.flow.is-formed .flow-item::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.flow.is-formed .flow-state { opacity: 1; transform: none; transition-delay: .6s; }

/* ---------- Proceso (página): línea de tiempo ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; counter-reset: step; }
.timeline::before {
  content: "";
  position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(var(--accent), rgba(23, 184, 166, .08));
}
.timeline-step {
  counter-increment: step;
  position: relative;
  display: grid; grid-template-columns: 56px 1fr; gap: clamp(20px, 3vw, 40px);
  padding-bottom: 48px;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: counter(step);
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 6px var(--bg), 0 0 24px -2px var(--accent-glow);
  font: 600 1.1rem var(--font-display); color: var(--accent);
  position: relative; z-index: 1;
}
.timeline-card { padding: 28px 30px; }
.timeline-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.timeline-card .duration { color: var(--accent); font-weight: 600; font-size: .9375rem; }
.timeline-card p { margin-top: 12px; color: var(--muted); }
.timeline-card ul { margin: 14px 0 0; padding-left: 20px; color: var(--muted); }
.timeline-card li + li { margin-top: 4px; }
.timeline-card li::marker { color: var(--accent); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0;
  font-weight: 600; font-size: 1.125rem;
  cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font: 400 1.2rem/1 var(--font-body);
  color: var(--accent);
  transition: transform .2s ease, border-color .2s ease;
}
.faq summary:hover::after { border-color: var(--accent); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; color: var(--muted); max-width: 62ch; }
@media (max-width: 800px) { .faq-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Quiénes somos ---------- */
.name-story { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 16px; align-items: stretch; }
.name-part { padding: 28px; text-align: center; }
.name-part .word { font: 600 clamp(1.6rem, 3vw, 2.2rem) var(--font-display); letter-spacing: -0.03em; }
.name-part .word-accent { color: var(--accent); text-shadow: 0 0 24px var(--accent-glow); }
.name-part p { color: var(--muted); margin-top: 8px; font-size: .96875rem; }
.name-op { font: 400 1.8rem var(--font-display); color: var(--slate); text-align: center; align-self: center; }

/* Tarjetas Melt + Form = Meltform: interacción al pasar el cursor */
.name-part {
  overflow: hidden; isolation: isolate;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
/* luz que sigue al cursor (main.js actualiza --mx y --my) */
.name-part::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 40%), rgba(23, 184, 166, .24), transparent 70%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.name-part:hover::before { opacity: 1; }
.name-part:hover { transform: translateY(-4px); box-shadow: 0 22px 50px -22px var(--accent-glow); }
.name-part .word { position: relative; display: inline-block; margin-bottom: 14px; transition: color .3s ease; }
.word-letters { display: inline-flex; }
.word-letters span {
  display: inline-block;
  transform-origin: 50% 0;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .3s ease;
  transition-delay: calc(var(--i) * 45ms);
}

/* Melt: las letras se funden y gotean */
.name-part:hover .word-melt { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.name-part:hover .word-melt span { transform: translateY(calc(var(--d) * 1px)) scaleY(1.15); filter: blur(.3px); }

/* Form: las letras llegan desordenadas y encajan */
.name-part:hover .word-form { color: var(--ink); }
.name-part:hover .word-form span {
  animation: form-snap .6s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i) * 55ms);
}
@keyframes form-snap {
  from { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: .25; }
  to { transform: none; opacity: 1; }
}

/* Form y Meltform: aparece la línea turquesa del logo */
.word-form::after, .word-shine::after {
  content: "";
  position: absolute; left: -6%; right: -6%; bottom: -9px;
  height: 4px; border-radius: 4px;
  background: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
  transform: scaleX(0);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1) .2s;
}
.name-part:hover .word-form::after, .name-part:hover .word-shine::after { transform: scaleX(1); }

/* Meltform: un destello de luz recorre la palabra */
.word-shine {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent) 40%, #e9fffb 50%, var(--accent) 60%, var(--accent) 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.name-part:hover .word-shine { animation: word-shine 1.1s ease forwards; }
@keyframes word-shine { to { background-position: 0 0; } }

/* los símbolos + y = se iluminan */
.name-op { transition: color .3s ease, text-shadow .3s ease; }
.name-story:has(.name-part:hover) .name-op { color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }

@media (prefers-reduced-motion: reduce) {
  .name-part:hover { transform: none; }
  .name-part:hover .word-melt span { transform: none; filter: none; }
  .name-part:hover .word-form span, .name-part:hover .word-shine { animation: none; }
}
@media (max-width: 800px) {
  .name-story { grid-template-columns: 1fr; }
  .name-op { line-height: 1; }
}

.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.value { padding: 30px; }
.value h3 { margin-top: 20px; }
.value p { color: var(--muted); margin-top: 10px; }
@media (max-width: 1100px) { .values { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .values { grid-template-columns: 1fr; } }


.placeholder {
  background: var(--accent-soft);
  border: 1px dashed rgba(23, 184, 166, .5);
  color: var(--ink);
  padding: 0 5px; border-radius: 4px;
}

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.contact-info { display: grid; gap: 16px; }
.info-item { padding: 22px 24px; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: center; }
.info-item .icon { width: 44px; height: 44px; border-radius: 12px; }
.info-item .icon svg { width: 22px; height: 22px; }
.info-item strong { display: block; }
.info-item span, .info-item a { color: var(--muted); }
.info-item a:hover { color: var(--accent); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: clamp(24px, 4vw, 40px); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9375rem; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 15px;
  background: rgba(7, 26, 43, .7);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  font: inherit; color: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field select option { background: var(--bg-raised); }
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: .875rem; }
.field-error:empty { display: none; }
.field-check { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.field-check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.field-check label { font-weight: 400; flex: 1; color: var(--muted); }
.field-check label a { color: var(--ink); }
.field-check .field-error { flex-basis: 100%; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-status { font-weight: 500; }
.form-status.is-ok { color: var(--accent); }
.form-status.is-error { color: var(--error); }
.hp { position: absolute; left: -9999px; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* ---------- Reservar (reservar.html + reservar.js) ---------- */
.booking { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(20px, 3vw, 32px); align-items: start; }
.booking-picker { padding: clamp(22px, 3.5vw, 32px); display: grid; gap: 30px; }
.booking-title { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; margin-bottom: 16px; }
.booking-num {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--accent); color: var(--accent);
  font: 600 .85rem var(--font-display);
}
.booking-sub { color: var(--muted); margin: -6px 0 14px; }
.cal-range { color: var(--muted); font-size: .9375rem; margin-bottom: 14px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week span { text-align: center; font-size: .8125rem; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.cal-day {
  position: relative; aspect-ratio: 1; min-height: 40px;
  display: grid; place-items: center; align-content: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: rgba(7, 26, 43, .5); color: var(--ink);
  font: 600 .96875rem var(--font-body); cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.cal-skel {
  aspect-ratio: 1; min-height: 40px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(246, 248, 249, .04) 30%, rgba(23, 184, 166, .12) 50%, rgba(246, 248, 249, .04) 70%);
  background-size: 300% 100%;
  animation: cal-skel 1.4s ease-in-out infinite;
}
@keyframes cal-skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .cal-skel { animation: none; } }
.cal-day:hover:not(:disabled) { border-color: var(--accent); }
.cal-day:disabled { color: var(--slate); border-color: transparent; background: none; cursor: default; text-decoration: line-through; }
.cal-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 18px -4px var(--accent-glow); }
.cal-month { font-size: .625rem; font-weight: 600; text-transform: lowercase; line-height: 1; color: var(--accent); }
.cal-day[aria-pressed="true"] .cal-month { color: var(--accent-ink); }
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.hour {
  padding: 10px 0; border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(7, 26, 43, .5); color: var(--ink);
  font: 600 .9375rem var(--font-body); cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.hour:hover { border-color: var(--accent); }
.hour[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.booking-msg:empty { display: none; }
.booking-msg { color: var(--muted); }
.booking-msg a { color: var(--accent); }
.booking-form .booking-title { margin-bottom: 0; }
.booking-summary {
  padding: 14px 16px; border-radius: var(--radius-s);
  border: 1px dashed var(--line-strong); color: var(--muted); font-size: .96875rem;
}
.booking-summary.is-set { border: 1px solid rgba(23, 184, 166, .45); background: var(--accent-soft); color: var(--ink); }
.modalidad { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.modalidad legend { font-weight: 600; font-size: .9375rem; margin-bottom: 10px; padding: 0; }
.choice { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.booking-done { padding: clamp(24px, 4vw, 40px); display: grid; gap: 14px; justify-items: start; }
.booking-done:focus { outline: none; }
.booking-done p { color: var(--muted); }
.booking-done #done-detail { color: var(--ink); font-size: 1.125rem; }
@media (max-width: 900px) { .booking { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(7, 26, 43, .7); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.footer-brand p { color: var(--muted); margin-top: 16px; max-width: 34ch; font-size: .96875rem; }
.footer-col h2 { font: 600 .9375rem var(--font-body); letter-spacing: 0; color: var(--ink); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: .96875rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 22px; padding-bottom: 28px; color: var(--muted); font-size: .875rem;; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Páginas legales ---------- */
.legal { padding: clamp(56px, 8vw, 104px) 0 var(--section-space); }
.legal .wrap { max-width: 800px; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 32px; }
.legal h2 { font-size: 1.3rem; margin: 44px 0 12px; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 12px; }
.legal section { scroll-margin-top: 110px; }
.legal ul { padding-left: 20px; margin: 12px 0; }
.legal li + li { margin-top: 6px; }
.legal li::marker { color: var(--accent); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--accent); }
.legal code { font-size: .9em; padding: 1px 6px; border-radius: 4px; background: rgba(246, 248, 249, .07); color: var(--ink); }
.legal-updated { margin-top: -18px; font-size: .9375rem; }
.legal-note { margin-top: 10px; font-size: .9375rem; }
.legal-note + p { margin-top: 28px; }
.legal-toc {
  margin: 36px 0 8px; padding: 22px 26px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  background: rgba(15, 42, 67, .45);
}
.legal .legal-toc h2 { margin: 0 0 10px; font-size: 1rem; font-family: var(--font-body); letter-spacing: 0; }
.legal-toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.legal-toc li { break-inside: avoid; margin: 0 0 6px; }
.legal-toc a { text-decoration: none; color: var(--muted); }
.legal-toc a:hover { color: var(--accent); }
@media (max-width: 640px) { .legal-toc ol { columns: 1; } }
.legal-data {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px;
  margin: 16px 0; padding: 20px 24px;
  border: 1px solid var(--line); border-radius: var(--radius-m);
  background: rgba(15, 42, 67, .35);
}
.legal-data dt { color: var(--ink); font-weight: 600; }
.legal-data dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .legal-data { grid-template-columns: 1fr; gap: 2px; } .legal-data dd { margin-bottom: 10px; } }
.legal-table-wrap { margin: 16px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
.legal-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: .9375rem; }
.legal-table th, .legal-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal-table th { color: var(--ink); font-weight: 600; background: rgba(23, 184, 166, .08); }
.legal-table td { color: var(--muted); }
.legal-table tr:last-child td { border-bottom: 0; }

/* ---------- WhatsApp ---------- */
.wa-card { padding: 28px; display: grid; gap: 12px; justify-items: start; }
.wa-card .icon { width: 48px; height: 48px; }
.wa-card h2 { font-size: 1.3rem; margin-top: 6px; }
.wa-card p { color: var(--muted); }
.wa-card .btn { margin-top: 6px; }

/* botón flotante (lo añade main.js en todas las páginas) */
.wa-float {
  position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); z-index: 60;
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 17px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none; font-weight: 600;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55), 0 0 0 0 var(--accent-glow);
  transition: box-shadow .25s ease, transform .15s ease, opacity .3s ease;
}
.wa-float svg { width: 26px; height: 26px; flex-shrink: 0; }
.wa-float:hover { box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55), 0 0 0 6px var(--accent-soft), 0 8px 32px -6px var(--accent-glow); }
.wa-float:active { transform: scale(.97); }
.wa-float-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s ease; }
.wa-float:hover .wa-float-label, .wa-float:focus-visible .wa-float-label { max-width: 220px; }

/* ---------- Chat con Meltbot (chat.js) ---------- */
.mb-launcher {
  position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); z-index: 61;
  display: flex; align-items: center;
  height: 58px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem var(--font-body);
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55);
  transition: box-shadow .25s ease, transform .15s ease, opacity .3s ease;
}
/* el texto se pliega: el botón queda como icono y se despliega al cargar (is-peek) o al pasar el ratón */
.mb-launcher-text {
  max-width: 0; overflow: hidden; white-space: nowrap;
  transition: max-width .35s ease, margin .35s ease;
}
.mb-launcher.is-peek .mb-launcher-text,
.mb-launcher:hover .mb-launcher-text,
.mb-launcher:focus-visible .mb-launcher-text { max-width: 200px; margin: 0 6px 0 10px; }
.mb-launcher:hover { box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55), 0 0 0 6px var(--accent-soft), 0 8px 32px -6px var(--accent-glow); }
.mb-launcher:active { transform: scale(.97); }
.mb-launcher-icon svg { width: 26px; height: 26px; display: block; }
.mb-launcher[aria-expanded="true"] .mb-launcher-text { display: none; }

/* con el chat, WhatsApp sube y queda como botón redondo */
.has-meltbot .wa-float { bottom: calc(clamp(16px, 3vw, 28px) + 70px); height: 52px; padding: 0 13px; }
.has-meltbot .wa-float svg { width: 26px; height: 26px; }
.has-meltbot .wa-float .wa-float-label { display: none; }
.meltbot-open .wa-float { display: none; }

.mb-panel {
  position: fixed; z-index: 70;
  right: clamp(16px, 3vw, 28px); bottom: calc(clamp(16px, 3vw, 28px) + 72px);
  width: min(400px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 140px));
  display: flex; flex-direction: column;
  background: rgba(10, 32, 52, .96);
  border: 1px solid rgba(23, 184, 166, .35);
  border-radius: var(--radius-l);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 40px -18px var(--accent-glow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: mb-in .28s cubic-bezier(.2, .8, .2, 1);
}
.mb-panel[hidden] { display: none; }
@keyframes mb-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.mb-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 184, 166, .1), transparent);
}
.mb-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-raised); border: 1px solid rgba(23, 184, 166, .45);
  color: var(--ink);
}
.mb-avatar svg { width: 24px; }
.mb-title { flex: 1; display: grid; line-height: 1.3; }
.mb-title strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.mb-title span { color: var(--muted); font-size: .84rem; }
.mb-close {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 50%;
  color: var(--muted); cursor: pointer;
}
.mb-close:hover { color: var(--ink); border-color: var(--line-strong); }
.mb-close svg { width: 20px; height: 20px; }

.mb-messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 16px;
}
.mb-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .96875rem; line-height: 1.5;
  overflow-wrap: anywhere;
}
.mb-bot { align-self: flex-start; background: rgba(246, 248, 249, .07); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.mb-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.mb-bot a { color: var(--accent); }
.mb-user a { color: inherit; }
.mb-error { border-color: rgba(255, 122, 133, .45); }
.mb-user + .mb-bot, .mb-bot + .mb-user { margin-top: 8px; }

.mb-typing { display: flex; gap: 5px; padding: 14px 16px; }
.mb-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: mb-dot 1.2s infinite ease-in-out;
}
.mb-typing span:nth-child(2) { animation-delay: .15s; }
.mb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mb-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.mb-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 6px 14px; border-top: 1px solid var(--line); }
.mb-input {
  flex: 1; resize: none;
  max-height: 140px;
  padding: 11px 14px;
  background: rgba(7, 26, 43, .8);
  border: 1px solid var(--line-strong); border-radius: 14px;
  color: var(--ink); font: inherit; font-size: .96875rem; line-height: 1.45;
}
.mb-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mb-send {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  cursor: pointer;
}
.mb-send:disabled { opacity: .4; cursor: default; }
.mb-send svg { width: 20px; height: 20px; }
.mb-note { padding: 4px 16px 12px; font-size: .75rem; color: var(--muted); text-align: center; }
.mb-note a { color: var(--ink); }

@media (max-width: 639px) {
  .mb-launcher-text { display: none; }
  /* en móvil los botones flotantes aparecen al bajar, para no tapar la cabecera de la página */
  .fab-hidden .mb-launcher, .fab-hidden .wa-float { opacity: 0; transform: translateY(12px); pointer-events: none; }
  .mb-launcher, .wa-float { height: 52px; }
  .mb-launcher { padding: 0 13px; }
  .has-meltbot .wa-float { bottom: calc(16px + 62px); }
  /* espacio al final para que los botones no tapen el pie */
  .site-footer { padding-bottom: 76px; }
  .mb-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .meltbot-open .mb-launcher { display: none; }
  .meltbot-open { overflow: hidden; }
}

/* ---------- Pantalla de entrada (index.html) ---------- */
/* Todo es CSS: aparece, dura 3 s y se desvanece aunque falle el JavaScript */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--bg-raised); /* Azul marino de marca */
  animation: splash-out .8s cubic-bezier(.7, 0, .3, 1) 3.1s forwards;
}
.no-splash .splash { display: none; }
.splash-inner {
  display: grid; justify-items: center; gap: 26px;
  animation: splash-zoom .8s cubic-bezier(.7, 0, .3, 1) 3s forwards;
}
.splash-logo { width: clamp(110px, 24vw, 160px); height: auto; overflow: visible; }
.splash-m {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: splash-draw 1.1s cubic-bezier(.6, 0, .2, 1) .2s forwards;
}
.splash-line {
  transform-box: fill-box; transform-origin: center; transform: scaleX(0);
  filter: drop-shadow(0 0 6px rgba(23, 184, 166, .8));
  animation: splash-grow .6s cubic-bezier(.2, .8, .2, 1) 1.1s forwards;
}
.splash-name {
  font: 600 clamp(1.9rem, 6vw, 2.8rem)/1 var(--font-display);
  letter-spacing: -0.03em;
  opacity: 0; transform: translateY(10px);
  animation: splash-rise .6s cubic-bezier(.2, .8, .2, 1) 1.35s forwards;
}
@keyframes splash-draw { to { stroke-dashoffset: 0; } }
@keyframes splash-grow { to { transform: scaleX(1); } }
@keyframes splash-rise { to { opacity: 1; transform: none; } }
@keyframes splash-zoom { to { opacity: 0; transform: scale(1.12); } }
@keyframes splash-out  { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .splash-m, .splash-line, .splash-name { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
  .splash-inner { animation: none; }
}

/* ---------- Ajustes solo para móvil y tablet (hasta 900 px) ----------
   En ordenador no se aplica nada de este bloque. */
@media (max-width: 900px) {
  /* Inicio: lema, texto y botones centrados */
  .hero-copy { text-align: center; }
  .hero-copy h1, .hero-copy .lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }

  /* Servicios: botón «Hablar con Meltbot» centrado */
  .service-demo .btn { justify-self: center; }

  /* Cómo trabajamos: «Empieza por la llamada» antes de las preguntas frecuentes */
  .page-proceso main { display: flex; flex-direction: column; }
  .page-proceso .faq-section { order: 1; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
}
