*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--alto-header) + 56px); }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main, body > .admin-app { flex: 1; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 0.75em; }
a { color: var(--acento-osc); }
[hidden] { display: none !important; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }
.pagina { padding-top: 20px; padding-bottom: 40px; }
.pagina--angosta { max-width: 640px; }

/* Botones: alto táctil cómodo en celular */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  font: inherit; font-weight: 700; text-decoration: none; text-align: center;
  color: #fff; background: var(--acento);
  border: 2px solid var(--acento); border-radius: 99px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--acento-osc); border-color: var(--acento-osc); transform: translateY(-1px); }
.btn--amarillo { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn--amarillo:hover { background: #fff; border-color: #fff; color: var(--red-d); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--chico { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn--ancho { width: 100%; }
.btn--borde { background: transparent; color: var(--red); border-color: var(--red); }
.btn--borde:hover { background: var(--yellow-s); border-color: var(--red-d); color: var(--red-d); }
.btn--peligro { background: transparent; color: var(--error); border-color: #e8bcb8; }
.btn--peligro:hover { background: var(--error-claro); border-color: var(--error); }
.enlace { display: inline-block; padding: 6px 0; font-size: 0.9rem; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.aviso { padding: 10px 14px; border-radius: var(--radio-chico); background: var(--aviso-claro); color: var(--aviso); margin: 12px 0; }
.aviso--ok { background: var(--ok-claro); color: var(--ok); }
.aviso--error { background: var(--error-claro); color: var(--error); }
.aviso a { color: inherit; font-weight: 600; }

.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--yellow); color: var(--ink); font-size: 0.78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge--claro { background: #fff; color: var(--red-d); }

.vacio { text-align: center; padding: 48px 16px; color: var(--tinta-suave); }
.vacio .btn { margin-top: 8px; }
.ayuda { font-size: 0.88rem; color: var(--tinta-suave); margin: 6px 0; }

/* Formularios: 16px evita el zoom automático en iPhone */
.campo { display: block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; }
.campo input, .campo select, .campo textarea, .buscador input {
  display: block; width: 100%; margin-top: 4px; min-height: 46px; padding: 10px 12px;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--tinta);
  background: #fff; border: 1.5px solid var(--borde); border-radius: var(--radio-chico);
}
.campo textarea { resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .buscador input:focus { border-color: var(--acento); outline: none; box-shadow: 0 0 0 3px var(--acento-claro); }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 0.95rem; font-weight: 400; }
.check input { width: 20px; height: 20px; accent-color: var(--acento); }

.bloque { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; margin: 0 0 16px; min-width: 0; }
.bloque > legend, .bloque > h2:first-child { font-weight: 700; font-size: 1.05rem; padding: 0 6px; margin-bottom: 8px; }
fieldset.bloque { margin-inline: 0; }

/* Opciones tipo tarjeta (radio) */
.opciones { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opcion span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 12px;
  border: 1.5px solid var(--borde); border-radius: 99px; background: #fff; font-weight: 700; text-align: center;
}
.opcion input:checked + span { border-color: var(--acento); background: var(--acento-claro); color: var(--acento-osc); }
.opcion input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.footer { margin-top: 40px; padding: 24px 0 32px; background: var(--ink); color: #f1d9d3; font-size: 0.9rem; }
.footer p { margin: 2px 0; }
.footer__fila { display: flex; flex-direction: column; gap: 16px; }
.footer .btn--borde { color: #fff; border-color: #5c5148; }
.footer .btn--borde:hover { background: #2d2622; }
@media (min-width: 640px) {
  .footer__fila { flex-direction: row; justify-content: space-between; align-items: center; }
}

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50;
  background: var(--oscuro); color: #fff; padding: 10px 18px; border-radius: 24px; font-size: 0.9rem; box-shadow: var(--sombra);
}

@media (min-width: 1024px) {
  h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
