/* ==========================================================================
   Formulário – Projeto de Empregabilidade Feminina (CAPREM)
   Cartão minimalista sobre fundo verde CAPREM. Temas claro (padrão da marca)
   e escuro. Cores do guia CAPREM: verde #1b7a41 · dourado #eec100.
   ========================================================================== */

:root,
html[data-tema="claro"] {
  color-scheme: light;
  --fundo-1: #1b7a41;           /* verde CAPREM */
  --fundo-2: #145c31;
  --bola: rgba(255, 255, 255, .10);
  --cartao: #ffffff;
  --linha: #d3d9d5;
  --linha-forte: #8f9a93;
  --texto: #17201a;
  --texto-suave: #69736c;
  --rotulo: #3b453e;
  --verde: #1b7a41;
  --verde-vivo: #1b7a41;
  --verde-fundo: rgba(27, 122, 65, .08);
  --dourado: #b38a00;
  --erro: #c0392b;
  --sombra: 0 24px 60px rgba(6, 40, 20, .28), 0 2px 6px rgba(6, 40, 20, .12);
}
html[data-tema="escuro"] {
  color-scheme: dark;
  --fundo-1: #0f1712;
  --fundo-2: #0a0f0c;
  --bola: rgba(43, 176, 101, .10);
  --cartao: #181c19;
  --linha: #333a35;
  --linha-forte: #5d6760;
  --texto: #eef1ef;
  --texto-suave: #9aa59e;
  --rotulo: #c3cbc6;
  --verde: #1b7a41;
  --verde-vivo: #2bb065;
  --verde-fundo: rgba(43, 176, 101, .12);
  --dourado: #eec100;
  --erro: #ff6b5e;
  --sombra: 0 24px 60px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: linear-gradient(180deg, var(--fundo-1) 0%, var(--fundo-2) 100%) fixed;
  color: var(--texto);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 12px calc(24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
h1, h2, p { margin: 0; }
a { color: var(--verde-vivo); }

/* ----------------------------- Decoração (círculos) ----------------------------- */
.decoracao { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bola { position: absolute; border-radius: 50%; background: var(--bola); }
.b1 { width: 340px; height: 340px; top: -120px; right: -110px; }
.b2 { width: 220px; height: 220px; bottom: 8%; left: -90px; }
.b3 { width: 120px; height: 120px; top: 42%; right: -40px; }

/* ----------------------------- Topo do site ----------------------------- */
.topo-site {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 6px;
}
.logo { display: block; width: 118px; height: auto; }
.btn-tema {
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25);
  transition: background-color .2s, transform .3s;
}
.btn-tema:hover { background: rgba(255, 255, 255, .2); transform: rotate(15deg); }
.btn-tema:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-tema svg { width: 18px; height: 18px; }
/* no tema claro mostra a lua (ir para o escuro); no escuro, o sol */
.btn-tema .ico-sol { display: none; }
html[data-tema="escuro"] .btn-tema .ico-sol { display: block; }
html[data-tema="escuro"] .btn-tema .ico-lua { display: none; }

/* ----------------------------- Cartão ----------------------------- */
.cartao {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  background: var(--cartao);
  border-radius: 24px;
  box-shadow: var(--sombra);
  padding: 34px 28px 32px;
  overflow: hidden;
  transition: background-color .3s ease;
}
.progresso { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--verde-fundo); }
.progresso span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--verde), var(--verde-vivo) 70%, var(--dourado));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.cartao-topo { text-align: center; margin-bottom: 30px; }
.ilustracao { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto 22px; color: var(--verde-vivo); }
.cartao-topo h1 {
  font-size: .78rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--texto-suave); margin-bottom: 8px;
}
.cartao-topo h1 span {
  display: block; margin-top: 6px;
  font-size: clamp(1.6rem, 6.6vw, 2rem); letter-spacing: -.02em; text-transform: none;
  font-weight: 800; color: var(--texto); line-height: 1.15;
}
.intro { color: var(--texto-suave); font-size: .97rem; max-width: 30em; margin: 12px auto 0; }

/* ----------------------------- Seções e campos ----------------------------- */
.secao {
  display: flex; align-items: center; gap: 12px;
  font-size: .74rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--verde-vivo); margin: 34px 0 20px;
}
.secao::after { content: ""; flex: 1; height: 1px; background: var(--linha); }
.formulario > .secao:first-of-type { margin-top: 4px; }

.campo { position: relative; margin: 0 0 24px; border: 0; padding: 0; min-width: 0; }
.campo > label:not(.anexo):not(.aceite), fieldset.campo legend, .legenda {
  display: block; padding: 0; margin-bottom: 6px;
  font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rotulo);
}
fieldset.campo legend, .legenda { margin-bottom: 12px; }
em { font-style: normal; font-weight: 500; letter-spacing: .04em; text-transform: none; font-size: .95em; color: var(--texto-suave); margin-left: 6px; }

.campo input[type=text], .campo input[type=tel], .campo input[type=email] {
  width: 100%; display: block;
  padding: 8px 0 9px;
  font: inherit; font-size: 1.06rem; color: var(--texto);
  background: transparent; border: 0; border-radius: 0;
  border-bottom: 1.5px solid var(--linha-forte);
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .25s, box-shadow .25s;
}
.campo input::placeholder { color: var(--linha-forte); opacity: 1; }
.campo input:focus { border-bottom-color: var(--verde-vivo); box-shadow: 0 1.5px 0 0 var(--verde-vivo); }
.campo input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--cartao) inset; -webkit-text-fill-color: var(--texto); }

.linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

/* ----------------------------- Chips (opções) ----------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--linha); background: transparent;
  color: var(--texto); font-size: .9rem; line-height: 1.3; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, background-color .2s, color .2s, transform .12s;
}
.chip:hover { border-color: var(--linha-forte); }
.chip:active { transform: scale(.97); }
.chip-input:checked + .chip { border-color: var(--verde-vivo); background: var(--verde-fundo); color: var(--verde-vivo); font-weight: 600; }
.chip-input:checked + .chip::before {
  content: ""; width: 13px; height: 13px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: aparecer .25s ease;
}
.chip-input:focus-visible + .chip { outline: 2px solid var(--verde-vivo); outline-offset: 2px; }
.revela { margin: 18px 0 0; animation: deslizar .35s cubic-bezier(.2, .8, .2, 1); }

/* ----------------------------- Anexo ----------------------------- */
.anexo-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.anexo {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed var(--linha-forte);
  transition: border-color .2s, background-color .2s;
}
.anexo:hover, .anexo-input:focus-visible + .anexo { border-color: var(--verde-vivo); background: var(--verde-fundo); }
.anexo svg { width: 22px; height: 22px; flex: none; color: var(--verde-vivo); }
.anexo-texto { display: flex; flex-direction: column; min-width: 0; }
.anexo-texto strong { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo-texto small { color: var(--texto-suave); font-size: .8rem; }
.anexo.com-arquivo { border-style: solid; border-color: var(--verde-vivo); background: var(--verde-fundo); }
.anexo-remover {
  margin-top: 6px; padding: 4px 0; background: none; border: 0; cursor: pointer;
  color: var(--texto-suave); font: inherit; font-size: .82rem; text-decoration: underline;
}

/* ----------------------------- Termo LGPD ----------------------------- */
.termo { margin-bottom: 18px; }
.termo summary {
  cursor: pointer; color: var(--verde-vivo); font-weight: 600; font-size: .92rem; list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.termo summary::-webkit-details-marker { display: none; }
.termo summary::after { content: "›"; font-size: 1.3em; line-height: 1; transition: transform .25s; }
.termo[open] summary::after { transform: rotate(90deg); }
.termo-texto {
  margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--linha);
  font-size: .88rem; color: var(--texto-suave); animation: deslizar .3s ease;
}
.termo-texto p { margin-bottom: 10px; }
.termo-texto strong { color: var(--texto); }
.termo-texto .versao { font-size: .78rem; margin: 0; }

.aceite-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aceite { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .92rem; color: var(--texto); }
.aceite .caixa {
  width: 22px; height: 22px; flex: none; margin-top: 1px; border-radius: 6px;
  border: 1.5px solid var(--linha-forte); display: grid; place-items: center;
  transition: background-color .2s, border-color .2s;
}
.aceite .caixa svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s ease .05s; }
.aceite-input:checked + .aceite .caixa { background: var(--verde); border-color: var(--verde); }
.aceite-input:checked + .aceite .caixa svg { stroke-dashoffset: 0; }
.aceite-input:focus-visible + .aceite .caixa { outline: 2px solid var(--verde-vivo); outline-offset: 2px; }

/* ----------------------------- Botão ----------------------------- */
.acoes { text-align: center; margin-top: 30px; }
.btn-enviar {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 240px; padding: 15px 34px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--verde); color: #fff;
  font: inherit; font-size: .9rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(27, 122, 65, .32);
  transition: transform .15s, box-shadow .25s, background-color .25s;
}
.btn-enviar:hover { background: #20904c; box-shadow: 0 12px 28px rgba(27, 122, 65, .42); }
.btn-enviar:active { transform: scale(.98); }
.btn-enviar:focus-visible { outline: 3px solid var(--dourado); outline-offset: 3px; }
.btn-enviar .spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: girar .8s linear infinite;
}
.btn-enviar.enviando { cursor: wait; opacity: .9; }
.btn-enviar.enviando .spinner { display: block; }
.nota { margin-top: 12px; font-size: .78rem; color: var(--texto-suave); }

/* ----------------------------- Erros ----------------------------- */
.msg-erro { display: block; color: var(--erro); font-size: .82rem; margin-top: 6px; }
.msg-erro:empty { display: none; }
.campo.invalido input[type=text], .campo.invalido input[type=tel], .campo.invalido input[type=email] { border-bottom-color: var(--erro); }
.invalido .chip { border-color: var(--erro); border-style: dashed; }
.campo.invalido .anexo { border-color: var(--erro); }
.invalido .aceite .caixa { border-color: var(--erro); }
.campo.invalido { animation: tremer .35s ease; }
.aviso { padding: 12px 14px; border-radius: 12px; margin-bottom: 20px; font-size: .92rem; }
.aviso-erro { color: var(--erro); border: 1px solid var(--erro); background: rgba(192, 57, 43, .07); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ----------------------------- Confirmação ----------------------------- */
.confirmacao { text-align: center; padding: 6px 4px 8px; animation: deslizar .5s cubic-bezier(.2, .8, .2, 1); }
.confirmacao h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 16px 0 10px; }
.confirmacao p { color: var(--texto-suave); max-width: 30em; margin: 0 auto; }
.check { width: 80px; height: 80px; }
.check-circulo { stroke: var(--verde-vivo); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: desenhar .7s cubic-bezier(.65, 0, .45, 1) forwards; }
.check-marca { stroke: var(--verde-vivo); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: desenhar .4s cubic-bezier(.65, 0, .45, 1) .6s forwards; }
/* depois de enviar, esconde o texto de apresentação para destacar a confirmação */
.cartao.enviado .intro { display: none; }

.rodape { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, .7); font-size: .78rem; margin-top: 22px; }

/* ----------------------------- Animações ----------------------------- */
html.js .anima { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
html.js .anima.visivel { opacity: 1; transform: none; }
@keyframes desenhar { to { stroke-dashoffset: 0; } }
@keyframes deslizar { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes aparecer { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes tremer { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html.js .anima { opacity: 1; transform: none; }
}

/* ----------------------------- Tamanhos de tela ----------------------------- */
@media (min-width: 640px) {
  body { padding-top: 12px; }
  .cartao { padding: 44px 52px 40px; }
  .logo { width: 132px; }
}
@media (max-width: 400px) {
  .cartao { padding: 28px 20px 26px; border-radius: 20px; }
  .linha-2 { grid-template-columns: 1fr; }
  .btn-enviar { width: 100%; min-width: 0; }
}

/* ==========================================================================
   Etapas (celular) e cartão largo em duas colunas (computador)
   ========================================================================== */

/* Por padrão (sem JS ou no computador): tudo visível, sem controles de etapa */
.etapas, .nav-etapa, .so-etapas { display: none; }

/* ---------- Celular e tablet em pé: formulário por etapas ---------- */
@media (max-width: 899px) {
  html.js .etapa { display: none; }
  html.js .etapa.ativa { display: block; animation: deslizar .35s cubic-bezier(.2, .8, .2, 1); }
  html.js .etapa.voltando { animation-name: deslizarVolta; }

  html.js .etapas {
    display: flex; justify-content: space-between; position: relative;
    list-style: none; margin: 0 0 26px; padding: 0;
  }
  html.js .etapas::before {           /* trilho entre os números */
    content: ""; position: absolute; top: 14px; left: 12%; right: 12%; height: 2px; background: var(--linha);
  }
  html.js .etapas li {
    position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: default;
  }
  html.js .etapas li span {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    font-size: .8rem; font-weight: 700; color: var(--texto-suave);
    background: var(--cartao); border: 1.5px solid var(--linha);
    transition: background-color .3s, border-color .3s, color .3s, transform .3s;
  }
  html.js .etapas li small { font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-suave); }
  html.js .etapas li.feita { cursor: pointer; }
  html.js .etapas li.feita span { background: var(--verde-fundo); border-color: var(--verde-vivo); color: var(--verde-vivo); }
  html.js .etapas li.atual span { background: var(--verde); border-color: var(--verde); color: #fff; transform: scale(1.08); }
  html.js .etapas li.atual small { color: var(--texto); }

  html.js .nav-etapa { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
  html.js .so-etapas { display: inline-flex; }

  .btn-continuar {
    margin-left: auto; padding: 13px 28px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--verde); color: #fff; font: inherit; font-size: .85rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 8px 20px rgba(27, 122, 65, .28);
    transition: transform .15s, background-color .25s;
  }
  .btn-continuar:active { transform: scale(.97); }
  .btn-continuar:focus-visible { outline: 3px solid var(--dourado); outline-offset: 3px; }
  .btn-voltar {
    padding: 12px 6px; border: 0; background: none; cursor: pointer;
    color: var(--texto-suave); font: inherit; font-size: .9rem; font-weight: 600;
  }
  .btn-voltar:hover { color: var(--texto); }

  /* Na última etapa: Voltar à esquerda, Enviar à direita */
  html.js .acoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
  html.js .acoes .btn-enviar { min-width: 0; flex: 1 1 auto; max-width: 260px; margin-left: auto; }
  html.js .acoes .nota { flex-basis: 100%; text-align: center; }

  /* Da 2ª etapa em diante, recolhe a ilustração e o texto para sobrar tela */
  html.js .cartao.passo-avancado .cartao-topo .ilustracao,
  html.js .cartao.passo-avancado .cartao-topo .intro { display: none; }
  html.js .cartao.passo-avancado .cartao-topo { margin-bottom: 20px; }
  html.js .cartao.passo-avancado .cartao-topo h1 span { font-size: 1.25rem; }
}
@media (max-width: 400px) {
  html.js .acoes .btn-enviar { width: auto; max-width: none; }
}
@keyframes deslizarVolta { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

/* ---------- Computador: cartão largo, duas colunas ---------- */
@media (min-width: 900px) {
  .topo-site { max-width: 1040px; padding: 28px 8px 26px; }
  .cartao {
    max-width: 1040px; padding: 0;
    display: grid; grid-template-columns: minmax(300px, 38%) 1fr; align-items: stretch;
  }
  .cartao-topo {
    margin: 0; padding: 56px 40px; text-align: left;
    background: var(--verde-fundo);
    border-right: 1px solid var(--linha);
  }
  .lado-fixo { position: -webkit-sticky; position: sticky; top: 32px; }
  .cartao { overflow: visible; }
  .progresso { border-radius: 24px 24px 0 0; overflow: hidden; }
  .cartao-topo { border-radius: 24px 0 0 24px; }
  .cartao-topo .ilustracao { margin: 0 0 30px; max-width: 100%; }
  .cartao-topo h1 span { font-size: 2.1rem; }
  .cartao-topo .intro { margin: 14px 0 0; font-size: 1rem; }
  .cartao-conteudo { padding: 52px 56px 48px; min-width: 0; }
  .acoes { text-align: left; }
  .nota { text-align: left; }
  .confirmacao { padding-top: 40px; }
}
@media (min-width: 1280px) {
  .cartao-conteudo { padding: 56px 72px 52px; }
}
