/* ==========================================================================
   CONTACT — envio real do formulário (contact.php)
   Complementa style.css (.contact-form / .form-field): estado do envio,
   botão ocupado e honeypot anti-spam. Só é carregado em contact.html.
   ========================================================================== */

/* honeypot: fora do ecrã (não display:none — os bots ignoram esse) */
.cf-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* caixa de estado (a enviar / enviado / erro) */
.form-status {
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--bg-1);
}
.form-status[hidden] { display: none; }
.form-status a { color: inherit; font-weight: 600; text-decoration: underline; }

.form-status--busy {
  color: var(--ink-2);
}
.form-status--ok {
  color: var(--brand-strong);
  background: rgba(var(--brand-rgb), 0.10);
  border-color: rgba(var(--brand-rgb), 0.38);
}
.form-status--err {
  color: var(--fire);
  background: rgba(var(--fire-rgb), 0.08);
  border-color: rgba(var(--fire-rgb), 0.38);
}

/* ícone à esquerda do texto */
.form-status::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05em;
}
.form-status--busy::before {
  animation: cf-pulse 1s ease-in-out infinite;
}
@keyframes cf-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* botão enquanto envia */
.contact-form .btn[disabled],
.contact-form .btn.is-busy {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
}

/* campos inválidos após tentativa de envio */
.contact-form.was-validated :invalid {
  border-color: rgba(var(--fire-rgb), 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .form-status--busy::before { animation: none; }
}
