/* Formularios cortos de +SaBoR: /sumate (comensales) y /restaurantes/alta
   (restaurantes). Brandbook pre-final v0.9: crema de fondo, vino para leer,
   rojo solo para la firma y la palabra a mano, amarillo de acento.
   Clash Grotesk viene de Fontshare (no se redistribuye, decisión B24). */

@font-face {
  font-family: 'Caveat';
  src: url('/formularios/caveat-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --crema: #FEFFED;
  --vino: #58021B;
  --rojo: #F71D28;
  --amarillo: #FFEE6C;
  --vino-suave: rgba(88, 2, 27, .62);
  --borde: rgba(88, 2, 27, .28);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--crema);
  color: var(--vino);
  font-family: 'Clash Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.4;
  overflow-x: hidden;
}

/* Los "+" amarillos de las historias, de fondo y lejos del texto. */
.mases {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 440px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.mases i {
  position: absolute;
  width: 44px;
  aspect-ratio: 96 / 111;
  background: var(--amarillo);
  -webkit-mask: url('/formularios/mas.webp') center / contain no-repeat;
  mask: url('/formularios/mas.webp') center / contain no-repeat;
}
.mases i:nth-child(1) { top: 22px; left: 7%; transform: rotate(-8deg); }
.mases i:nth-child(2) { top: 118px; right: 6%; width: 36px; transform: rotate(12deg); }
.mases i:nth-child(3) { top: 230px; left: 4%; width: 30px; transform: rotate(6deg); }
.mases i:nth-child(4) { top: 300px; right: 3%; width: 32px; transform: rotate(-10deg); }
.mases i:nth-child(5) { display: none; }
.mases i:nth-child(6) { display: none; }

.pagina {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.firma { display: block; margin: 4px 0 6px; }
.firma img { display: block; width: 104px; height: auto; }

.mascota { display: block; height: auto; margin: 6px auto 2px; }
.mascota.sumate { width: 82px; }
.mascota.mozo { width: 118px; }

h1 {
  margin: 8px 0 0;
  font-weight: 600;
  font-size: clamp(30px, 8.6vw, 40px);
  line-height: 1.04;
  letter-spacing: -.02em;
}
h1 .previo {
  display: block;
  font-size: .62em;
  font-weight: 500;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}
.a-mano {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  color: var(--rojo);
  font-size: 1.32em;
  letter-spacing: 0;
  line-height: .8;
}
h1 .a-mano.grande { display: block; font-size: 1.95em; line-height: .95; }

.bajada {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 500;
  max-width: 330px;
}

form {
  width: 100%;
  margin-top: 18px;
  text-align: left;
}

.campo { margin-bottom: 12px; }

.etiqueta .opcional { font-weight: 400; color: var(--vino-suave); }

label.etiqueta {
  display: block;
  font-weight: 500;
  font-size: 15px;
  margin: 0 0 5px 2px;
}

input[type='text'],
input[type='email'],
input[type='tel'] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font: inherit;
  font-size: 17px; /* 16 o más: iOS no hace zoom al tocar el campo */
  color: var(--vino);
  background: #FFFFFF;
  border: 2px solid var(--borde);
  border-radius: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: rgba(88, 2, 27, .38); }
input:focus { border-color: var(--vino); box-shadow: 0 0 0 4px rgba(255, 238, 108, .9); }
input[aria-invalid='true'] { border-color: var(--vino); border-width: 3px; background: #FFFBE0; }

.error {
  margin: 6px 0 0 2px;
  font-size: 14px;
  font-weight: 600;
}
.error::before { content: '+ '; color: var(--rojo); }

.consentimiento {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 18px 0 4px;
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
}
.consentimiento input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--vino);
  border-radius: 7px;
  background: #FFFFFF;
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.consentimiento input::after {
  content: '';
  width: 11px;
  height: 6px;
  border: solid var(--crema);
  border-width: 0 0 3px 3px;
  transform: translateY(-2px) rotate(-45deg);
  opacity: 0;
}
.consentimiento input:checked { background: var(--vino); }
.consentimiento input:checked::after { opacity: 1; }
.consentimiento input:focus-visible { box-shadow: 0 0 0 4px rgba(255, 238, 108, .9); }
.consentimiento input[aria-invalid='true'] { border-width: 3px; background: #FFFBE0; }

button.enviar {
  width: 100%;
  height: 58px;
  margin-top: 18px;
  font: inherit;
  font-weight: 600;
  font-size: 19px;
  color: var(--vino);
  background: var(--amarillo);
  border: 2px solid var(--vino);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--vino);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s, box-shadow .08s;
}
button.enviar:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--vino); }
button.enviar:focus-visible { outline: 3px solid var(--vino); outline-offset: 3px; }
button.enviar[disabled] { cursor: progress; opacity: .75; }

.aviso {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FFF6B0;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.listo {
  width: 100%;
  margin-top: 26px;
  padding: 26px 20px 24px;
  border: 2px solid var(--vino);
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 5px 0 var(--vino);
}
.listo h2 {
  margin: 0;
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -.02em;
}
.listo h2:focus { outline: none; }
.listo p { margin: 8px 0 0; font-size: 18px; font-weight: 500; }

.pie {
  margin-top: 26px;
  font-size: 14px;
  color: var(--vino-suave);
}
.pie a { color: var(--vino); font-weight: 600; text-underline-offset: 3px; }

.oculto-visual {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] { display: none !important; }

@media (min-width: 700px) {
  .pagina { padding-top: 48px; max-width: 480px; }
  h1 { font-size: 46px; }
  .bajada { font-size: 19px; max-width: 380px; }
  .mases { position: fixed; inset: 0; height: auto; }
  .mases i { width: 64px; }
  .mases i:nth-child(5), .mases i:nth-child(6) { display: block; }
  .mascota.sumate { width: 96px; }
  .mascota.mozo { width: 140px; }
  .mases i:nth-child(1) { top: 8%; left: 14%; }
  .mases i:nth-child(2) { top: 20%; right: 15%; }
  .mases i:nth-child(3) { top: 52%; left: 8%; width: 56px; }
  .mases i:nth-child(4) { top: 66%; right: 9%; width: 56px; }
  .mases i:nth-child(5) { bottom: 10%; left: 18%; }
  .mases i:nth-child(6) { bottom: 6%; right: 20%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
