/* ==========================================================================
   nipipo · sistema de diseño (único CSS de la plataforma)
   Rojo #E63946 + blanco · texto #1D1D1F · base 20px · móvil primero
   Clases del contrato: .container .btn .btn-primary .btn-ghost .btn-big
   .btn-block .card .card-pop .grid-2 .grid-3 .field .choices .choice
   .progress .stars .badge .muted .center .hidden .reveal .bounce-in .shake
   .topbar .footer .tabs .empty .spinner
   Extras útiles: .btn-white .lead .small .sr-only .ico .ico-circle .stack
   .row .section .section-soft .section-title .kicker .ticks .speech .mascot
   .notice .check .badge-ok/-warn/-info/-muted .legal (+ componentes del inicio)
   ========================================================================== */

:root {
  /* Marca */
  --red: #E63946;
  --red-600: #D62839;
  --red-700: #B91C2C;      /* rojo para texto sobre blanco (AA) */
  --red-100: #FFE1E3;
  --red-50: #FFF1F2;
  --ink: #1D1D1F;
  --ink-2: #3A3A40;
  --muted: #55555E;        /* 7:1 sobre blanco */
  --white: #FFFFFF;
  --blush: #FFF5F3;
  --cream: #FFF8F0;
  --peach: #FFD6A5;
  --sun: #FFB703;
  --sun-50: #FFF6D6;
  --line: #ECE5E1;
  --line-strong: #8E8883;  /* bordes de campos: 3:1 sobre blanco */

  /* Estados */
  --ok: #1A7F45;
  --ok-50: #E5F6EC;
  --warn: #8A5300;
  --warn-50: #FFF2CC;
  --info: #1E5AA8;
  --info-50: #E8F1FD;

  /* Forma */
  --radius-sm: 14px;
  --radius: 24px;
  --radius-lg: 34px;
  --pill: 999px;

  /* Sombras suaves */
  --shadow-sm: 0 1px 2px rgba(29, 29, 31, .05), 0 2px 8px rgba(29, 29, 31, .06);
  --shadow: 0 2px 6px rgba(29, 29, 31, .05), 0 12px 32px -12px rgba(29, 29, 31, .20);
  --shadow-lg: 0 4px 10px rgba(29, 29, 31, .06), 0 28px 56px -18px rgba(29, 29, 31, .30);
  --shadow-red: 0 10px 24px -8px rgba(230, 57, 70, .60), 0 2px 4px rgba(185, 28, 44, .20);

  /* Movimiento */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);

  /* Tipografía y medidas */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --maxw: 1120px;
  --gutter: 16px;
  --focus: #1D1D1F;

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 125%;                 /* 20px si el navegador está en 16px; respeta el tamaño elegido por la persona */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  overflow-x: clip;                /* nunca scroll horizontal */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }

img, svg, video, canvas { max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 7vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
h3 { font-size: 1.3rem; letter-spacing: -.01em; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--red-700); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red-600); }

strong, b { font-weight: 750; }
small, .small { font-size: .85rem; }
hr { border: 0; height: 2px; background: var(--line); margin: 28px 0; }

::selection { background: var(--red-100); color: var(--ink); }

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

/* ---------- Utilidades ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 900px) { :root { --gutter: 28px; } }

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.lead { font-size: 1.15rem; line-height: 1.5; }
.text-red { color: var(--red-700); }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-center { justify-content: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 10002;
  padding: 14px 22px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: var(--pill);
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Iconos SVG (sprite /assets/img/icons.svg) */
.ico {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.22em;
}
.ico-fill { fill: currentColor; stroke: none; }
.ico-circle {
  flex: none;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--red-50);
  color: var(--red);
}
.ico-circle .ico { width: 28px; height: 28px; }
.ico-circle.sun { background: var(--sun-50); color: #C07A00; }
.ico-circle.ok { background: var(--ok-50); color: var(--ok); }
.ico-circle.info { background: var(--info-50); color: var(--info); }

/* Lista con "checks" */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 38px; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: .12em;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--red-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%23E63946' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* ---------- Botones ---------- */
.btn {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 56px;
  padding: .5em 1.35em;
  border: 2px solid transparent;
  border-radius: var(--pill);
  font: inherit;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .25s, translate .25s var(--ease-bounce), filter .2s;
}
.btn:hover { color: var(--ink); }
@media (hover: hover) {
  .btn:hover { translate: 0 -2px; box-shadow: var(--shadow); }
}
.btn:active { translate: 0 1px; filter: brightness(.96); box-shadow: var(--shadow-sm); }
.btn .ico { width: 1.2em; height: 1.2em; }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #EA4753 0%, var(--red) 55%, var(--red-600) 100%);
  box-shadow: var(--shadow-red);
  text-shadow: 0 1px 1px rgba(120, 10, 20, .25);
  overflow: hidden;
  isolation: isolate;
}
.btn-primary:hover { color: #fff; }
@media (hover: hover) {
  .btn-primary:hover { box-shadow: 0 16px 30px -10px rgba(230, 57, 70, .7), 0 2px 4px rgba(185, 28, 44, .2); }
}
/* brillo sutil que cruza el botón cada pocos segundos */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .42) 46%, rgba(255, 255, 255, .1) 54%, transparent 64%);
  transform: translateX(-130%);
  animation: nip-shine 5s ease-in-out 1.5s infinite;
  pointer-events: none;
}

.btn-ghost {
  color: var(--red-700);
  background: var(--white);
  border-color: var(--red);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--red-700); background: var(--red-50); }

.btn-white {
  color: var(--red-700);
  background: #fff;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .35);
}
.btn-white:hover { color: var(--red-700); }

.btn-big {
  min-height: 72px;
  padding: .6em 1.8em;
  font-size: 1.2rem;
}
.btn-block { display: flex; width: 100%; }
@media (max-width: 599px) { .btn-big { padding-inline: 1.1em; } }

.btn:disabled, .btn[aria-disabled="true"], .btn.is-loading {
  opacity: .6;
  cursor: not-allowed;
  translate: none;
  filter: grayscale(.2);
}
.btn:disabled::after, .btn.is-loading::after { animation: none; }
.btn .spinner { width: 1.15em; height: 1.15em; border-width: 3px; }
.btn-primary .spinner { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }

/* Enlace con aspecto de texto pero zona táctil grande */
.link-big { display: inline-flex; align-items: center; gap: .4em; min-height: 48px; font-weight: 700; }

/* ---------- Tarjetas ---------- */
.card {
  position: relative;
  background: var(--white);
  border: 1px solid rgba(29, 29, 31, .06);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
@media (min-width: 700px) { .card { padding: 32px; } }
.card > :last-child { margin-bottom: 0; }

.card-pop {
  transition: translate .4s var(--ease-bounce), box-shadow .35s ease, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .card-pop:hover { translate: 0 -8px; box-shadow: var(--shadow-lg); }
}
.card-pop:active { translate: 0 -3px; box-shadow: var(--shadow-lg); }
.card-pop:focus-within { box-shadow: var(--shadow-lg); }
a.card-pop, button.card-pop { color: inherit; text-decoration: none; display: block; }

/* ---------- Rejillas ---------- */
.grid-2, .grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
@media (min-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (min-width: 980px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Formularios ---------- */
.field { display: grid; gap: 8px; margin: 0 0 22px; min-width: 0; }
.field > label, .field > .label, .field > legend, fieldset.field > legend {
  font-weight: 750;
  font-size: 1rem;
  padding: 0;
}
fieldset.field { border: 0; padding: 0; margin-inline: 0; }

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  font: inherit;
  font-size: 1rem;              /* 20px: evita el zoom automático del móvil */
  line-height: 1.4;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: inset 0 1px 2px rgba(29, 29, 31, .05);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea, textarea.input { min-height: 170px; resize: vertical; line-height: 1.5; }
.field select, select.input {
  padding-right: 54px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%231D1D1F' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 24px;
}
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: #75757D; opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 5px rgba(230, 57, 70, .2);
}
.field .hint { color: var(--muted); font-size: .85rem; margin: 0; }
.field .error-msg { color: var(--red-700); font-weight: 700; font-size: .9rem; margin: 0; }
.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: var(--red-700);
  background: #FFF7F7;
}

/* Casilla suelta grande: <label class="check"><input type="checkbox"> Acepto…</label> */
.check { display: flex; align-items: flex-start; gap: 14px; min-height: 48px; cursor: pointer; font-weight: 600; }
.check input { margin-top: 2px; }

/* Casillas y radios propios (en .choice y .check) */
.choice input[type="radio"], .choice input[type="checkbox"],
.check input[type="checkbox"], .check input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 30px; height: 30px;
  margin: 0;
  border: 3px solid var(--line-strong);
  border-radius: 50%;
  background: #fff center / 72% no-repeat;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .25s var(--ease-bounce);
}
.choice input[type="checkbox"], .check input[type="checkbox"] { border-radius: 9px; }
.choice input:checked, .check input:checked {
  background-color: var(--red);
  border-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform: scale(1.08);
}
.choice input:focus-visible, .check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Opciones grandes tipo tarjeta */
.choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}
@media (min-width: 600px) {
  .choices { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px 20px;
  background: var(--white);
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, background-color .2s, box-shadow .25s, translate .3s var(--ease-bounce);
}
@media (hover: hover) {
  .choice:hover { border-color: #F3A9AF; translate: 0 -3px; box-shadow: var(--shadow); }
}
.choice:has(input:checked), .choice.is-checked {
  border-color: var(--red);
  background: var(--red-50);
  box-shadow: 0 0 0 4px rgba(230, 57, 70, .14), var(--shadow);
}
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice small, .choice .muted { display: block; font-weight: 500; color: var(--muted); }
.choice .ico-circle { width: 52px; height: 52px; }

/* ---------- Progreso y logros ---------- */
.progress {
  position: relative;
  height: 20px;
  margin: 16px 0;
  background: #F4E7E5;
  border-radius: var(--pill);
  box-shadow: inset 0 2px 4px rgba(29, 29, 31, .08);
}
.progress > i {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  min-width: 20px;
  max-width: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 10px, transparent 10px 20px),
    linear-gradient(90deg, #FF8A5B, var(--red));
  background-size: 28px 28px, 100% 100%;
  transition: width .9s var(--ease-bounce);
  animation: nip-stripes 1.2s linear infinite;
}
/* estrella al final de la barra */
.progress > i::after {
  content: "";
  position: absolute;
  right: -17px; top: 50%;
  width: 34px; height: 34px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.7 6.3.9-4.6 4.4 1.1 6.2L12 17l-5.6 3 1.1-6.2-4.6-4.4 6.3-.9z' fill='%23FFB703' stroke='white' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(150, 90, 0, .35));
  animation: nip-twinkle 2.4s ease-in-out infinite;
}

/* Contador de estrellas:
   <div class="stars"><i class="on"></i><i class="on"></i><i></i> <span>2 de 3</span></div>
   o simplemente texto: <span class="stars">⭐⭐☆</span> */
.stars {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  min-height: 44px;
  padding: .25em .85em;
  border-radius: var(--pill);
  background: var(--sun-50);
  color: #6E4700;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .04em;
  white-space: nowrap;
}
.stars > i {
  display: inline-block;
  width: 1.35em; height: 1.35em;
  background: #E5D9C5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.7 6.3.9-4.6 4.4 1.1 6.2L12 17l-5.6 3 1.1-6.2-4.6-4.4 6.3-.9z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.7 6.3.9-4.6 4.4 1.1 6.2L12 17l-5.6 3 1.1-6.2-4.6-4.4 6.3-.9z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.stars > i.on {
  background: var(--sun);
  animation: nip-star-pop .6s var(--ease-bounce) backwards;
}

/* ---------- Insignias ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .3em .85em;
  border-radius: var(--pill);
  background: var(--red-50);
  color: var(--red-700);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .01em;
  vertical-align: middle;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.badge-red { background: var(--red); color: #fff; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: #EFEDEB; color: #4A4A52; }
.badge-sun { background: var(--sun-50); color: #6E4700; }

/* Aviso / caja de información */
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--info-50);
  color: #183F72;
  font-weight: 600;
}
.notice-ok { background: var(--ok-50); color: #0F5A31; }
.notice-warn { background: var(--warn-50); color: #5E3A00; }
.notice-red { background: var(--red-50); color: #8E1422; }

/* ---------- Pestañas ---------- */
.tabs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  width: max-content;
  padding: 6px;
  margin: 0 0 24px;
  background: #F6ECEA;
  border-radius: var(--pill);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.center, .center > .tabs { margin-inline: auto; }
.tabs > a, .tabs > button {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 56px;
  padding: 0 1.2em;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-weight: 750;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s, color .2s, box-shadow .25s;
}
.tabs > a:hover, .tabs > button:hover { color: var(--red-700); }
.tabs > .active, .tabs > [aria-selected="true"], .tabs > [aria-pressed="true"], .tabs > [aria-current] {
  background: #fff;
  color: var(--red-700);
  box-shadow: var(--shadow-sm);
}
.tabs > :focus-visible { outline-offset: -3px; }

/* ---------- Estado vacío (con mascota) ---------- */
.empty {
  text-align: center;
  padding: 36px 22px;
  border: 3px dashed #F0D5D2;
  border-radius: var(--radius-lg);
  background: var(--blush);
  color: var(--ink-2);
  list-style: none;
}
.empty > img, .empty > svg {
  display: block;
  margin: 0 auto 14px;
  animation: nip-float 3.6s ease-in-out infinite;
}
.empty:not(:has(> img, > svg))::before {
  content: "";
  display: block;
  width: 110px; height: 110px;
  margin: 0 auto 14px;
  background: url("/assets/img/pipo.svg") center/contain no-repeat;
  animation: nip-float 3.6s ease-in-out infinite;
}
.empty p { margin: 0 auto 16px; max-width: 30em; font-weight: 600; }
.empty > :last-child { margin-bottom: 0; }

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 46px; height: 46px;
  border: 5px solid var(--red-100);
  border-top-color: var(--red);
  border-radius: 50%;
  vertical-align: middle;
  animation: nip-spin .8s linear infinite;
}

/* ---------- Cabecera común ---------- */
.topbar {
  position: relative;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
}
.topbar .container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.topbar .brand {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 4px;
  border-radius: 12px;
  transition: transform .4s var(--ease-bounce);
}
.topbar .brand:hover { transform: rotate(-3deg) scale(1.04); }
.topbar .brand img { height: 36px; width: auto; display: block; }
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
}
.topbar nav > a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 14px;
  border-radius: var(--pill);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.topbar nav > a:not(.btn):hover { background: var(--red-50); color: var(--red-700); }
.topbar nav > a[aria-current="page"]:not(.btn) {
  color: var(--red-700);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}
.topbar nav .btn { padding-inline: 1.1em; }

/* Móvil: una sola fila = logo + botón principal + "Menú" (los enlaces se despliegan al pulsar).
   Sin JS (o si la cabecera tiene pocos enlaces) los enlaces se ven en una segunda fila. */
.topbar-actions, .topbar-cta, .topbar-menu { display: none; }
@media (max-width: 859px) {
  .topbar { position: sticky; top: 0; }
  .topbar .container { padding-top: 8px; padding-bottom: 8px; }
  .topbar .brand { min-height: 48px; }
  .topbar .brand img { height: 32px; }
  .topbar nav { flex-basis: 100%; justify-content: center; }
  .topbar nav > a:not(.btn) { padding: 0 12px; font-size: .95rem; }
  .topbar nav .btn { font-size: .95rem; padding-inline: 1em; }

  .topbar.has-menu .container { flex-wrap: nowrap; gap: 8px; }
  .topbar.has-menu .brand { flex-shrink: 0; }
  .topbar.has-menu .topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .topbar.has-menu .topbar-cta { display: inline-flex; min-height: 48px; font-size: .85rem; padding-inline: .75em; white-space: nowrap; }
  .topbar.has-menu .topbar-menu {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 48px; padding: 0 10px;
    border: 2px solid var(--line); border-radius: var(--pill);
    background: #fff; color: var(--ink);
    font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer;
  }
  .topbar.has-menu .topbar-menu:focus-visible { outline: 3px solid var(--red-700); outline-offset: 2px; }
  .topbar-menu-ico { display: inline-flex; flex-direction: column; gap: 3px; }
  .topbar-menu-ico i { display: block; width: 18px; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
  .topbar.is-open .topbar-menu-ico i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .topbar.is-open .topbar-menu-ico i:nth-child(2) { opacity: 0; }
  .topbar.is-open .topbar-menu-ico i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

  .topbar.has-menu nav { display: none; }
  .topbar.has-menu.is-open nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    position: absolute; top: 100%; left: 0; right: 0;
    padding: 10px var(--gutter) 18px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -18px rgba(29, 29, 31, .35);
    animation: nip-menu-in .2s ease-out;
  }
  .topbar.has-menu.is-open nav > a,
  .topbar.has-menu.is-open nav > button,
  .topbar.has-menu.is-open nav > .badge { justify-content: center; width: 100%; min-height: 56px; font-size: 1.15rem; padding: 0 16px; }
  .topbar.has-menu.is-open nav > a:not(.btn) { background: var(--red-50); }
  .topbar.has-menu.is-open nav .btn-primary { display: none; } /* ya está arriba */
}
@media (max-width: 439px) {
  .topbar .brand img { height: 24px; }
}
@media (max-width: 369px) {
  /* Muy estrecho: "Crear mi web" pasa al menú desplegable (en la portada está justo debajo, grande) */
  .topbar.has-menu .topbar-cta { display: none; }
  .topbar.has-menu.is-open nav .btn-primary { display: inline-flex; }
}
/* "Crear mi web" de la cabecera: oculto mientras se ve el grande de la página ([data-cta-main]) */
.topbar .topbar-cta, .topbar nav .btn-primary { transition: opacity .25s ease, transform .3s var(--ease-bounce), visibility .25s; }
.topbar.cta-off .topbar-cta { opacity: 0; visibility: hidden; transform: scale(.85); pointer-events: none; }
@media (min-width: 860px) { .topbar.cta-off nav .btn-primary { display: none; } }
@keyframes nip-menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .topbar.has-menu.is-open nav { animation: none; } .topbar-menu-ico i, .topbar .topbar-cta, .topbar nav .btn-primary { transition: none; } }
@media (min-width: 860px) {
  .topbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
  }
  .topbar nav { gap: 6px; flex-wrap: nowrap; }
}

/* ---------- Pie común ---------- */
.footer {
  margin-top: 40px;
  padding: 44px 0 32px;
  background: var(--blush);
  border-top: 1px solid #F3DEDA;
  color: var(--ink-2);
}
.footer a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer a:hover { color: var(--red-700); text-decoration: underline; }
.footer p { margin: 0 0 .6em; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand img { height: 34px; width: auto; display: block; margin-bottom: 10px; }
.footer h2 { font-size: 1rem; margin: 0 0 8px; letter-spacing: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #F0D9D5;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Secciones ---------- */
.section { padding: 56px 0; }
@media (min-width: 900px) { .section { padding: 88px 0; } }
.section-soft { background: var(--blush); }
.section-cream { background: var(--cream); }
.section-title { font-size: clamp(1.75rem, 5.5vw, 2.6rem); text-align: center; margin-bottom: .3em; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 32em; font-size: 1.05rem; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-bottom: 12px;
  padding: .35em .9em;
  border-radius: var(--pill);
  background: var(--red-50);
  color: var(--red-700);
  font-weight: 800;
  font-size: .85rem;
}

/* ---------- Mascota y bocadillo ---------- */
.mascot { display: block; animation: nip-float 3.6s ease-in-out infinite; }
.speech {
  position: relative;
  display: inline-block;
  padding: 12px 20px;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--shadow);
}
.speech::after {
  content: "";
  position: absolute;
  bottom: -11px; left: 34px;
  border: 12px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

/* Mascota dentro de un círculo blanco (para fondos de color) */
.ring {
  display: grid;
  place-items: center;
  width: 116px; height: 116px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .35);
}
.ring img { width: 80px; height: 80px; }

/* Rebote corto reutilizable (añadir/quitar la clase para repetirlo) */
.is-bump { animation: nip-bump .45s var(--ease-bounce); }

/* ==========================================================================
   Componentes del inicio (también reutilizables en otras páginas)
   ========================================================================== */

/* Hero con gradientes cálidos */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 36px 0 56px;
  background:
    radial-gradient(900px 520px at 100% 0%, rgba(255, 214, 165, .85) 0%, transparent 62%),
    radial-gradient(760px 480px at 0% 100%, rgba(255, 175, 185, .55) 0%, transparent 60%),
    linear-gradient(165deg, #FFF8F0 0%, #FFEFEA 55%, #FFE4E1 100%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px;
  top: -180px; left: -160px;
  background: radial-gradient(circle, rgba(255, 183, 3, .28), transparent 65%);
  animation: nip-drift 16s ease-in-out infinite alternate;
}
.hero::after {
  width: 600px; height: 600px;
  bottom: -260px; right: -200px;
  background: radial-gradient(circle, rgba(230, 57, 70, .22), transparent 65%);
  animation: nip-drift 19s ease-in-out -6s infinite alternate-reverse;
}
.hero-grid { display: grid; gap: 12px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 96px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 40px; }
}
.hero h1 {
  font-size: clamp(2.7rem, 10vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin-bottom: .3em;
}
.hero h1 .text-red { color: var(--red); }
.hero .lead { font-size: clamp(1.1rem, 3.6vw, 1.35rem); color: var(--ink-2); margin-bottom: 1.3em; max-width: 26em; }
.hero-note { margin-top: 14px; color: var(--muted); font-size: .9rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero-note span { display: inline-flex; align-items: center; gap: .35em; }
.hero-note .ico { color: var(--ok); }
@media (max-width: 599px) { .hero .btn-big { width: 100%; } }

/* Pipo en el hero */
.pipo-stage { position: relative; display: grid; place-items: center; min-height: 240px; }
@media (min-width: 900px) { .pipo-stage { min-height: 420px; } }
.pipo-btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.pipo-svg { display: block; width: min(250px, 62vw); height: auto; overflow: visible; animation: nip-float 3.6s ease-in-out infinite; }
@media (min-width: 900px) { .pipo-svg { width: 340px; } }
.pipo-svg .pipo-eye { transform-box: fill-box; transform-origin: center; animation: nip-blink 5.5s ease-in-out infinite; }
.pipo-svg .pipo-wing { transform-box: fill-box; transform-origin: 12% 18%; animation: nip-wave 3.2s ease-in-out 1s infinite; }
.pipo-svg .pipo-tuft { transform-box: fill-box; transform-origin: 30% 100%; animation: nip-sway 2.6s ease-in-out infinite; }
.pipo-btn.is-happy .pipo-svg { animation: nip-jump .8s var(--ease-bounce); }
.pipo-stage { padding-top: 58px; }
.pipo-stage .speech { position: absolute; top: 0; left: 6%; z-index: 1; animation: nip-bounce-in .7s var(--ease-bounce) .6s backwards; }
.pipo-stage .speech.is-pop { animation: nip-bump .5s var(--ease-bounce); }
@media (min-width: 900px) {
  .pipo-stage { padding-top: 0; }
  .pipo-stage .speech { top: 8%; left: -4%; }
}
.deco { position: absolute; pointer-events: none; animation: nip-float 4.5s ease-in-out infinite; }
.deco svg { display: block; }

/* Buscador de nombre */
.namer { max-width: 760px; margin-inline: auto; text-align: center; }
.namer .field { text-align: left; }
.namer > .ico-circle { width: 64px; height: 64px; margin-bottom: 10px; }
.namer input { font-size: 1.15rem !important; min-height: 68px !important; text-align: center; }
.domain-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 92px;
  margin: 4px 0 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #FFF8F0, var(--red-50));
  border: 3px dashed #F2B8BD;
  font-size: clamp(1.2rem, 5.4vw, 1.9rem);
  font-weight: 850;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  transition: border-color .3s, background-color .3s;
}
.domain-card .ico { color: var(--ok); width: 1.1em; height: 1.1em; }
.domain-card .dom-name { color: var(--red-700); }
.domain-card.is-empty .dom-name { color: #A39E9A; }
.domain-card.is-filled { border-style: solid; border-color: var(--red); background: #fff; box-shadow: var(--shadow); }
.domain-card.is-bump { animation: nip-bump .45s var(--ease-bounce); }
.domain-cheer { min-height: 1.6em; font-weight: 800; color: var(--ok); margin: -6px 0 14px; }

/* Pasos */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 34px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; } }
.step {
  position: relative;
  text-align: center;
  padding: 30px 22px 28px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.step h3 { font-size: 1.5rem; margin: 0 0 4px; }
.step p { margin: 0; color: var(--muted); }
.step-ico {
  position: relative;
  width: 104px; height: 104px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red-50);
  color: var(--red);
}
.step-ico .ico { width: 52px; height: 52px; stroke-width: 2; }
.step-num {
  position: absolute;
  top: -4px; right: -6px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 850;
  box-shadow: var(--shadow-red);
}
.step-last .step-ico { background: var(--sun-50); color: #C07A00; }
.step.is-visible .step-ico { animation: nip-bounce-in .8s var(--ease-bounce) calc(var(--d, 0s) + .2s) backwards; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -30px;
  width: 26px; height: 26px;
  translate: -50% 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v15M6 13l6 6 6-6' fill='none' stroke='%23E63946' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
@media (min-width: 900px) {
  .step:not(:last-child)::after {
    left: auto; right: -33px; top: 50%; bottom: auto;
    translate: 0 -50%;
    rotate: -90deg;
  }
}

/* Planes */
.plans { display: grid; gap: 30px; margin-top: 10px; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 24px; } }
.plan { text-align: center; display: flex; flex-direction: column; gap: 12px; padding: 30px 24px; }
.plan h3 { font-size: 1.6rem; margin: 0; }
.plan-webs {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .35em 1em;
  border-radius: var(--pill);
  background: var(--blush);
  font-weight: 750;
}
.plan-webs b { color: var(--red-700); font-size: 1.2em; }
.price { margin: 8px 0 0; line-height: 1; font-weight: 850; letter-spacing: -.035em; font-size: clamp(2.6rem, 11vw, 3.2rem); white-space: nowrap; }
@media (min-width: 900px) { .price { font-size: clamp(2.3rem, 3.6vw, 2.9rem); } }
.price .cur { font-size: .6em; margin-left: .08em; }
.price .per { font-size: 1rem; font-weight: 700; letter-spacing: 0; color: var(--muted); margin-left: .2em; }
.price-sub { min-height: 1.6em; margin: 0; font-weight: 700; color: var(--ok); font-size: .9rem; }
.plan .btn { margin-top: 6px; }
.plan-featured {
  border: 3px solid var(--red);
  padding-top: 46px;
  padding-bottom: 38px;
  box-shadow: var(--shadow-lg), 0 0 0 8px rgba(230, 57, 70, .08);
}
.ribbon {
  position: absolute;
  top: -20px; left: 50%;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .4em 1.1em;
  border-radius: var(--pill);
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  white-space: nowrap;
  box-shadow: var(--shadow-red);
}
.ribbon .ico { width: 1.1em; height: 1.1em; }
.plan-note { text-align: center; color: var(--muted); font-size: .9rem; font-weight: 600; margin: 26px auto 0; max-width: 40em; }

.includes { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .includes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .includes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.includes li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: var(--blush); font-weight: 700; line-height: 1.3; }
.includes li .ico-circle { background: #fff; }
.includes li small { display: block; font-weight: 500; color: var(--muted); }

.setup-card {
  display: grid;
  gap: 18px;
  align-items: center;
  text-align: center;
  margin-top: 30px;
  background: linear-gradient(135deg, #FFF8F0 0%, #FFE9E6 100%);
  border: 3px dashed #F2B0B6;
  box-shadow: none;
}
.setup-card h3 { margin: 0 0 4px; }
.setup-card p { margin: 0; }
.setup-card .setup-price { font-size: 2.2rem; font-weight: 850; letter-spacing: -.03em; color: var(--red-700); line-height: 1; }
@media (min-width: 800px) {
  .setup-card { grid-template-columns: auto 1fr auto; text-align: left; }
}

/* Ejemplos que se giran */
.flip {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  perspective: 1400px;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.flip-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform .85s var(--ease-bounce);
}
.flip[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
.flip-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 430px;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip-back {
  transform: rotateY(180deg);
  justify-content: center;
  padding: 30px 26px;
  background: linear-gradient(160deg, var(--red-600), var(--red-700));
  color: #fff;
}
.flip-back .flip-title { font-size: 1.5rem; font-weight: 850; display: block; line-height: 1.15; }
.flip-back .flip-meta { display: block; opacity: .92; font-weight: 600; margin: 4px 0 14px; }
.flip-back .flip-list { display: grid; gap: 10px; }
.flip-back .flip-list > span { position: relative; display: block; padding-left: 34px; font-weight: 650; }
.flip-back .flip-list > span::before {
  content: "";
  position: absolute; left: 0; top: .1em;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.flip-label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 2px 6px 4px; font-weight: 800; font-size: 1.1rem; }
.flip-hint { display: inline-flex; align-items: center; gap: .3em; font-size: .8rem; font-weight: 750; color: var(--red-700); }
.flip-back .flip-hint { color: #fff; margin-top: 18px; }
.flip:focus-visible { outline-offset: 6px; }
@media (hover: hover) {
  .flip:hover .flip-face { box-shadow: var(--shadow-lg); }
}
.flip.is-visible .flip-hint .ico, .is-visible > .flip .flip-hint .ico { animation: nip-turn 1.4s ease-in-out 1s 2; }

/* Mini webs de ejemplo (decorativas, hechas con CSS) */
.mini {
  --m-hero: #7B2CBF;
  --m-accent: #E63946;
  --m-soft: #F6EEFF;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, .1);
  background: #fff;
  font-size: 13px;
  line-height: 1.3;
  color: #1D1D1F;
}
.mini-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #F3EFEC; }
.mini-bar i { width: 9px; height: 9px; border-radius: 50%; background: #FF6159; }
.mini-bar i:nth-child(2) { background: #FFBD2E; }
.mini-bar i:nth-child(3) { background: #28C941; }
.mini-url { flex: 1; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: #fff; color: #6B6B73; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-hero { display: block; position: relative; padding: 20px 14px 18px; background: var(--m-hero); color: #fff; text-align: center; }
.mini-logo { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .22); margin-bottom: 6px; }
.mini-logo .ico { width: 22px; height: 22px; }
.mini-title { display: block; font-size: 19px; font-weight: 850; letter-spacing: -.01em; }
.mini-sub { display: block; font-size: 11px; opacity: .92; margin-top: 3px; }
.mini-btn { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 999px; background: #fff; color: var(--m-hero); font-weight: 800; font-size: 11px; }
.mini-body { display: block; flex: 1; padding: 12px 14px 14px; background: var(--m-soft); }
.mini-h { display: block; font-weight: 800; font-size: 12px; margin-bottom: 6px; color: var(--m-hero); }
.mini-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed rgba(29, 29, 31, .15); }
.mini-row b { color: var(--m-hero); }
.mini-info { display: flex; gap: 8px; margin-top: 10px; }
.mini-info > span { flex: 1; display: block; padding: 7px; border-radius: 8px; background: #fff; font-size: 10px; text-align: center; font-weight: 700; }
.mini-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mini-gallery > span { position: relative; display: block; height: 70px; border-radius: 10px; background: #fff; overflow: hidden; }
.mini-gallery > span::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 8px;
  width: 58%; height: 72%;
  translate: -50% 0;
  background: var(--c, #C8693C);
  border-radius: 38% 38% 46% 46% / 22% 22% 70% 70%;
  box-shadow: inset -6px -4px 0 rgba(0, 0, 0, .12);
}
.mini-gallery > span:nth-child(2)::after { --c: #3D8B8B; width: 46%; height: 60%; border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%; }
.mini-gallery > span:nth-child(3)::after { --c: #E4A04A; width: 70%; height: 40%; border-radius: 10% 10% 50% 50% / 10% 10% 90% 90%; }
.mini-scene { display: block; position: relative; height: 128px; overflow: hidden; background: linear-gradient(#A9DCF2, #E6F5FB); }
.mini-scene .sun { position: absolute; top: 14px; right: 22px; width: 26px; height: 26px; border-radius: 50%; background: #FFD166; box-shadow: 0 0 0 6px rgba(255, 209, 102, .35); }
.mini-scene .mtn { position: absolute; bottom: 0; display: block; clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.mini-scene .mtn-1 { left: -10%; width: 75%; height: 92%; background: linear-gradient(#5E9C76, #3F7D58); }
.mini-scene .mtn-2 { left: 38%; width: 80%; height: 78%; background: linear-gradient(#4B8A64, #2D6A4F); }
.mini-scene .snow { position: absolute; top: 0; left: 50%; width: 30%; height: 22%; translate: -50% 0; background: #fff; clip-path: polygon(50% 0, 100% 100%, 70% 80%, 50% 100%, 30% 80%, 0 100%); }
.mini-scene .house { position: absolute; bottom: 10px; left: 22%; width: 40px; height: 30px; background: #F6E3C8; border-radius: 2px; }
.mini-scene .house::before { content: ""; position: absolute; left: -6px; right: -6px; top: -20px; height: 22px; background: #8C3B2E; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mini-scene .house::after { content: ""; position: absolute; left: 15px; bottom: 0; width: 10px; height: 16px; background: #6B3A26; border-radius: 3px 3px 0 0; }

/* Preguntas frecuentes en acordeón (<details class="acc">) */
.faq { display: grid; gap: 14px; max-width: 820px; margin-inline: auto; }
.acc {
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--line);
  transition: border-color .25s, box-shadow .3s;
}
.acc[open] { border-color: #F3B1B7; box-shadow: var(--shadow); }
.acc > summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
  font-weight: 750;
  font-size: 1.05rem;
  -webkit-tap-highlight-color: transparent;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--red-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='%23E63946' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/22px no-repeat;
  transition: transform .45s var(--ease-bounce), background-color .25s;
}
.acc[open] > summary::after { transform: rotate(135deg); background-color: var(--red-100); }
.acc > summary:hover { color: var(--red-700); }
.acc > summary:focus-visible { outline-offset: -5px; border-radius: 20px; }
.acc-body { padding: 0 20px 22px; color: var(--ink-2); }
.acc-body > :last-child { margin-bottom: 0; }
.acc[open] > .acc-body { animation: nip-drop .45s var(--ease-out) backwards; }

/* Llamada final roja */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 52px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: #fff;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(255, 183, 3, .35), transparent 60%),
    radial-gradient(500px 300px at 100% 100%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(140deg, var(--red-600) 0%, var(--red-700) 100%);
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; font-size: clamp(2rem, 7vw, 3rem); margin-bottom: .25em; }
.cta-band p { font-size: 1.1rem; margin: 0 auto 26px; max-width: 28em; }
.cta-band :focus-visible { outline-color: #fff; }

/* ---------- Ayuda: buscador, preguntas en tarjetas, foto ---------- */
.hero-small { padding: 32px 0 44px; text-align: center; }
@media (min-width: 900px) { .hero-small { padding: 56px 0 64px; } }
.hero-small h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); margin-bottom: .25em; }
.hero-small .lead { margin-inline: auto; }
.hero-small .mascot { margin: 0 auto 6px; }

.search-box { position: relative; max-width: 640px; margin: 0 auto; }
.search-box .ico {
  position: absolute;
  left: 22px; top: 50%;
  translate: 0 -50%;
  width: 28px; height: 28px;
  color: var(--muted);
  pointer-events: none;
}
.search-box .input {
  min-height: 70px;
  padding-left: 64px;
  border-radius: var(--pill);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}
.search-box .input::-webkit-search-cancel-button { -webkit-appearance: none; }

.faq-grid { align-items: start; }
.acc > summary .ico-circle { width: 52px; height: 52px; }
@media (max-width: 599px) {
  .acc > summary { gap: 12px; padding: 14px 16px; }
  .acc > summary .ico-circle { width: 42px; height: 42px; }
  .acc > summary .ico-circle .ico { width: 22px; height: 22px; }
  .acc > summary::after { width: 36px; height: 36px; background-size: 20px; }
  .acc-body { padding: 0 16px 20px; }
}
.acc-body .btn { margin-top: 4px; }

.file-pick { position: relative; cursor: pointer; }
.file-pick:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.photo-prev { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.photo-prev img { max-height: 150px; max-width: 60%; border-radius: 14px; box-shadow: var(--shadow); }

.cheer { min-height: 1.6em; margin: 0 0 14px; font-weight: 800; color: var(--ok); }

/* ---------- Páginas legales y de texto ---------- */
.legal { max-width: 800px; margin-inline: auto; padding-top: 36px; }
.legal h1 { font-size: clamp(2rem, 6vw, 2.7rem); }
.legal h2 { font-size: 1.35rem; margin-top: 1.8em; letter-spacing: -.01em; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 1.3em; margin: 0 0 1em; }
.legal li { margin-bottom: .45em; }
.legal .updated { color: var(--muted); font-size: .9rem; }
.legal .summary { margin: 24px 0 8px; font-weight: 500; }
.legal .summary .ico { margin-top: .2em; }
.legal dl { display: grid; gap: 4px 16px; margin: 0 0 1em; padding: 20px; border-radius: 18px; background: var(--blush); }
.legal dt { font-weight: 800; color: var(--ink); }
.legal dd { margin: 0 0 10px; color: var(--ink-2); }
@media (min-width: 640px) { .legal dl { grid-template-columns: 11em 1fr; } .legal dd { margin: 0; } }
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 36px 0 0; padding: 0; list-style: none; }
.legal-nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: var(--pill); background: var(--blush); text-decoration: none; font-weight: 700; color: var(--ink); }
.legal-nav a:hover, .legal-nav a[aria-current="page"] { background: var(--red-50); color: var(--red-700); }

/* ---------- Avisos flotantes (toasts) ---------- */
.nip-toasts {
  position: fixed;
  z-index: 10000;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;
  width: min(560px, calc(100% - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.nip-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 14px 14px;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ok-50);
  box-shadow: var(--shadow-lg);
  font-weight: 750;
  font-size: 1.05rem;
  line-height: 1.35;
  cursor: pointer;
  animation: nip-toast-in .55s var(--ease-bounce) backwards;
}
.nip-toast .t-ico {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-50);
  color: var(--ok);
}
.nip-toast .t-ico svg { width: 26px; height: 26px; }
.nip-toast.is-error { border-color: var(--red-100); }
.nip-toast.is-error .t-ico { background: var(--red-50); color: var(--red-700); }
.nip-toast.is-info { border-color: var(--info-50); }
.nip-toast.is-info .t-ico { background: var(--info-50); color: var(--info); }
.nip-toast.is-out { animation: nip-toast-out .35s ease forwards; }

.nip-confetti { position: fixed; inset: 0; z-index: 10001; pointer-events: none; }

/* ==========================================================================
   Animaciones
   ========================================================================== */

/* .reveal: aparece al hacer scroll. Sin JS se ve siempre; si el JS falla,
   aparece igualmente a los 2,5 s. */
html.nip-js .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(28px);
  animation: nip-failsafe .6s ease 2.5s forwards;
}
html.nip-live .reveal:not(.is-visible) { animation: none; }
.reveal.is-visible { animation: nip-reveal .75s var(--ease-out) var(--d, 0s) backwards; }

.bounce-in { animation: nip-bounce-in .7s var(--ease-bounce) backwards; }
.shake { animation: nip-shake .5s ease-in-out; }

@keyframes nip-reveal { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes nip-failsafe { to { opacity: 1; transform: none; } }
@keyframes nip-bounce-in {
  0% { opacity: 0; transform: scale(.6) translateY(16px); }
  60% { opacity: 1; transform: scale(1.06) translateY(-4px); }
  80% { transform: scale(.97); }
  100% { opacity: 1; transform: none; }
}
@keyframes nip-shake {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-10px); }
  35%, 75% { transform: translateX(10px); }
  90% { transform: translateX(-4px); }
}
@keyframes nip-shine {
  0% { transform: translateX(-130%); }
  28%, 100% { transform: translateX(130%); }
}
@keyframes nip-spin { to { transform: rotate(360deg); } }
@keyframes nip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes nip-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes nip-stripes { to { background-position: 28px 0, 0 0; } }
@keyframes nip-twinkle {
  0%, 100% { transform: translateY(-50%) scale(1) rotate(0); }
  50% { transform: translateY(-50%) scale(1.15) rotate(12deg); }
}
@keyframes nip-star-pop {
  0% { transform: scale(0) rotate(-40deg); }
  70% { transform: scale(1.3) rotate(8deg); }
  100% { transform: none; }
}
@keyframes nip-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.05) rotate(-.6deg); }
  70% { transform: scale(.98); }
  100% { transform: scale(1); }
}
@keyframes nip-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes nip-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes nip-wave {
  0%, 55%, 100% { transform: rotate(0); }
  65% { transform: rotate(-26deg); }
  75% { transform: rotate(6deg); }
  85% { transform: rotate(-20deg); }
}
@keyframes nip-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }
@keyframes nip-jump {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(6px) scale(1.08, .9); }
  55% { transform: translateY(-34px) scale(.95, 1.06); }
  80% { transform: translateY(0) scale(1.05, .95); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes nip-turn { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(200deg); } }
@keyframes nip-toast-in { from { opacity: 0; transform: translateY(-24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes nip-toast-out { to { opacity: 0; transform: translateY(-16px) scale(.95); } }

/* ---------- Modo demostración (nipipo.js pone html.nip-demo y la franja si GET /api/config → demo) ----------
   Franja fija arriba; la página baja lo mismo y lo que se queda pegado arriba (cabecera, barra del
   editor, vista previa del asistente) se pone justo debajo de la franja, sin taparse. */
.nip-demo-bar { display: none; }
html.nip-demo { --demo-h: 34px; scroll-padding-top: calc(96px + var(--demo-h)); }
html.nip-demo .nip-demo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  height: var(--demo-h);
  padding: 0 12px;
  background: var(--sun-50);
  color: var(--ink);
  border-bottom: 2px solid var(--sun);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.1;
}
html.nip-demo .nip-demo-bar span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html.nip-demo body { padding-top: var(--demo-h); }
html.nip-demo .topbar, html.nip-demo .ed-head, html.nip-demo .wz-preview { top: var(--demo-h); }
@media (max-width: 439px) { html.nip-demo .nip-demo-bar { font-size: .74rem; padding: 0 8px; } }
@media (max-width: 359px) { html.nip-demo .nip-demo-bar { font-size: .66rem; padding: 0 6px; } }
@media print { .nip-demo-bar { display: none !important; } html.nip-demo body { padding-top: 0; } }

/* ---------- Movimiento reducido: todo quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  html.nip-js .reveal:not(.is-visible), .reveal, .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .btn-primary::after { display: none; }
  .btn:hover, .btn:active, .card-pop:hover, .card-pop:active, .choice:hover { translate: none !important; }
  .topbar .brand:hover { transform: none; }
  /* el spinner sigue girando despacio: indica que algo está pasando */
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

/* ---------- Impresión ---------- */
@media print {
  .topbar, .footer, .nip-toasts, .nip-confetti, .skip-link { display: none !important; }
  html.nip-js .reveal:not(.is-visible) { opacity: 1; transform: none; }
  body { font-size: 12pt; }
}
