/* =========================================================
   Parceria Teoriacuriosa | Grupo CCR
   Fundo branco · caixa do formulário #cc8f1c · texto #2f2f32 · Montserrat
   ========================================================= */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(assets/fonts/montserrat-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --branco: #ffffff;
  --grafite: #2f2f32;
  --ouro: #cc8f1c;
  --ouro-escuro: #8a5f0a;     /* ligações sobre fundo branco */
  --cinza: #5a5a5f;
  --erro: #8f1d1d;
  --raio-campo: 10px;
  --raio-caixa: 18px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--branco);
  color: var(--grafite);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 20px 40px;
}

/* ---------- Logo e texto ---------- */
.logo {
  display: block;
  width: clamp(170px, 34vw, 230px);
  height: auto;
  margin: 0 auto clamp(28px, 5vw, 48px);
}

.intro { text-align: center; }

.intro h1 {
  max-width: 24ch;
  margin: 0 auto 1.4rem;
  font-size: clamp(1.75rem, 4.8vw, 2.6rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.intro p {
  max-width: 54ch;
  margin: 0 auto 1.1rem;
  text-wrap: pretty;
}

.intro .intro__fecho { font-weight: 600; margin-bottom: 0; }

/* Computador: logo mais pequeno e texto mais largo. O telemóvel e o tablet ficam como estavam. */
@media (min-width: 900px) {
  .page { max-width: 1040px; }
  .logo { width: 160px; margin-bottom: 40px; }
  .intro h1 { max-width: 34ch; }
  .intro p { max-width: 84ch; }
  .caixa { max-width: 84ch; margin-left: auto; margin-right: auto; }   /* mesma largura do texto */
}

/* ---------- Caixa do formulário ---------- */
.caixa {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(32px, 5vw, 48px);
  padding: clamp(24px, 5vw, 40px);
  background: var(--ouro);
  border-radius: var(--raio-caixa);
}

/* Marca da Teoria, em branco translúcido, cortada no canto superior direito (zona vazia ao lado do título) */
.caixa::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -64px;
  right: -22px;
  width: 190px;
  height: 316px;
  background: url(assets/marca-agua.png) center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

.caixa h2 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 3.4vw, 1.75rem);
  line-height: 1.25;
  font-weight: 700;
}

.caixa__nota { margin: 0 0 24px; font-size: 0.9rem; font-weight: 500; }

form { display: grid; gap: 18px; }

.linha { display: grid; gap: 18px; }
@media (min-width: 640px) { .linha { grid-template-columns: 1fr 1fr; } }

label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 600; line-height: 1.4; }

input[type='text'],
input[type='tel'],
input[type='email'],
select {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;           /* 16px: evita o zoom automático no iPhone */
  color: var(--grafite);
  background: var(--branco);
  border: 2px solid transparent;
  border-radius: var(--raio-campo);
  appearance: none;
  -webkit-appearance: none;
}

input::placeholder { color: #6b6b70; opacity: 1; }

select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%232f2f32' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}
select:invalid { color: #6b6b70; }
select option { color: var(--grafite); }

input:focus-visible,
select:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--grafite);
  outline-offset: 2px;
}

.campo.has-error input:not([type='checkbox']),
.campo.has-error select { border-color: var(--erro); }

.erro {
  display: inline-block;
  margin: 6px 0 0;
  padding: 3px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--erro);
  background: var(--branco);
  border-radius: 8px;
}
.erro:empty { display: none; }

/* Honeypot */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Consentimentos ---------- */
.consentimentos { display: grid; gap: 14px; margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }

.consentimentos legend {
  margin: 0 0 10px;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
  cursor: pointer;
}

.check input {
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  background: var(--branco);
  border: 2px solid var(--grafite);
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.check input:checked {
  background: var(--grafite) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.check input:focus-visible { outline: 3px solid var(--grafite); outline-offset: 2px; }

.check a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.campo.has-error .check input { border-color: var(--erro); box-shadow: 0 0 0 2px var(--branco); }

/* ---------- Botão e estados ---------- */
.btn {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  padding: 0 28px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--branco);
  background: var(--grafite);
  border: 0;
  border-radius: var(--raio-campo);
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn:hover { background: #1b1b1d; }
.btn:disabled { cursor: progress; opacity: 0.85; }

.estado { margin: 0; min-height: 0; font-size: 0.9rem; font-weight: 600; }
.estado.is-error {
  padding: 8px 12px;
  color: var(--erro);
  background: var(--branco);
  border-radius: 8px;
}

.sucesso:focus { outline: none; }
.sucesso h2 { margin-bottom: 10px; }
.sucesso p { margin: 0; max-width: 46ch; }
.sucesso[hidden], #form-wrap[hidden] { display: none; }

/* ---------- Redes sociais (centradas, por cima do rodapé) ---------- */
/* Os ícones já trazem a sombra no próprio ficheiro, por isso têm margem transparente à volta do botão. */
.redes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 36px;
}
.redes a {
  display: block;
  margin: 0 -4px;
  border-radius: 16px;
  transition: transform 0.15s ease;
}
.redes a:hover { transform: translateY(-2px); }
.redes img { display: block; width: 66px; height: auto; }
.redes + .rodape { margin-top: 4px; }
@media (max-width: 340px) { .redes img { width: 56px; } }

/* ---------- Rodapé ---------- */
.rodape {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--cinza);
}
.rodape a { color: var(--ouro-escuro); text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
