/* ============================================================
   JUNTA DE FREGUESIA DA FUSETA — Formulário de Contacto
   Carregado apenas na página de Contactos.
   ============================================================ */

.contact-form-section { margin-top: 2.5rem; }
.contact-form-section > p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  max-width: 62ch;
}

/* --- Cartão do formulário --- */
.contact-form {
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1.75rem;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.form-field { display: flex; flex-direction: column; gap: .4rem; }

.form-field label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .02em;
}
.form-field .required { color: #c0392b; }

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: .92rem;
  color: var(--text);
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field textarea { resize: vertical; min-height: 150px; }

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 63, 122, .12);
}

/* --- Estado de erro (validação via JS) --- */
.form-field.has-error input,
.form-field.has-error textarea { border-color: #c0392b; }
.form-field .field-error {
  font-size: .76rem;
  color: #c0392b;
  display: none;
}
.form-field.has-error .field-error { display: block; }

/* --- Consentimento RGPD --- */
.form-consent {
  flex-direction: row;
  align-items: flex-start;
  gap: .6rem;
}
.form-consent input {
  width: auto;
  margin-top: .15rem;
  flex-shrink: 0;
  accent-color: var(--navy);
}
.form-consent label {
  font-weight: 400;
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.5;
}
.form-consent.has-error label { color: #c0392b; }

/* --- Aviso de privacidade --- */
.form-privacy-notice {
  margin: 0;
  font-size: .78rem;
  color: var(--text-light);
  background: var(--bg-notice);
  border: 1px solid var(--border-notice);
  border-radius: 8px;
  padding: .7rem .9rem;
  line-height: 1.55;
}

/* --- Honeypot anti-spam (invisível para humanos) --- */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Botão de envio --- */
.form-submit {
  align-self: flex-start;
  position: relative;
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: .8rem 1.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), transform 120ms var(--ease-out);
}
.form-submit:hover { background: var(--navy-dark); }
.form-submit:active { transform: scale(0.97); }
.form-submit:disabled { opacity: .6; cursor: not-allowed; }

.form-submit.loading { color: transparent; }
.form-submit.loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: form-spin .7s linear infinite;
}
@keyframes form-spin { to { transform: rotate(360deg); } }

/* --- Mensagem de feedback (sucesso / erro) --- */
.form-feedback {
  font-size: .88rem;
  line-height: 1.5;
  border-radius: 8px;
}
.form-feedback.show { padding: .85rem 1rem; }
.form-feedback.success {
  background: #eaf6ec;
  border: 1px solid #9ed3a8;
  color: #1e6b32;
}
.form-feedback.error {
  background: #fdecea;
  border: 1px solid #f0a9a3;
  color: #a3261b;
}

/* --- Responsivo --- */
@media (max-width: 768px) {
  .contact-form { padding: 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .form-submit.loading::after { animation: none; }
}
