:root {
  --vivela: #a6f58c;
  --vivela-suave: rgba(166, 245, 140, .16);
  --teal: #0e6b67;
  --teal-oscuro: #0b2f2d;
  --tinta: #0a1715;
  --texto: #f4f8f6;
  --texto-suave: rgba(244, 248, 246, .78);
  --borde: rgba(255, 255, 255, .18);
  --campo: rgba(8, 22, 20, .45);
  --oro-1: #f6c25b;
  --oro-2: #e09a32;
  --oro-3: #b8651e;
  --rojo: #ff9b8f;
  --radio: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--tinta);
  overflow-x: hidden;
}

/* Fondo: el folleto difuminado como vidrio, con velo oscuro y verdes Vivela. */
.fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--tinta);
}
.fondo::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: url("../img/fondo-movil.webp") center 30% / cover no-repeat;
  filter: blur(9px) saturate(1.2);
  transform: scale(1.06);
}
.fondo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(166, 245, 140, .22), transparent 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(14, 107, 103, .55), transparent 60%),
    linear-gradient(180deg, rgba(6, 18, 17, .50) 0%, rgba(10, 30, 28, .66) 45%, rgba(6, 14, 13, .84) 100%);
}

.pagina {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 24px;
  display: grid;
  gap: 20px;
}

/* Encabezado del evento */
.evento { min-width: 0; }

.marca {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 12px;
  border: 1px solid rgba(166, 245, 140, .35);
  border-radius: 999px;
  background: rgba(166, 245, 140, .10);
  color: var(--vivela);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.marca span { opacity: .6; }

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.bajada {
  margin: 0 0 18px;
  color: var(--texto-suave);
  font-size: 15px;
}
.bajada strong { color: var(--texto); }

.fecha {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
  margin: 0;
}
.fecha > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--borde);
  border-left: 4px solid var(--vivela);
  border-radius: 12px;
  background: rgba(8, 24, 22, .62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.fecha dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--vivela);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fecha dd {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
}
.fecha svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* El folleto nítido solo se muestra en pantallas anchas. */
.folleto { display: none; }

/* Panel del formulario: vidrio translúcido */
.panel {
  min-width: 0;
  padding: 22px 18px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: linear-gradient(160deg, rgba(14, 107, 103, .30), rgba(6, 20, 19, .55));
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.campo { margin-bottom: 14px; }

.campo > label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: var(--campo);
  color: var(--texto);
  font: inherit;
  font-size: 16px; /* 16px evita el zoom automático en iPhone */
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: rgba(244, 248, 246, .45); }
input:focus {
  outline: none;
  border-color: var(--vivela);
  background: rgba(8, 22, 20, .65);
  box-shadow: 0 0 0 4px var(--vivela-suave);
}
.campo.invalido input { border-color: var(--rojo); }
.campo.valido input { border-color: rgba(166, 245, 140, .6); }

.error {
  min-height: 0;
  margin: 6px 2px 0;
  color: var(--rojo);
  font-size: 13px;
  font-weight: 500;
}
.error:empty { display: none; }

/* Campo trampa: fuera de la vista, pero sin display:none para que los robots lo llenen. */
.trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Consentimiento */
.consentimiento { margin-top: 6px; }
.campo > label.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--texto-suave);
  cursor: pointer;
}
.check strong { color: var(--texto); }
.check input {
  position: absolute;
  opacity: 0;
  width: 24px;
  height: 24px;
  margin: 0;
}
.caja {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1.5px solid rgba(255, 255, 255, .45);
  border-radius: 7px;
  background: var(--campo);
  display: grid;
  place-items: center;
  transition: background .2s, border-color .2s;
}
.caja::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--teal-oscuro);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
}
.check input:checked + .caja { background: var(--vivela); border-color: var(--vivela); }
.check input:checked + .caja::after { opacity: 1; }
.check input:focus-visible + .caja { box-shadow: 0 0 0 4px var(--vivela-suave); border-color: var(--vivela); }
.campo.invalido .caja { border-color: var(--rojo); }

.privacidad {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  font-size: 12.5px;
  color: var(--texto-suave);
}
.privacidad summary {
  cursor: pointer;
  color: var(--vivela);
  font-weight: 600;
}
.privacidad p { margin: 8px 0 2px; }
a { color: var(--vivela); text-underline-offset: 2px; }

.aviso-error {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 155, 143, .45);
  border-radius: 10px;
  background: rgba(120, 20, 10, .35);
  color: #ffe3df;
  font-size: 14px;
}

/* Botón dorado */
.boton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--oro-1) 0%, var(--oro-2) 50%, var(--oro-3) 100%);
  color: #2a1604;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(224, 154, 50, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.boton:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(224, 154, 50, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.boton:active { transform: translateY(1px) scale(.995); }
.boton:focus-visible { outline: 3px solid var(--vivela); outline-offset: 3px; }
.boton[disabled] { cursor: wait; filter: saturate(.7) brightness(.92); }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(42, 22, 4, .3);
  border-top-color: #2a1604;
  border-radius: 50%;
  animation: girar .8s linear infinite;
}
.boton[disabled] .spinner { display: inline-block; }
@keyframes girar { to { transform: rotate(360deg); } }

/* Confirmación */
.exito { text-align: center; padding: 6px 2px; outline: none; }
.exito-icono svg {
  width: 76px;
  height: 76px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.exito-icono circle { stroke: var(--vivela); stroke-width: 3; fill: rgba(166, 245, 140, .12); }
.exito-icono path {
  stroke: var(--vivela);
  stroke-width: 4;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: trazo .6s .15s ease-out forwards;
}
@keyframes trazo { to { stroke-dashoffset: 0; } }
.exito h2 { margin: 10px 0 6px; font-size: 24px; color: var(--vivela); }
.exito-saludo { margin: 0 0 16px; color: var(--texto); font-size: 16px; }
.exito-fecha {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(166, 245, 140, .35);
  border-radius: 14px;
  background: rgba(166, 245, 140, .08);
}
.exito-fecha p { margin: 0; font-weight: 700; font-size: 16px; }
.exito-fecha p + p { margin-top: 2px; color: var(--vivela); }
.exito-nota { margin: 0 0 16px; font-size: 13.5px; color: var(--texto-suave); }
.boton-secundario {
  background: transparent;
  color: var(--vivela);
  border: 1.5px solid var(--vivela);
  box-shadow: none;
}
.boton-secundario:hover { background: rgba(166, 245, 140, .1); box-shadow: none; }
.enlace {
  margin-top: 12px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--texto-suave);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pie {
  padding: 8px 16px max(20px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: rgba(244, 248, 246, .6);
}
.pie p { margin: 0; }

/* Tablet */
@media (min-width: 600px) {
  .pagina { padding: 36px 32px 28px; max-width: 640px; gap: 24px; }
  .panel { padding: 28px 28px; }
}

/* Escritorio: folleto nítido a la izquierda, formulario a la derecha */
@media (min-width: 900px) {
  .fondo::before { background-image: url("../img/fondo.webp"); }
  .pagina {
    max-width: 1080px;
    min-height: calc(100vh - 44px);
    min-height: calc(100dvh - 44px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    align-items: center;
    gap: 48px;
    padding: 48px 40px 24px;
  }
  .folleto {
    display: block;
    margin-top: 22px;
    max-width: 320px;
  }
  .folleto img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--borde);
    box-shadow: 0 24px 50px rgba(0, 0, 0, .45);
  }
  .panel { padding: 32px; }
}

@media (min-width: 900px) and (min-height: 820px) {
  .folleto { max-width: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .exito-icono path { stroke-dashoffset: 0; }
}
