/* Formularios de contacto y de auditoria.

   Medido sobre la pagina viva de antonioserna.es, no deducido: el campo no es
   una caja, es una linea. Fondo transparente y una sola regla hairline abajo,
   que es lo que hace que un formulario largo no parezca una reja. */

.ts-form {
  --ts-acento: #C6FF3D;
  --ts-filo: #262A31;
  --ts-filo-fuerte: #3A3F48;
  --ts-panel: #111317;
  --ts-fondo: #0A0B0D;
  --ts-texto: #C9CED6;
  --ts-tenue: #9AA2AE;
  --ts-apagado: #6A7280;
  --ts-error: #E8776C;
  font-family: "Inter Tight", Inter, sans-serif;
  color: var(--ts-texto);
  width: 100%;
}

/* -- Panel -- */

.ts-form__panel {
  position: relative;
  background: var(--ts-panel);
  border: 1px solid var(--ts-filo);
  border-radius: 16px;
  padding: 36px 36px 32px;
}

/* Los dos angulos lima de la marca, en vertices opuestos. La pagina de contacto
   no los lleva y la de la auditoria si, asi que van tras un interruptor. */
.ts-form--angulo .ts-form__panel::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 44px;
  height: 44px;
  border-bottom: 1px solid var(--ts-acento);
  border-left: 1px solid var(--ts-acento);
  border-bottom-left-radius: 16px;
  pointer-events: none;
}
.ts-form--angulo .ts-form__panel::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 44px;
  height: 44px;
  border-top: 1px solid var(--ts-acento);
  border-right: 1px solid var(--ts-acento);
  border-top-right-radius: 16px;
  pointer-events: none;
}

.ts-form__eyebrow {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ts-tenue);
}

.ts-form__titulo {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 2.8vw, 36px);
  line-height: 1.1;
  color: #FFFFFF;
  margin: 10px 0 0;
}
/* El punto final en serif italica lima, como la despedida del pie. */
.ts-form__titulo .pt { color: var(--ts-acento); }

/* -- Campos -- */

.ts-form__rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.ts-form__campo--ancho { grid-column: 1 / -1; }

.ts-form__campo label {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--ts-tenue);
  margin: 0;
}
.ts-form__campo label .req { color: var(--ts-acento); }

.ts-form__campo input,
.ts-form__campo select,
.ts-form__campo textarea {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ts-filo);
  border-radius: 0;
  padding: 10px 0 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: #FFFFFF;
  transition: border-color .18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.ts-form__campo textarea { resize: vertical; min-height: 120px; }

.ts-form__campo input::placeholder,
.ts-form__campo textarea::placeholder { color: var(--ts-apagado); }

.ts-form__campo input:focus,
.ts-form__campo select:focus,
.ts-form__campo textarea:focus {
  outline: none;
  border-bottom-color: var(--ts-acento);
}

/* El desplegable nativo no deja pintar la flecha: se dibuja en el envoltorio. */
.ts-form__select { position: relative; }
.ts-form__select::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 21px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--ts-tenue);
  pointer-events: none;
}
.ts-form__campo select { padding-right: 30px; cursor: pointer; }
.ts-form__campo select option { background: var(--ts-panel); color: #FFFFFF; }

.ts-form__campo.tiene-error input,
.ts-form__campo.tiene-error select,
.ts-form__campo.tiene-error textarea { border-bottom-color: var(--ts-error); }

.ts-form__error {
  display: none;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ts-error);
  margin: 7px 0 0;
}
.ts-form__campo.tiene-error .ts-form__error { display: block; }

/* El campo trampa no se ve, pero tampoco se tabula ni lo lee un lector de pantalla. */
.ts-form__trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* -- Envio -- */

.ts-form__nota {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ts-tenue);
  margin: 26px 0 0;
}

.ts-form__enviar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ts-acento);
  color: #0A0A0A;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ts-form__enviar:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(198, 255, 61, .16); }
.ts-form__enviar[disabled] { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.ts-form__enviar svg { transition: transform .18s ease; }
.ts-form__enviar:hover svg { transform: translateX(3px); }

.ts-form__aviso {
  display: none;
  border: 1px solid rgba(232, 119, 108, .4);
  background: rgba(232, 119, 108, .07);
  border-radius: 10px;
  padding: 13px 16px;
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #F0AFA8;
}
.ts-form.tiene-aviso .ts-form__aviso { display: block; }

/* -- Exito -- */

.ts-form__exito { display: none; }
/* Se le da el foco al terminar para que un lector de pantalla lo anuncie.
   El anillo del navegador ahi no informa de nada y dibuja una caja dentro del panel. */
.ts-form__exito:focus { outline: none; }
.ts-form.enviado .ts-form__exito { display: block; }
.ts-form.enviado .ts-form__cuerpo { display: none; }

.ts-form__exito-marca {
  width: 46px;
  height: 46px;
  border: 1px solid var(--ts-acento);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ts-acento);
}

.ts-form__exito-titulo {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 2.8vw, 36px);
  line-height: 1.1;
  color: #FFFFFF;
  margin: 22px 0 0;
}
.ts-form__exito-titulo .pt { color: var(--ts-acento); }

.ts-form__exito p {
  font-size: 15px;
  line-height: 1.75;
  margin: 14px 0 0;
  max-width: 46ch;
}

.ts-form__exito-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  padding: 13px 22px;
  border: 1px solid var(--ts-filo-fuerte);
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .18s ease;
}
.ts-form__exito-cta:hover { border-color: var(--ts-acento); color: #FFFFFF; }

/* -- Movil -- */

@media (max-width: 767px) {
  .ts-form__panel { padding: 26px 20px 24px; }
  .ts-form--angulo .ts-form__panel::before,
  .ts-form--angulo .ts-form__panel::after { width: 32px; height: 32px; }
  /* Dos columnas en 280px utiles convierten cada rotulo en dos lineas. */
  .ts-form__rejilla { grid-template-columns: 1fr; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ts-form__enviar,
  .ts-form__enviar svg,
  .ts-form__campo input,
  .ts-form__campo select,
  .ts-form__campo textarea { transition: none; }
  .ts-form__enviar:hover { transform: none; }
}
