/* =====================================================================
   Consentimiento digital — Nutrialde
   Tipografía Montserrat servida en local (sin dependencia de Google Fonts)
   ===================================================================== */

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --verde: #233b25;
  --negro: #000000;
  --gris-linea: #cccccc;
  --gris-suave: #f6f6f4;
  --rojo: #a32020;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 16px 64px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 16px;              /* nunca menos: por debajo, iOS hace zoom al enfocar */
  line-height: 1.55;
  color: var(--negro);
  background: #fff;
}

.hoja { max-width: 720px; margin: 0 auto; }

/* ---------- Cabecera ---------- */
.cabecera { text-align: center; padding: 32px 0 24px; }
.logo { width: 150px; height: auto; }

/* ---------- Texto legal ---------- */
.legal { font-size: 14px; text-align: justify; }
.legal p { margin: 0 0 14px; }
.legal a { color: var(--verde); }

.tratamiento {
  border: 1px solid var(--negro);
  padding: 14px 16px;
  margin: 0 0 12px;
}
.tratamiento h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.tratamiento p { margin: 0 0 8px; }
.tratamiento p:last-child { margin-bottom: 0; }

/* ---------- Formulario ---------- */
form { margin-top: 32px; }

.bloque {
  border: none;
  border-top: 1px solid var(--gris-linea);
  padding: 24px 0 8px;
  margin: 0;
}
.bloque legend {
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 12px 0 0;
}
.destacado { background: var(--gris-suave); padding: 20px 16px 12px; border-top: none; }

.ayuda { font-size: 13px; color: #555; margin: 4px 0 14px; }

.campo { margin-bottom: 18px; }
.campo label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.campo input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 14px 12px;
  border: 1px solid var(--negro);
  border-radius: 0;
  background: #fff;
  color: var(--negro);
  -webkit-appearance: none;
}
.campo input:focus {
  outline: 2px solid var(--verde);
  outline-offset: -2px;
}
.campo input.mal { border-color: var(--rojo); border-width: 2px; }

/* Opciones: área táctil amplia (mínimo 44px de alto) */
.opcion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 15px;
}
.opcion input {
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--verde);
}

/* Separación clara del último bloque respecto al consentimiento comercial */
.copia {
  border-top: 2px solid var(--negro);
  margin-top: 28px;
  padding-top: 20px;
}

/* ---------- Firma ---------- */
.firma-ayuda { margin-top: 16px; }
.lienzo-caja { position: relative; }
#lienzo {
  width: 100%;
  height: 220px;
  border: 1px solid var(--negro);
  background: #fff;
  display: block;
  touch-action: none;          /* imprescindible: si no, el dedo hace scroll al firmar */
  cursor: crosshair;
}

/* ---------- Botones ---------- */
.boton-principal, .boton-secundario {
  font-family: inherit;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
}
.boton-principal {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 20px;
  font-size: 17px;
  letter-spacing: .04em;
  background: var(--verde);
  color: #fff;
  border: none;
}
.boton-principal:disabled { opacity: .5; }
.boton-secundario {
  margin-top: 10px;
  padding: 12px 20px;
  font-size: 14px;
  background: #fff;
  color: var(--negro);
  border: 1px solid var(--negro);
}

/* ---------- Errores ---------- */
.error {
  color: var(--rojo);
  font-size: 13px;
  font-weight: 600;
  margin: 6px 0 0;
  min-height: 0;
}
.error:empty { display: none; }
.error-general {
  margin-top: 20px;
  padding: 14px;
  border: 2px solid var(--rojo);
  text-align: center;
}

/* ---------- Campo trampa ---------- */
.trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Confirmación ---------- */
.confirmacion { text-align: center; padding: 60px 0; }
.marca-ok {
  width: 72px; height: 72px;
  margin: 0 auto 24px;
  border: 3px solid var(--verde);
  border-radius: 50%;
  color: var(--verde);
  font-size: 38px;
  line-height: 66px;
}
.confirmacion h2 { font-size: 20px; margin: 0 0 12px; }
.confirmacion p { color: #444; font-size: 15px; }
.confirmacion .boton-principal { max-width: 320px; margin: 32px auto 0; }

/* ---------- Pie ---------- */
.pie {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--gris-linea);
  text-align: center;
  font-size: 12px;
  color: #777;
}

/* ---------- Tablet en horizontal ---------- */
@media (min-width: 900px) {
  .legal { font-size: 13.5px; }
  #lienzo { height: 200px; }
}
