/* =========================================================
   CDL Itabira · 14º Mérito Lojista — Formulário de votação
   Visual baseado no Jotform original (referência do cliente).
   ========================================================= */
:root {
  --bg-navy:   #0b2444;          /* fundo azul-marinho externo */
  --bg-navy-2: #08203c;
  --card:      #ffffff;          /* cartão branco interno */
  --ink:       #1b2a39;          /* texto principal */
  --ink-soft:  #45556b;          /* texto secundário */
  --teal:      #0c6e7a;          /* tom verde-petróleo dos títulos */
  --teal-2:    #0a5560;
  --teal-soft: #4d8a93;
  --warn:      #0c6e7a;
  --required:  #d44a4a;
  --field-bg:  #f6fbfd;          /* fundo levemente azulado dos inputs */
  --field-bd:  #c9d6dc;
  --field-bd-hi: var(--teal);
  --err:       #c0392b;
  --ok:        #1f8a5b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* O atributo HTML `hidden` precisa vencer regras de `display` em classes.
   Sem isto, .error-banner { display: flex } sobrescreve o `hidden`. */
[hidden] { display: none !important; }

html, body { background: var(--bg-navy); color: var(--ink); }
body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-navy);
  min-height: 100vh;
}

/* ------------ Layout geral ------------ */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 40px) 56px;
}

/* ------------ Hero / banner ------------ */
.hero {
  text-align: center;
  margin-bottom: 28px;
}
.hero img {
  display: block;
  margin: 0 auto;
  width: min(520px, 100%);
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* ------------ Card branco interno ------------ */
.form-card {
  background: var(--card);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 64px);
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

/* ------------ Título dentro do card ------------ */
.title-block {
  text-align: center;
  margin-bottom: 28px;
}
.title-block h1 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: clamp(32px, 4.6vw, 44px);
  line-height: 1.15;
  color: var(--teal);
  letter-spacing: .005em;
}
.title-block .subtitle {
  margin-top: 8px;
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--teal-soft);
  font-weight: 400;
}

/* ------------ Texto de aviso/sigilo ------------ */
.warning-main {
  text-align: center;
  font-weight: 700;
  color: var(--teal);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.45;
  margin: 24px auto 28px;
  max-width: 640px;
}
.sigilo {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 32px;
  line-height: 1.55;
}
.sigilo b { color: var(--ink); }

/* ------------ Form fields ------------ */
.field {
  margin: 18px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Honeypot: invisível para humanos, mas presente para bots. */
.hp-wrap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field label {
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
}
.field .req { color: var(--required); margin-left: 2px; }
.field .hint {
  font-size: 14px;
  color: var(--ink-soft);
}
.field .err {
  font-size: 14px;
  color: var(--err);
  min-height: 0;
}
.field .err:not(:empty) { min-height: 1.2em; margin-top: 2px; }

input[type="text"], input[type="email"] {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-bd);
  border-radius: 4px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder { color: #99a7b2; }
input[type="text"]:focus, input[type="email"]:focus {
  border-color: var(--field-bd-hi);
  box-shadow: 0 0 0 3px rgba(12,110,122,.12);
}
input.invalid { border-color: var(--err); }

/* ------------ Bloco "Sua indicação" ------------ */
.intro-segmentos {
  margin: 36px 0 20px;
  padding-top: 24px;
  border-top: 1px solid #e6ecef;
}
.intro-segmentos h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--teal);
  margin-bottom: 10px;
}
.intro-segmentos p {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.intro-segmentos p + p { margin-top: 8px; }
.intro-segmentos b { color: var(--ink); }
.warn { color: var(--teal-2); }
.warn.small, .small { font-size: 14px; }
.dim { color: var(--ink-soft); }

/* ------------ Lista de segmentos (1 coluna, com respiro) ------------ */
.segmentos-grid {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin: 16px 0 8px;
}
.segmento-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Divisor antes da seção de distritos (IPOEMA, SENHORA DO CARMO, etc.) */
.segmento-item:not(.is-distrito) + .segmento-item.is-distrito {
  padding-top: 26px;
  margin-top: 8px;
  border-top: 1px solid #e6ecef;
}
.segmento-item .seg-label {
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
}
.segmento-item input {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-bd);
  border-radius: 4px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.segmento-item input:focus {
  border-color: var(--field-bd-hi);
  box-shadow: 0 0 0 3px rgba(12,110,122,.12);
}
.segmento-item input::placeholder { color: #99a7b2; }

/* ------------ Bairros / Regiões ------------ */
.bairros-section {
  margin: 36px 0 8px;
  padding-top: 24px;
  border-top: 1px solid #e6ecef;
}
.bairros-section h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--teal);
  margin-bottom: 8px;
}
.bairros-section .small.dim {
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.bairros-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bairro-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}
.bairro-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}
.bairro-item span { font-size: 15px; color: var(--ink); }

/* ------------ Botão / actions ------------ */
.actions {
  margin: 36px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.cf-turnstile { min-height: 65px; }
button[type="submit"] {
  font-family: "Source Sans 3", sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: none;
  font-size: 18px;
  padding: 16px 46px;
  border-radius: 6px;
  border: none;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
  transition: background-color .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 6px 18px rgba(12,110,122,.25);
}
button[type="submit"]:hover:not(:disabled) {
  background: var(--teal-2);
  transform: translateY(-1px);
}
button[type="submit"]:disabled {
  opacity: .65;
  cursor: progress;
}

.status { font-size: 15px; color: var(--ink-soft); min-height: 1.2em; text-align: center; }
.status.err { color: var(--err); }
.status.ok  { color: var(--ok); }

/* ------------ Banner de erro (topo do form) ------------ */
.error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fde7e7;
  border: 1px solid #f0a3a3;
  color: #8b1f1f;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.45;
}
.error-banner-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
}
.error-banner-text { flex: 1 1 auto; }

/* ------------ Tela de sucesso ------------ */
.success {
  text-align: center;
  padding: 8px 0 16px;
}
.success-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  color: var(--ok);
  animation: success-pop .5s cubic-bezier(.2,.7,.1,1.2);
}
.success-icon svg { width: 100%; height: 100%; }
@keyframes success-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.success h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 36px);
  color: var(--ok);
  margin-bottom: 14px;
  line-height: 1.2;
}
.success-lead {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
  max-width: 540px;
  margin: 0 auto 28px;
}
.success-lead b { color: var(--ink); }

.success-note {
  margin: 24px auto 8px;
  padding: 14px 20px;
  background: #fffbe8;
  border-left: 4px solid #d9b75c;
  color: #6b5a1c;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  max-width: 540px;
  border-radius: 4px;
}
.success-note b { color: #4a3e10; }

/* ------------ Rodapé ------------ */
.rodape {
  margin-top: 28px;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* =========================================================
   MOBILE: banner em largura total da tela
   ========================================================= */
@media (max-width: 720px) {
  .page {
    padding: 0 0 40px;
    max-width: 100%;
  }
  .hero {
    margin-bottom: 16px;
  }
  .hero img {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    display: block;
  }
  .form-card {
    margin: 0 12px;
    border-radius: 14px;
    padding: 28px 22px;
  }
  .rodape { margin-top: 20px; padding: 0 16px; }
  .title-block h1 { font-size: 30px; }
  .warning-main { font-size: 18px; margin: 18px auto 22px; }
  .sigilo { font-size: 15px; }
  .segmentos-grid { gap: 22px; }
  .intro-segmentos h2, .bairros-section h2 { font-size: 24px; }
  .success-icon { width: 72px; height: 72px; }
  .success-lead, .success-note { font-size: 15px; }
}
