/* ===========================================================================
   FORMULARIO DE ORCAMENTO (templates/card-formulario.php, 23 paginas)
   Dash Digital, 19/08/2026. Estrategia portada do dualinfor.pt:
   - letra dos campos nunca abaixo de 16px (evita o zoom automatico do iPhone)
   - erros assinalados campo a campo (campo-erro + campo-aviso)
   - etiqueta "opcional" so no que e opcional; nota unica no topo
   - duas colunas no computador (o formulario passava da altura do ecra)
   - modal de feedback (rc-modal) em vez de faixas coloridas
   O fundo em gradiente da marca mantem-se.
   =========================================================================== */

.form-section {
  background: linear-gradient(90deg, #121054 0%, #690207 100%);
  border-radius: 30px;
  padding: 70px 90px;
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin: 50px auto;
  box-sizing: border-box;
}

.form-left {
  flex: 1;
  min-width: 280px;
  padding: 20px 0;
}

.form-left h2 {
  font-family: "Poppins", sans-serif;
  font-size: 42px;
  max-width: 90%;
  font-weight: 500;
  color: white;
  line-height: 120%;
  margin-bottom: 32px;
}

.form-left p {
  font-size: 19px;
  margin-bottom: 24px;
  font-family: "Funnel Display", sans-serif;
  font-weight: 400;
  max-width: 85%;
  line-height: 28px;
  color: white;
}

.form-right {
  flex: 1.2;
  min-width: 280px;
}

.form-right form {
  display: flex;
  flex-direction: column;
}

/* A nota unica sobre campos obrigatorios */
.form-nota {
  margin: 0 0 6px;
  font-size: 14px;
  opacity: 0.8;
}

.campo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-right label {
  font-size: 16px;
  font-weight: 500;
  font-family: "Funnel Display", sans-serif;
  line-height: 1.4;
  color: #fff;
  margin: 16px 0 6px;
}

.etiqueta-opcional {
  font-weight: 400;
  opacity: 0.75;
  font-size: 0.875em;
}

.form-right input,
.form-right select,
.form-right textarea {
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  /* 16px: abaixo disto o Safari do iPhone da zoom automatico ao tocar */
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: #1c1c1c;
  font-family: "Poppins", sans-serif;
}

.form-right select {
  appearance: auto;
  cursor: pointer;
}

.form-right input:focus,
.form-right select:focus,
.form-right textarea:focus {
  outline: 3px solid #dc6339;
  outline-offset: 1px;
}

.form-right ::placeholder {
  color: #9a9a9a;
  opacity: 1;
}

.form-right textarea {
  min-height: 96px;
  resize: vertical;
}

/* O campo que o servidor ou o navegador marcou como errado */
.form-right .campo-erro {
  border-color: #dc2626;
  background-color: #fff5f5;
}

/* A mensagem junto ao campo errado. Vermelho claro: sobre o gradiente
   escuro o vermelho normal nao se le. */
.campo-aviso {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: #ffd4d4;
  font-weight: 600;
}

/* Consentimento RGPD */
.form-consentimento {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
}

.form-consentimento input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 1px 0 0;
  cursor: pointer;
  accent-color: #dc6339;
}

.form-consentimento label {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

.form-consentimento a {
  color: inherit;
  text-decoration: underline;
}

/* reCAPTCHA: sem overflow-x, que pintava uma barra de rolagem solta */
.form-recaptcha {
  margin: 16px 0 0;
}

/* Botao */
.form-submit {
  font-family: "Funnel Display", sans-serif;
  margin-top: 22px;
  background: #dc6339;
  color: #fff;
  padding: 14px 24px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  display: inline-block;
  max-width: 100%;
  line-height: 1.3;
}

.form-submit:hover {
  background: #c4552e;
}

.form-submit:active {
  transform: translateY(1px);
}

/* Enquanto envia: sem isto as pessoas clicavam duas vezes */
.form-submit[aria-busy="true"],
.form-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.texto3-mobile {
  display: none;
}

/* ---------------------------------------------------------------------------
   DUAS COLUNAS NO COMPUTADOR (>=1024px), como no dualinfor.pt: oito blocos
   empilhados numa coluna nao cabiam no ecra; a meia largura o formulario
   ve-se inteiro de uma vez. A mensagem, o consentimento, o reCAPTCHA, a
   nota e o botao ocupam a linha toda.
   --------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .form-right .rcp-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    align-content: start;
  }

  .rcp-form > .form-nota,
  .rcp-form > .campo-mensagem,
  .rcp-form > .form-consentimento,
  .rcp-form > .form-recaptcha,
  .rcp-form > .form-submit,
  .rcp-form > .texto3-mobile,
  .rcp-form > .form-anchor {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------------------
   MODAL DE FEEDBACK (rc-modal), portado do dualinfor.pt
   --------------------------------------------------------------------------- */
.rc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.rc-modal--show {
  display: flex;
}

.rc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: #00000080;
  backdrop-filter: blur(2px);
}

.rc-modal__box {
  position: relative;
  background: #fff;
  color: #1c1c1c;
  max-width: 520px;
  width: 92%;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 22px 22px 18px;
  text-align: center;
  border-top: 6px solid #999;
  animation: rc-pop 0.18s ease-out;
}

@keyframes rc-pop {
  from { transform: translateY(6px) scale(0.98); opacity: 0.6; }
  to   { transform: none; opacity: 1; }
}

.rc-modal__icon  { width: 64px; height: 64px; margin: 6px auto 10px; }
.rc-modal__title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; font-family: "Poppins", sans-serif; }
.rc-modal__desc  { margin: 0 0 14px; line-height: 1.45; }

.rc-modal__close {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

.rc-modal--success .rc-modal__box { border-top-color: #16a34a; }
.rc-modal--error   .rc-modal__box { border-top-color: #dc2626; }
.rc-modal--warn    .rc-modal__box { border-top-color: #f59e0b; }

.rc-modal--success .rc-modal__close { background: #16a34a; color: #fff; }
.rc-modal--error   .rc-modal__close { background: #dc2626; color: #fff; }
.rc-modal--warn    .rc-modal__close { background: #f59e0b; color: #1c1c1c; }

@media (prefers-reduced-motion: reduce) {
  .rc-modal__box { animation: none; }
}

/* ---------------------------------------------------------------------------
   RESPONSIVO
   --------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .form-section {
    flex-direction: column;
    padding: 40px 20px;
    gap: 30px;
  }

  .form-left,
  .form-right {
    padding: 0;
    width: 100%;
  }

  .form-left h2 {
    font-size: 36px;
    max-width: 100%;
  }

  .form-left p {
    font-size: 18px;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .form-section {
    padding: 30px 24px;
    gap: 20px;
    margin: 0;
    border-radius: 0;
  }

  .form-left h2 {
    font-weight: 600;
    font-size: 24px;
    line-height: 124%;
    text-align: center;
    margin-bottom: 16px;
  }

  .form-left p {
    font-weight: 400;
    font-size: 17px;
    text-align: center;
    max-width: 100% !important;
    line-height: 26px;
    margin-bottom: 12px;
  }

  /* A letra dos campos NUNCA desce dos 16px em telemovel */

  .form-submit {
    font-size: 16px;
    line-height: 120%;
    font-weight: 600;
    padding: 12px 20px;
    width: 100%;
  }

  .texto3-original {
    display: none;
  }

  .texto3-mobile {
    display: block;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    font-style: italic;
    opacity: 0.9;
  }
}
