/* Renda no Bairro — estilos do site de cadastro */

:root {
  --bg: #F6F2EA;
  --surface: #FFFFFF;
  --ink: #1C1A15;
  --ink-2: #3E3A32;
  --muted: #5A554B;
  --placeholder: #8A8375;
  --line: #DDD5C6;
  --field: #CFC6B5;
  --green: #1E6B47;
  --green-dark: #155235;
  --green-deeper: #0E3A25;
  --green-soft: #E3EFE7;
  --yellow: #F4C542;
  --yellow-soft: #FBEBB5;
  --yellow-ink: #5C4600;
  --sand: #EDE7DB;
  --sand-2: #E4DDCF;
  --error: #B42318;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --content: 880px;
  --gutter: 80px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--green-dark); }
a:hover { color: var(--green-deeper); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  height: 76px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px; letter-spacing: -0.3px;
}

.nav { display: flex; gap: 32px; font-size: 16px; font-weight: 600; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--green-dark); }
.nav a.nav-cta { color: var(--green-dark); }

.menu-toggle {
  display: none;
  width: 44px; height: 44px; border: none; background: transparent;
  align-items: center; justify-content: center; cursor: pointer;
}

/* Stepper (cadastro) */
.stepper {
  display: flex; align-items: center; gap: 10px; list-style: none;
  margin: 0; padding: 0;
  font-size: 15px; font-weight: 600; color: var(--muted);
}
.stepper li { display: flex; align-items: center; gap: 10px; }
.stepper li + li::before {
  content: ""; width: 16px; height: 16px;
  background: no-repeat center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8375' stroke-width='2'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
}
.step { padding: 6px 12px; border-radius: 999px; background: var(--sand); }
.step.is-done { background: var(--green-soft); color: var(--green-dark); }
.step.is-current { background: var(--green); color: #fff; }

/* ---------- Layout ---------- */
main {
  flex-grow: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 56px var(--gutter) 64px;
  gap: 40px;
}
.page-cadastro main { padding-top: 48px; gap: 24px; }
.page-enviado main { padding-top: 72px; gap: 32px; }

.content { width: 100%; max-width: var(--content); }

/* ---------- Hero ---------- */
.hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; max-width: 900px; text-align: center;
}
.badge {
  display: inline-flex; padding: 6px 14px; border-radius: 999px;
  background: var(--yellow-soft); color: var(--yellow-ink);
  font-size: 14px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
h1, h2 { font-family: var(--font-display); margin: 0; }
.hero h1 {
  font-weight: 800; font-size: 60px; line-height: 1.02; letter-spacing: -1.5px;
}
.lead { margin: 0; font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 720px; }

/* ---------- Vídeo ---------- */
.video-wrap { width: 100%; max-width: var(--content); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.video {
  width: 100%; max-width: 390px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  background: var(--ink);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 50px rgba(28, 26, 21, 0.18);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video img { width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: rgba(0, 0, 0, .18); cursor: pointer;
}
.video-play span {
  width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}
.video-play:hover span { transform: scale(1.05); }
.video-source { font-size: 15px; font-weight: 600; }

/* ---------- Cards / formulários ---------- */
.card {
  width: 100%; max-width: var(--content);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex; flex-direction: column; gap: 20px;
}
.card h2 { font-weight: 600; font-size: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hint { margin: 0; font-size: 15px; color: var(--muted); }

/* Busca de CNPJ */
.search { gap: 14px; }
.search-label { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.search-row { display: flex; gap: 12px; }
.search-field {
  flex-grow: 1; height: 64px;
  border: 2px solid var(--green); border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--surface);
}
.search-field:focus-within { box-shadow: 0 0 0 4px var(--green-soft); }
.search-field input {
  flex-grow: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 24px; letter-spacing: 1px; color: var(--ink);
}
.search-field.has-error { border-color: var(--error); }
.field-error { color: var(--error); font-size: 15px; font-weight: 600; margin: 0; }

.btn {
  height: 64px; padding: 0 36px; border-radius: var(--radius);
  background: var(--green); color: #fff; border: none;
  font-family: var(--font-body); font-size: 19px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-md { height: 60px; padding: 0 40px; }
.btn-outline {
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--green); color: var(--green-dark); background: transparent;
  font-weight: 700; display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap;
}
.btn-outline:hover { background: var(--green-soft); }

/* Como funciona */
.steps {
  width: 100%; max-width: var(--content);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  list-style: none; margin: 0; padding: 0;
}
.steps li { display: flex; flex-direction: column; gap: 8px; }
.steps .num { font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--green); line-height: 1; }
.steps .title { font-weight: 700; font-size: 18px; }
.steps .desc { font-size: 16px; color: var(--muted); }
.how-intro { display: flex; flex-direction: column; gap: 12px; }
.how-intro .badge { align-self: flex-start; }
.how-intro h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.08; }
.how-steps { padding: 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.how-docs p { margin: 0; font-size: 17px; color: var(--ink-2); }
.how-docs .btn { align-self: flex-start; }

/* Dados da Receita */
.pill-ok {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; background: var(--green-soft); color: var(--green-dark);
  font-size: 15px; font-weight: 700;
}
.pill-error { background: #FDEAE8; color: var(--error); }
.data-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 32px; margin: 0;
}
.data-grid div { display: flex; flex-direction: column; gap: 2px; }
.data-grid dt { font-size: 14px; color: var(--muted); font-weight: 600; }
.data-grid dd { margin: 0; }

/* Campos */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-legend { font-size: 15px; font-weight: 700; }
.input, .select, .textarea {
  width: 100%; height: 52px;
  border: 1.5px solid var(--field); border-radius: 12px;
  padding: 0 14px; font-size: 17px; font-family: var(--font-body);
  background: var(--surface); color: var(--ink);
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--error); }

/* Chips de área de atuação (radios) */
fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center;
  font-size: 16px; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--field);
}
.chip span:hover { border-color: var(--green); }
.chip input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.chip input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Upload */
.uploads { display: flex; flex-direction: column; gap: 10px; }
.upload {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border: 1.5px dashed var(--field); border-radius: var(--radius);
}
.upload.is-filled { border-style: solid; border-color: var(--green); background: #F7FBF8; }
.upload-title { font-weight: 700; font-size: 17px; }
.upload-meta { font-size: 14px; color: var(--muted); word-break: break-all; }
.upload input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Rodapé do formulário */
.form-end { width: 100%; max-width: var(--content); display: flex; flex-direction: column; gap: 20px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; color: var(--ink-2); }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); flex-shrink: 0; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.actions .back { font-size: 17px; font-weight: 600; }

/* ---------- Enviado ---------- */
.success-icon {
  width: 88px; height: 88px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.page-enviado .hero h1 { font-size: 52px; letter-spacing: -1.2px; }
.protocol {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 36px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.protocol-label { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.protocol-number { font-family: var(--font-display); font-weight: 600; font-size: 32px; letter-spacing: 1px; }
.protocol-number { overflow-wrap: anywhere; text-align: center; }
.page-acompanhar h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; }
.page-acompanhar .content { display: flex; flex-direction: column; gap: 12px; }
.page-acompanhar .search-row .input { flex: 1; min-width: 0; height: 64px; }
.timeline {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  list-style: none; margin: 0; padding: 0;
}
.timeline li { display: flex; flex-direction: column; gap: 10px; }
.timeline .bar { height: 6px; border-radius: 3px; background: var(--sand-2); }
.timeline .is-done .bar { background: var(--green); }
.timeline .is-current .bar { background: var(--yellow); }
.timeline .t-title { font-weight: 700; font-size: 17px; }
.timeline .is-done .t-title { color: var(--green-dark); }
.timeline .t-desc { font-size: 15px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  min-height: 72px; padding: 20px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: #CFC8B8; font-size: 14px;
}
.site-footer a { color: #fff; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  :root { --gutter: 32px; }
  .hero h1 { font-size: 48px; }
  .stepper .step-label { display: none; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .site-header { height: 64px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-name { font-size: 19px; }

  .menu-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0; z-index: 10;
    flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 16px; border-top: 1px solid var(--line); }

  .stepper { font-size: 13px; gap: 6px; }
  .stepper li { gap: 6px; }
  .stepper li + li::before { width: 12px; height: 12px; background-size: 12px; }
  .step { padding: 5px 9px; }

  main { padding: 28px var(--gutter) 40px; gap: 24px; align-items: stretch; }
  .page-enviado main { padding-top: 40px; align-items: center; }

  .hero { align-items: flex-start; text-align: left; gap: 10px; }
  .page-enviado .hero { align-items: center; text-align: center; }
  .badge { font-size: 13px; padding: 5px 12px; }
  .hero h1 { font-size: 36px; line-height: 1.05; letter-spacing: -0.8px; }
  .page-enviado .hero h1 { font-size: 36px; }
  .lead { font-size: 17px; }

  .video { border-radius: 18px; }
  .video-play span { width: 68px; height: 68px; }

  .card { padding: 20px; border-radius: 18px; }
  .card h2 { font-size: 21px; }
  .search-label { font-size: 20px; }
  .search-row { flex-direction: column; }
  .search-field { height: 58px; padding: 0 16px; }
  .search-field input { font-size: 21px; }
  .btn { height: 58px; font-size: 18px; width: 100%; }

  .steps, .timeline { grid-template-columns: 1fr; gap: 16px; }
  .how-steps { padding: 20px; }
  .how-docs .btn { align-self: stretch; }
  .data-grid, .fields { grid-template-columns: 1fr; gap: 14px; }

  .upload { flex-direction: column; align-items: stretch; }
  .btn-outline { justify-content: center; }

  .actions { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .protocol { padding: 16px 24px; }
  .protocol-number { font-size: 26px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
