/* FORMULARIO ANTIGUAFEST */

.af-formulario,
.af-formulario * {
  box-sizing: border-box;
}

.af-formulario {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid rgba(66, 225, 221, 0.3);
  border-radius: 22px;
  background: rgba(37, 17, 52, 0.95);
  color: #ffffff;
  font-family: "Segoe UI", Arial, sans-serif;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.af-formulario h2 {
  margin: 0 0 12px;
  color: #42e1dd;
  font-size: 26px;
  line-height: 1.2;
}

.af-formulario .af-intro {
  margin: 0 0 24px;
  color: #e4d8ec;
  font-size: 14px;
  line-height: 1.6;
}

.af-formulario .af-campo {
  display: block;
  margin: 0 0 18px;
}

.af-formulario .af-campo span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.af-formulario .af-campo input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
}

.af-formulario .af-campo input::placeholder {
  color: #b9a6c4;
}

.af-formulario .af-campo input:focus {
  outline: 2px solid #42e1dd;
  outline-offset: 2px;
}

.af-formulario .af-aviso {
  margin: 0 0 20px;
  color: #dfd1e7;
  font-size: 12px;
  line-height: 1.6;
}

.af-formulario .af-enviar {
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: #ffd000;
  color: #251033;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.af-formulario .af-enviar:hover {
  background: #ffe15c;
}

.af-formulario .af-enviar:focus-visible {
  outline: 3px solid #42e1dd;
  outline-offset: 4px;
}

.af-formulario .af-enviar:disabled {
  opacity: 0.65;
  cursor: wait;
}

.af-formulario .af-mensaje {
  min-height: 24px;
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.af-formulario .af-mensaje[data-estado="exito"] {
  color: #8ff0c0;
}

.af-formulario .af-mensaje[data-estado="error"] {
  color: #ffb5bf;
}

.af-formulario .af-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* BOTÓN LATERAL DE ESCRITORIO */

.af-abrir {
  box-sizing: border-box;
  position: fixed;
  top: 50%;
  right: max(20px, env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  z-index: 10;

  display: inline-block;
  width: auto;
  max-width: 180px;
  margin: 0;
  padding: 14px 20px;

  border: 1px solid rgba(255, 208, 0, 0.5);
  border-radius: 999px;
  background: #ffd000;
  color: #251033;

  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;

  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}

.af-abrir:hover {
  background: #ffe15c;
  transform: translateY(-50%);
}

.af-abrir:focus-visible,
.af-cerrar:focus-visible {
  outline: 3px solid #42e1dd;
  outline-offset: 4px;
}

/* VENTANA EMERGENTE */

.af-modal {
  box-sizing: border-box;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(66, 225, 221, 0.35);
  border-radius: 22px;
  background: #251134;
  color: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.af-modal::backdrop {
  background: rgba(10, 5, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.af-modal .af-formulario {
  max-width: none;
  margin: 0;
  padding-top: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.af-cerrar {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.af-cerrar:hover {
  background: rgba(255, 255, 255, 0.15);
}

html.af-modal-abierto,
html.af-modal-abierto body {
  overflow: hidden;
}

/* TABLET Y MÓVIL: BOTÓN INFERIOR DERECHO */

@media (max-width: 1100px) {
  .af-abrir {
    top: auto;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    left: auto;

    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    transform: none;
    font-size: 13px;
  }

  .af-abrir:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .af-formulario {
    padding: 24px;
  }

  .af-formulario h2 {
    font-size: 24px;
  }

  .af-modal .af-formulario {
    padding-top: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .af-abrir {
    transition: none;
  }
}

/* Botón fijo abajo y centrado, en escritorio y móvil */
.af-abrir {
  position: fixed;
  top: auto;
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;

  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;

  transform: translateX(-50%);
  z-index: 10;
}

.af-abrir:hover {
  transform: translateX(-50%);
}

@media (max-width: 600px) {
  .af-abrir {
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 12px 20px;
    font-size: 13px;
  }
}