/*
VOICE: cercano y confiable, como una buena veterinaria de barrio: cálido, ordenado, con una sonrisa.
IDEA: una vitrina con su mascota: Vetri, un cachorro con collar de veterinaria, presenta la clínica y conversa.
PICTURE: Vetri asomado sobre la tarjeta de Maps de una clínica ficticia; sigue el cursor, parpadea y mueve la cola.
COLOUR and TYPE: azul petróleo #0b4f6c (confianza y salud), agua #e3f4f2 (calma y limpieza), coral #ff7a59 (calidez y acción). Baloo 2 + Nunito Sans.
LAYOUT: hero con mascota, cinta de palabras, banda profunda de problemas, calculadora, paquete seleccionable, pasos, formulario, chat flotante.
*/

/* Fuentes propias (latin, variables). Licencias OFL en fonts/. */
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("fonts/baloo2-latin.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/nunitosans-latin.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0c1a20);
  --ink: light-dark(#14252e, #eef6f6);
  --muted: light-dark(#4b5d66, #a9bfc4);
  --line: light-dark(#d8e6e8, #23404a);
  --soft: light-dark(#e3f4f2, #11262e);
  --card: light-dark(#ffffff, #152f38);
  --brand: #0b4f6c;
  --brand-2: light-dark(#0b4f6c, #7fd1dc);
  --coral: #ff7a59;
  --coral-ink: light-dark(#b8412a, #ff9a80);
  --sun: #ffc857;
  --radius: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 "Nunito Sans", system-ui, sans-serif; overflow-x: clip; }
h1, h2, h3 { font-family: "Baloo 2", "Nunito Sans", sans-serif; line-height: 1.05; margin: 0 0 16px; text-wrap: balance; font-weight: 800; }
h1 { font-size: clamp(36px, 5.2vw, 54px); }
h2 { font-size: clamp(30px, 3.8vw, 42px); }
h3 { font-size: 22px; font-weight: 700; }
p { margin: 0 0 16px; max-width: 64ch; }
a { color: var(--coral-ink); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.band { padding: clamp(48px, 7vw, 96px) max(5vw, 16px); }
.wrap { max-width: 1160px; margin: 0 auto; }
.narrow { max-width: 760px; }
.sub { color: var(--muted); margin-bottom: 40px; }
.fine { font-size: 14px; color: var(--muted); }
.kicker { font-weight: 700; color: var(--brand-2); margin-bottom: 16px; }
.soft { background: var(--soft); }
.deep { background: var(--brand); color: #eef6f6; }
.deep .sub, .deep p { color: #cfe6ea; }

/* Navegación */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.nav { max-width: 1160px; margin: 0 auto; padding: 8px max(5vw, 16px); display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-height: 48px; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 24px; }
.brand-by { font-size: 13px; color: var(--muted); }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav-links a { display: inline-flex; align-items: center; min-height: 48px; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-links a:hover { color: var(--coral-ink); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 24px; border-radius: 999px; border: 2px solid var(--coral); background: var(--coral); color: #14252e; font: 700 16px/1 "Nunito Sans", sans-serif; text-decoration: none; cursor: pointer; transition: transform .25s var(--spring); }
.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: scale(.97); }
/* Foco: petróleo sobre fondos claros y amarillo sobre fondos oscuros (3:1 o más en ambos casos) */
:focus-visible { outline: 3px solid light-dark(#0b4f6c, #ffc857); outline-offset: 3px; }
.deep :focus-visible, .foot :focus-visible, .chat-head :focus-visible { outline-color: #ffc857; }
.deep .form :focus-visible { outline-color: #0b4f6c; }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--brand-2); }
.btn-wa { background: #25d366; border-color: #25d366; }
.btn[aria-disabled=true] { opacity: .45; pointer-events: none; }

/* Hero */
.hero { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.lead { font-size: 19px; color: var(--muted); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; margin: 32px 0 16px; }
.stage { position: relative; padding-top: 168px; }
.stage::before { content: ""; position: absolute; inset: 40px -5% 10% -5%; border-radius: 48% 52% 44% 56%; background: var(--soft); z-index: -1; }
.vetri-btn { position: absolute; top: 0; left: 50%; width: 200px; height: 210px; margin-left: -100px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; border-radius: 50%; }
.vetri { width: 100%; height: 100%; display: block; overflow: visible; }
.vetri-btn.jump { animation: jump .6s var(--spring); }
.bubble { position: absolute; top: 8px; right: 0; max-width: 224px; background: var(--card); color: var(--ink); border: 2px solid var(--brand-2); border-radius: 24px 24px 24px 4px; padding: 8px 16px; font-weight: 700; font-size: 15px; z-index: 3; box-shadow: 0 8px 24px -12px rgba(11, 79, 108, .5); }
.vitrina { position: relative; margin: 0; }
.glass { background: var(--card); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 64px -28px rgba(11, 79, 108, .55); }
.card-clinic { padding: 32px 24px 16px; border-top: 8px solid var(--coral); }
.clinic-name { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 22px; margin-bottom: 4px; }
.clinic-meta { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.stars { color: light-dark(#b45f06, #ffc857); letter-spacing: 1px; }
.clinic-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; }
.pill-solid { background: var(--coral); border-color: var(--coral); color: #14252e; }
.chat-demo { background: var(--soft); padding: 16px 24px 24px; display: grid; gap: 8px; }
.msg { margin: 0; padding: 8px 16px; border-radius: 16px; font-size: 15px; max-width: 85%; }
.msg-in { background: var(--card); justify-self: start; border-bottom-left-radius: 4px; }
.msg-out { background: #d9fdd3; color: #14252e; justify-self: end; border-bottom-right-radius: 4px; }
.msg-time { margin: 0; font-size: 13px; color: var(--muted); justify-self: end; }
.chat-demo .msg-in { grid-row: 1; }
.chat-demo .msg-out, .typing { grid-row: 2; grid-column: 1; }
.chat-demo .msg-time { grid-row: 3; }
.typing { justify-self: end; display: flex; gap: 4px; margin: 0; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: #d9fdd3; opacity: 0; }
.typing span, .c-typing span { width: 8px; height: 8px; border-radius: 50%; background: #3b6b5a; }
.vitrina figcaption { margin-top: 16px; text-align: center; }

/* Mascota: animaciones */
.tail { transform-origin: 150px 158px; animation: wag 1.2s ease-in-out infinite; }
.eyes { transform-origin: 100px 94px; animation: blink 5s infinite; }
.pupils { transition: transform .15s ease-out; }
.ear-l { transform-origin: 60px 60px; }
.ear-r { transform-origin: 140px 60px; }
.happy .ear-l { animation: earL .5s var(--ease) 2; }
.happy .ear-r { animation: earR .5s var(--ease) 2; }
@keyframes wag { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(14deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-24px) rotate(-4deg); } }
@keyframes earL { 50% { transform: rotate(-14deg); } }
@keyframes earR { 50% { transform: rotate(14deg); } }

/* Cinta */
.ticker { background: var(--coral); color: #14252e; overflow: hidden; padding: 16px 0; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 20px; }
.ticker-track { display: flex; gap: 48px; width: max-content; animation: slide 30s linear infinite; }
.ticker-track span::after { content: "•"; margin-left: 48px; color: var(--brand); }
@keyframes slide { to { transform: translateX(-50%); } }

/* Problemas */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pain { background: rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 24px; border-top: 4px solid var(--sun); }
.pain p { margin: 0; }

/* Calculadora */
.calc { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.calc-inputs label { display: flex; justify-content: space-between; gap: 16px; font-weight: 700; margin-top: 24px; }
.calc-inputs output { color: var(--coral-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type=range] { width: 100%; height: 44px; accent-color: var(--coral); cursor: pointer; }
.calc-result { background: var(--soft); border-radius: 32px; padding: 32px; text-align: center; }
.res-label { font-weight: 700; margin: 0 auto 8px; }
.res-big { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(44px, 6vw, 64px); line-height: 1; color: var(--brand-2); margin: 0 auto 8px; font-variant-numeric: tabular-nums; }
.res-money { font-size: 24px; font-weight: 700; color: var(--coral-ink); margin: 0 auto 16px; white-space: nowrap; }
.calc-result .fine { margin: 0 auto 24px; }
.res-big.pop { animation: pop .35s var(--spring); }
@keyframes pop { 50% { transform: scale(1.08); } }

/* Servicios seleccionables */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.service { position: relative; display: grid; gap: 8px; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 32px; cursor: pointer; transition: transform .3s var(--spring); }
.service::after { content: ""; position: absolute; inset: -2px; border: 2px solid var(--coral); border-radius: inherit; opacity: 0; transition: opacity .2s; pointer-events: none; }
.service:hover { transform: translateY(-4px); }
.service[aria-pressed=true]::after { opacity: 1; }
.svc-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--soft); display: grid; place-items: center; }
.svc-icon svg { width: 24px; height: 24px; fill: var(--brand-2); }
.svc-tag { font-size: 14px; font-weight: 700; color: var(--coral-ink); }
.svc-title { font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 22px; line-height: 1.15; }
.svc-text { color: var(--muted); }
.check { position: absolute; top: 24px; right: 24px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.service[aria-pressed=true] .check { background: var(--coral); border-color: var(--coral); }
.service[aria-pressed=true] .check::after { content: ""; width: 12px; height: 7px; border-left: 3px solid #14252e; border-bottom: 3px solid #14252e; transform: rotate(-45deg) translate(1px, -1px); }
.pack-bar { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 24px; }
.pack-bar p { margin: 0; font-weight: 700; flex: 1 1 200px; }
.pack-vetri { width: 48px; height: 52px; flex: none; overflow: visible; }
.pack-vetri.hop { animation: jump .6s var(--spring); }
.service[aria-pressed=true] .check { animation: check-pop .35s var(--spring); }
@keyframes check-pop { from { transform: scale(.4); } }

/* Pasos */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-top: 72px; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--coral); color: #14252e; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 26px; }
.steps p { color: var(--muted); margin: 0; }

/* Quiénes somos */
.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.facts li { background: var(--card); border-radius: var(--radius); padding: 16px 24px; display: grid; gap: 4px; }
.facts span { color: var(--muted); font-size: 15px; }

/* Formulario */
.form-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.vetri-side { width: 180px; height: 190px; margin-top: 24px; }
.form { background: #fff; color: #14252e; border-radius: 32px; padding: 32px; display: grid; gap: 8px; }
.form label { font-weight: 700; font-size: 15px; margin-top: 8px; }
.form input, .form select { font: inherit; font-size: 16px; min-height: 48px; padding: 8px 16px; border: 2px solid #d8e6e8; border-radius: 16px; background: #fff; color: #14252e; width: 100%; }
.form .btn { margin-top: 16px; }
.form .fine { color: #4b5d66; margin: 8px 0 0; }
.form-link { display: inline-flex; align-items: center; min-height: 44px; justify-self: start; font-size: 14px; color: #b8412a; font-weight: 700; }
.form .form-error { color: #b42318; font-weight: 700; margin: 8px 0 0; }

/* Preguntas */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 18px; min-height: 48px; display: flex; align-items: center; }
details p { color: var(--muted); margin: 8px 0 0; }

/* Pie */
.foot { background: #082f40; color: #cfe6ea; padding-block: 40px calc(96px + env(safe-area-inset-bottom)); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot p { margin: 0; }
.foot strong { color: #fff; }

.foot-legal { display: flex; flex-wrap: wrap; gap: 0 24px; list-style: none; margin: 24px 0 0; padding: 0; width: 100%; }
.foot-legal a { display: inline-flex; align-items: center; min-height: 48px; color: #fff; font-weight: 700; }
.foot .fine { color: #cfe6ea; width: 100%; }

/* 404 */
.lost { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.lost p { margin-inline: auto; }
.lost .hero-ctas { justify-content: center; }
.lost-vetri { width: 176px; height: auto; margin-bottom: 24px; }

/* Asistente */
.assistant { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; display: grid; justify-items: end; gap: 16px; }
.chat-fab { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 4px 24px 4px 4px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: 700 15px "Nunito Sans", sans-serif; cursor: pointer; box-shadow: 0 12px 28px -10px rgba(11, 79, 108, .7); transition: transform .25s var(--spring); }
.chat-fab:hover { transform: scale(1.04); }
.chat-fab svg { width: 48px; height: 48px; background: #e3f4f2; border-radius: 50%; padding: 4px; }
.panel-chat { width: min(360px, calc(100vw - 32px)); max-height: min(560px, 75vh); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 64px -20px rgba(0, 0, 0, .45); animation: rise .3s var(--spring); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.chat-head { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--brand); color: #fff; }
.chat-avatar { width: 48px; height: 48px; background: #e3f4f2; border-radius: 50%; padding: 4px; flex: none; }
.chat-head p { margin: 0; }
.chat-name { font-weight: 800; }
.chat-role { font-size: 13px; color: #cfe6ea; }
.chat-close { margin-left: auto; width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 28px; cursor: pointer; border-radius: 50%; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 8px; align-content: start; }
.c-msg { margin: 0; padding: 8px 16px; border-radius: 16px; font-size: 15px; max-width: 88%; }
.c-bot { background: var(--soft); justify-self: start; border-bottom-left-radius: 4px; }
.c-user { background: var(--coral); color: #14252e; justify-self: end; border-bottom-right-radius: 4px; }
.c-msg a { font-weight: 700; }
.c-typing { display: flex; gap: 4px; padding: 12px 16px; }
.c-typing span { animation: dot 1s ease-in-out infinite; }
.c-typing span:nth-child(2) { animation-delay: .15s; }
.c-typing span:nth-child(3) { animation-delay: .3s; }
.chips { display: flex; gap: 8px; padding: 0 16px 16px; overflow-x: auto; scrollbar-width: thin; }
.chips button { flex: none; white-space: nowrap; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--brand-2); background: transparent; color: var(--brand-2); font: 700 14px "Nunito Sans", sans-serif; cursor: pointer; }
.chat-form { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; font: inherit; font-size: 16px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }

/* Aparición */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.grid-3 > .reveal:nth-child(2), .steps > .reveal:nth-child(2), .facts > .reveal:nth-child(2) { transition-delay: .1s; }
.grid-3 > .reveal:nth-child(3), .steps > .reveal:nth-child(3), .facts > .reveal:nth-child(3) { transition-delay: .2s; }

/* Entrada del hero: texto en cascada, la vitrina sube y Vetri asoma */
.hero-copy > * { animation: rise-in .7s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero-copy > :nth-child(5) { animation-delay: .32s; }
.vitrina { animation: rise-in .8s var(--ease) .2s both; }
.vetri-btn > svg { transform-origin: 50% 100%; animation: peek .9s var(--spring) .5s both, breathe 4s ease-in-out 1.6s infinite; }
.bubble { animation: fade-in .4s var(--ease) 1.2s both; }
.bubble.say { animation: fade-in .3s var(--ease); }

/* Demostración: llega la pregunta, la clínica escribe y responde */
.chat-demo .msg-in { animation: rise-in .4s var(--ease) 1.2s both; }
.typing { animation: typing-show 1.4s linear 1.7s both; }
.typing span { animation: dot 1s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.chat-demo .msg-out { animation: rise-in .4s var(--ease) 3.1s both; }
.chat-demo .msg-time { animation: fade-in .4s var(--ease) 3.4s both; }

@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes peek { from { opacity: 0; transform: translateY(48px); } }
@keyframes breathe { 50% { transform: scale(1.02, .985); } }
@keyframes typing-show { 0% { opacity: 0; } 10%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dot { 50% { transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 1023px) {
  .grid-3, .steps { grid-template-columns: minmax(0, 1fr); }
  .about, .form-wrap, .calc { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .vetri-side { display: none; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .nav-links, .brand-by { display: none; }
  .nav .btn-sm { margin-left: auto; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .service, .form, .calc-result { padding: 24px; }
  .stage { padding-top: 200px; }
  .vetri-btn { top: 48px; width: 150px; height: 158px; margin-left: -75px; }
  .bubble { top: 0; right: auto; left: 50%; transform: translateX(-50%); width: max-content; max-width: 264px; font-size: 14px; border-radius: 24px; }
  .chat-fab span { display: none; }
  .chat-fab { padding: 4px; }
}
