/* ==========================================================
   Plantilla "Libreta sanitaria"
   Para otra veterinaria: cambiá los colores de :root y los
   datos en lib/manifest.js.
   ========================================================== */
:root {
  --paper: #f6f7f2;       /* hoja */
  --sheet: #ffffff;       /* página de la libreta */
  --grid: #dde5ee;        /* cuadriculado */
  --ink: #1b2130;         /* texto impreso */
  --ink-2: #4a5263;
  --biro: #2446a6;        /* birome azul */
  --cover: #1f3f93;       /* tapa de la libreta */
  --violet: #6b3fb4;      /* tinta de sello */
  --red: #cf3a2c;         /* margen de cuaderno */
  --kraft: #d9bc8f;       /* etiquetas */
  --marker: #fbe462;      /* resaltador */
  --print: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--print); font-size: 19px; line-height: 1.45;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--biro); }
h1, h2 { font-weight: 700; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.hand { font-family: var(--hand); color: var(--biro); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

/* ---------- Franja demo ---------- */
.demo-strip {
  background: var(--marker); font-size: 15px; padding: 8px 20px; text-align: center;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.demo-strip a { color: var(--ink); font-weight: 600; }

/* ---------- Tapa + pestañas ---------- */
.cover {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  background: var(--cover); color: #fff;
  padding: 14px clamp(16px, 4vw, 48px) 0;
}
.cover-name {
  display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 22px; letter-spacing: .01em; padding-bottom: 14px;
}
.cross {
  width: 30px; height: 30px; border: 2.5px solid #fff; border-radius: 50%; position: relative; flex-shrink: 0;
}
.cross::before, .cross::after { content: ""; position: absolute; background: #fff; border-radius: 2px; }
.cross::before { width: 14px; height: 3.5px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cross::after { width: 3.5px; height: 14px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tabs { display: flex; gap: 6px; }
.tabs a {
  text-decoration: none; color: var(--ink); background: #e4e9f3; font-weight: 600; font-size: 16px;
  padding: 10px 18px 12px; border-radius: 10px 10px 0 0; transition: background .15s, padding .15s;
}
.tabs a:hover { background: var(--sheet); padding-bottom: 16px; }
.tabs .tab-turno { background: var(--marker); }
.tabs .tab-turno:hover { background: #fff08f; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(40px, 6vw, 84px) clamp(16px, 4vw, 48px) clamp(70px, 8vw, 110px);
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(36px, 6vw, 88px); align-items: center;
}
.hero h1 { font-size: clamp(46px, 6.2vw, 84px); line-height: .98; font-weight: 800; max-width: 11ch; }
.hero-lead { font-size: clamp(19px, 1.7vw, 23px); color: var(--ink-2); max-width: 36ch; margin: 22px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.now { margin-top: 22px; font-size: 17px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.now::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); flex-shrink: 0; }
.now.open::before { background: #1f9d5b; box-shadow: 0 0 0 4px rgba(31, 157, 91, .2); }
.now.closed::before { background: var(--red); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--print);
  font-weight: 700; font-size: 18px; text-decoration: none; cursor: pointer;
  padding: 13px 24px; border-radius: 6px; gap: .3em; border: 2px solid var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn-ink { background: var(--biro); border-color: var(--biro); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.btn-ink:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-ink:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-line { background: var(--sheet); color: var(--ink); }
.btn-line:hover { background: var(--marker); }
.btn-small { font-size: 16px; padding: 9px 16px; }

/* Libreta */
.booklet {
  position: relative; background: var(--sheet); padding: 26px 26px 34px 58px;
  border: 1.5px solid #cdd5e1; border-radius: 4px; transform: rotate(1.6deg);
  box-shadow: 10px 12px 0 -2px rgba(31, 63, 147, .14);
}
.booklet::before { /* margen rojo */
  content: ""; position: absolute; top: 0; bottom: 0; left: 40px; width: 2px; background: var(--red); opacity: .55;
}
.booklet::after { /* agujeros del anillado */
  content: ""; position: absolute; left: 12px; top: 30px; bottom: 30px; width: 12px;
  background: radial-gradient(circle, var(--paper) 5px, transparent 5.5px) 0 0 / 12px 44px repeat-y;
}
.booklet-head {
  display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 15px;
  color: var(--cover); border-bottom: 2px solid var(--cover); padding-bottom: 8px;
}
.ledger { width: 100%; border-collapse: collapse; margin-top: 4px; }
.ledger th { text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 10px 8px 6px 0; }
.ledger td {
  padding: 9px 8px 5px 0; border-bottom: 1px solid #c7d3e3; font-size: 19px; line-height: 1.2; vertical-align: bottom;
  filter: url(#ink);
}
.ledger-next td { color: #8a94a8; }
.ledger-next a { color: var(--violet); text-decoration: underline wavy; text-underline-offset: 4px; }

/* Sellos */
.stamp { color: var(--violet); font-family: var(--print); pointer-events: none; mix-blend-mode: multiply; }
.stamp svg, .stamp span { filter: url(#stampTex); }
.stamp-round { position: absolute; width: 190px; right: -30px; bottom: -64px; transform: rotate(-14deg); opacity: .9; }
.stamp-round text { fill: currentColor; font-family: var(--print); }
.js .stamp-round { opacity: 0; transform: rotate(-24deg) scale(1.7); }
.js .stamp-round.hit { animation: thunk .42s cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes thunk {
  0% { opacity: 0; transform: rotate(-24deg) scale(1.7); }
  70% { opacity: .95; transform: rotate(-13deg) scale(.96); }
  100% { opacity: .9; transform: rotate(-14deg) scale(1); }
}

.margin-note {
  position: absolute; left: 24px; bottom: -58px; font-size: 20px; text-decoration: none;
  transform: rotate(-3deg); padding: 10px 18px; white-space: nowrap;
}
.pen-circle { position: absolute; inset: -4px -10px; width: calc(100% + 20px); height: calc(100% + 8px); overflow: visible; }
.pen-circle path { fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; }

/* ---------- Plan sanitario ---------- */
.plan, .exotic, .where, .reviews, .turno {
  max-width: 1240px; margin: 0 auto; padding: clamp(48px, 6.5vw, 84px) clamp(16px, 4vw, 48px);
}
.plan h2, .exotic h2, .hours h2, .slip-head h2 { font-size: clamp(36px, 4.4vw, 54px); line-height: 1; }
.section-lead { color: var(--ink-2); margin: 14px 0 36px; max-width: 52ch; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
.checklist li {
  display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding: 18px 0;
  border-top: 1.5px solid var(--ink);
}
.checklist b { display: block; font-size: 23px; line-height: 1.15; }
.checklist span:not(.box) { color: var(--ink-2); }
.box {
  width: 30px; height: 30px; border: 2px solid var(--ink); margin-top: 2px; position: relative; background: var(--sheet);
}
.box::after {
  content: ""; position: absolute; left: -3px; top: -9px; width: 40px; height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'%3E%3Cpath d='M5 20 C 9 22, 13 28, 15 31 C 20 20, 27 9, 37 3' fill='none' stroke='%232446a6' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.demo-note { margin-top: 22px; font-size: 18px; color: var(--violet); }

/* ---------- Exóticos ---------- */
.exotic { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.exotic-copy p { color: var(--ink-2); margin-top: 16px; max-width: 40ch; font-size: 20px; }
.labels { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px 14px; }
.labels li {
  position: relative; background: var(--kraft); padding: 14px 22px 14px 40px; font-family: var(--hand);
  font-size: 24px; color: #3b2b17; transform: rotate(var(--r, 0deg));
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
  transition: transform .2s;
}
.labels li::before { /* ojalillo */
  content: ""; position: absolute; left: 16px; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px #b39565; transform: translateY(-50%);
}
.labels li:hover { transform: rotate(0deg) translateY(-3px); }

/* ---------- Ficha de turno ---------- */
.turno { display: grid; grid-template-columns: minmax(0, 720px); justify-content: center; gap: 28px; }
.slip {
  position: relative; background: var(--sheet); border: 2px solid var(--ink); padding: clamp(24px, 4vw, 44px);
  box-shadow: 10px 10px 0 var(--biro);
}
.slip-head { border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 8px; }
.slip-head p { color: var(--ink-2); margin-top: 10px; }
.row {
  display: grid; grid-template-columns: 200px 1fr; align-items: end; gap: 12px;
  border: 0; margin: 0; padding: 14px 0 0; min-width: 0;
}
.row label, .row .lbl { font-weight: 600; font-size: 17px; padding-bottom: 8px; color: var(--ink-2); }
.row input, .row select, .row textarea {
  width: 100%; font-family: var(--hand); font-size: 23px; color: var(--biro); background: transparent;
  border: 0; border-bottom: 1.5px dashed #8e99ae; padding: 2px 4px 4px; border-radius: 0; appearance: none;
}
.row select {
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232446a6' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 6px center / 12px;
}
.row textarea { resize: vertical; min-height: 64px; }
.row input:focus, .row select:focus, .row textarea:focus { outline: none; border-bottom: 2px solid var(--biro); background: #f3f6fd; }
.row .invalid { border-bottom: 2px solid var(--red); }
.row-tall { align-items: start; }
.row-tall label { padding-top: 6px; }
.ticks { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-bottom: 6px; border-bottom: 1.5px dashed transparent; }
.tick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--hand); font-size: 23px; color: var(--ink); }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick span::before {
  content: ""; display: inline-block; width: 22px; height: 22px; border: 2px solid var(--ink); vertical-align: -3px; margin-right: 8px;
  background: var(--sheet) no-repeat center / 26px;
}
.tick input:checked + span { color: var(--biro); }
.tick input:checked + span::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'%3E%3Cpath d='M5 20 C 9 22, 13 28, 15 31 C 20 20, 27 9, 37 3' fill='none' stroke='%232446a6' stroke-width='3.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.tick input:focus-visible + span::before { outline: 3px solid var(--violet); outline-offset: 2px; }
.hint { margin: 6px 0 0 212px; font-size: 18px; min-height: 1.4em; }
.hint.warn { color: var(--red); }
.form-error { color: var(--red); font-weight: 600; min-height: 1.4em; margin-top: 10px; }
.btn-send { margin-top: 18px; width: 100%; font-size: 20px; padding: 16px; }

.stamp-rect {
  position: absolute; right: clamp(16px, 6vw, 60px); bottom: 90px; opacity: 0;
  border: 5px double currentColor; padding: 10px 22px; border-radius: 6px;
  font-weight: 800; font-size: clamp(28px, 4vw, 40px); text-transform: uppercase; letter-spacing: .04em;
  transform: rotate(-9deg) scale(1.8);
}
.stamp-rect.hit { animation: thunk2 .4s cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes thunk2 {
  0% { opacity: 0; transform: rotate(-16deg) scale(1.8); }
  70% { opacity: .95; transform: rotate(-8deg) scale(.95); }
  100% { opacity: .9; transform: rotate(-9deg) scale(1); }
}
.slip.done .row input, .slip.done .row select, .slip.done .row textarea { pointer-events: none; }
.slip.done .btn-send { visibility: hidden; }

.result { background: #e7f7de; border: 2px solid var(--ink); padding: 24px; }
.result[hidden] { display: none; }
.result-title { font-weight: 700; }
.wa {
  background: #d9fdd3; border-radius: 12px 12px 12px 2px; padding: 14px 16px; margin: 14px 0;
  white-space: pre-wrap; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; color: #111;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .15);
}
.result-note { color: var(--ink-2); font-size: 16px; margin-bottom: 16px; }

/* ---------- Horario + mapa ---------- */
.where { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.hours-table { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 21px; }
.hours-table th, .hours-table td { padding: 11px 6px; border-bottom: 1.5px solid var(--ink); font-weight: 500; text-align: left; }
.hours-table td { text-align: right; }
.hours-table tr.today th, .hours-table tr.today td { font-weight: 700; background: var(--marker) no-repeat; }
.hours-table tr.today th { background: linear-gradient(100deg, transparent 2%, var(--marker) 5%) no-repeat 0 55% / 100% 72%; }
.hours-table tr.today td { background: linear-gradient(100deg, var(--marker) 94%, transparent 98%) no-repeat 0 55% / 100% 72%; }
.map { background: var(--sheet); border: 2px solid var(--ink); }
.map iframe { display: block; width: 100%; height: 360px; border: 0; border-bottom: 2px solid var(--ink); background: #e9edf3; }
.map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.map-foot p { font-weight: 600; }

/* ---------- Reseñas ---------- */
.reviews { text-align: center; }
.reviews-big { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.2; max-width: 22ch; margin: 0 auto 26px; }

/* ---------- Contratapa ---------- */
.back-cover {
  background: var(--cover); color: #dfe6f7; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end;
  gap: 20px; padding: 40px clamp(16px, 4vw, 48px) calc(40px + env(safe-area-inset-bottom, 0px));
}
.back-cover a { color: #fff; }
.back-name { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.credit { font-size: 15px; }

/* Botón flotante (solo celular) */
.float-call { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero, .exotic, .where { grid-template-columns: 1fr; }
  .booklet { max-width: 560px; margin-bottom: 40px; }
}
@media (max-width: 760px) {
  body { font-size: 18px; }
  .tabs a:not(.tab-turno) { display: none; }
  .cover-name { font-size: 18px; }
  .checklist { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .hint { margin-left: 0; }
  .booklet { padding: 22px 16px 30px 46px; transform: rotate(1deg); }
  .booklet::before { left: 32px; }
  .booklet::after { left: 8px; }
  .ledger td { font-size: 17px; }
  .ledger th:first-child, .ledger td:first-child { display: none; }
  .stamp-round { width: 128px; right: -8px; bottom: -40px; }
  .margin-note { left: 10px; font-size: 18px; }
  .float-call {
    display: block; position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 50;
    text-align: center; background: var(--biro); color: #fff; font-weight: 700; font-size: 18px; text-decoration: none;
    padding: 14px; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--ink);
    transition: transform .2s, opacity .2s;
  }
  .float-call.away { opacity: 0; transform: translateY(120%); pointer-events: none; }
  .back-cover { padding-bottom: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .stamp-round, .js .stamp-round.hit { animation: none; opacity: .9; transform: rotate(-14deg); }
  .stamp-rect.hit { animation: none; opacity: .9; transform: rotate(-9deg); }
  html { scroll-behavior: auto; }
}
