/* =========
   CRIAR PAGE
   ========= */

/*  O card que recebe a faixa */
.home-card {
  position: relative;
  overflow: hidden; /* recorta a faixa no radius */
  padding-top: 5px;
  padding-bottom: 20px; /* evita “linha branca” abaixo da faixa */
}

/*  Faixa vinho (única) */
.home-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(90deg, #7b162f, #a8324a);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  z-index: 1;
}

/*  Conteúdo acima da faixa */
.home-card > * {
  position: relative;
  z-index: 2;
}

/* Header do topo (ícone + título) */
.criar-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-top: 15px;
}

.criar-header__icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  margin-top: 4px;
}

.criar-header__text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.helper-bullets {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.helper-bullets ul {
  margin: 0;
  padding-left: 18px;
}

.step-box {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  padding: 28px 22px 22px;
  margin-top: 16px;
  background: #fff;
}

body.theme-dark .step-box {
  border: 1px solid var(--border);
  background: #111827;
}

/* título sentado na borda, com a “quebra” da linha */
.step-box > .step-title {
  position: absolute;
  top: -12px;
  left: 22px;
  padding: 0 10px;
  background: #fff; /* “apaga” a linha atrás do texto */
  font-size: 14px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.65);
}

body.theme-dark .step-box > .step-title {
  background: #111827;
  color: var(--text);
}

/* ==========================
   PASSO 1 (CPF + BOTÃO)
   ========================== */

.criar-row-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: center;
}

/* garante que o bloco do input ocupe tudo */
.criar-row-inline .cpf-field {
  width: 100%;
}

/* garante input 100% e altura igual ao botão */
.criar-row-inline .cpf-field input,
.criar-row-inline #cpf {
  width: 100%;
  max-width: 100% !important;
  min-width: 0;
  height: 52px;
  box-sizing: border-box;
  padding: 0 16px;
}

/* botão com mesma altura, largura e alinhamento */
.criar-row-inline .btn-search {
  width: 100%;
  height: 52px;
  box-sizing: border-box;
}

@media (max-width: 620px) {
  .criar-header__text h1 {
    font-size: 22px;
  }
  .helper-bullets {
    font-size: 12px;
  }
}

.btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

/* Mobile */
@media (max-width: 860px) {
  .criar-row-inline {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .btn-search {
    width: 100%;
  }
}

/* ==========================
   DADOS ENCONTRADOS
   ========================== */

.dados-encontrados {
  background: #f9fafb; /* leve cinza institucional */
  border: 1px solid #fafafa;
  border-radius: 12px;
  padding: 16px;
}

body.theme-dark .dados-encontrados {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dados-encontrados__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dados-title {
  margin: 0;
  font-weight: 700;
}

.btn-corrigir {
  min-width: 140px;
  height: 40px;
  border-radius: 10px;
}

.dados-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.dados-grid p {
  margin: 0;
  font-size: 12.5px;
}

.dados-grid strong {
  display: inline-block;
  min-width: 0;
  margin-right: 6px;
}

@media (max-width: 640px) {
  .dados-grid {
    gap: 8px;
  }
}

/* ==========================
   PASSO 2 (CAPTCHA)
   ========================== */

.passo-2 {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* grid do passo 2 */
.row-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

/* Captcha */
.captcha-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.captcha-card {
  width: 100%;
  max-width: 360px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.captcha-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  display: block;
  user-select: none;
  cursor: default;
}

.captcha-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.captcha-icon {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.captcha-icon img {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.captcha-icon:hover img {
  opacity: 1;
}

.captcha-hint {
  color: var(--muted);
  font-size: 12px;
}

/* Coluna direita do captcha (input + botão) */
.captcha-right {
  display: grid;
  gap: 14px;
  align-content: start;
  width: 100%;
  justify-self: end; /* cola na direita */
  margin-top: 12px; /* desce pra alinhar com o captcha (ajuste fino) */
}

.captcha-right #captcha {
  margin-top: 18px; /* testa 12px, 18px, 24px */
}

/* input do captcha e botão com alturas consistentes */
#captcha {
  height: 52px;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}

.btn-gerar {
  height: 52px;
  width: 100%;
  max-width: 380px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Voltar centralizado */
.actions-bottom {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* util */
.is-hidden {
  display: none !important;
}

/* acessibilidade */
.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;
}

.field-error {
  margin: 0; /* <-- tira o empurrão */
  min-height: 16px; /* reserva espaço */
  line-height: 1.2;
}

.criar-row-inline .btn-search {
  margin-bottom: 0;
}

.btn-gerar .btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

#passo-2-title {
  margin-top: 18px;
}
.captcha-right .btn-gerar {
  margin-top: 0; /* ajusta aqui: 12px, 16px, 24px… */
}

.download-wrapper {
  margin-top: 16px; /* ajusta aqui */
}

.actions-bottom {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* Botão Voltar à direita */
.actions-bottom.actions-right {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

/* Estilo específico do botão Voltar */
.btn-voltar {
  width: 187px;
  height: 59px;
  padding: 0 18px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid #65262f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
}

body.theme-dark .btn-voltar {
  background: #111827;
  border: 2px solid var(--border);
  color: var(--wine-2);
}

/* Ícone do botão Voltar */
.btn-voltar .btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.9;
}

/* =====================
   MODAL (estilo TJAC)
   ===================== */

/* overlay escuro por trás */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 9999;
}

/* card branco */
.modal-card {
  position: relative;
  width: min(760px, 92vw);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  padding: 22px 22px 18px;
}

/* botão X */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  cursor: pointer;

  display: grid;
  place-items: center;

  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: rgba(0, 0, 0, 0.55);
}

.modal-close:hover {
  filter: brightness(0.98);
}

/* “Atenção” */
.modal-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.45);
}

/* título */
.modal-title {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.82);
}

/* corpo do texto */
.modal-body p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.55);
}

.modal-body strong {
  color: rgba(0, 0, 0, 0.7);
  font-weight: 800;
}

.muted {
  color: rgba(0, 0, 0, 0.45);
}

/* área dos botões */
.modal-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* base botão */
.modal-actions .btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
}

/* cores iguais ao print (vinho) */
.modal-actions .btn-outline {
  background: #fff;
  border-color: #6f2f2f;
  color: #6f2f2f;
}

.modal-actions .btn-primary {
  background: #6f2f2f;
  border-color: #6f2f2f;
  color: #fff;
}

.modal-actions .btn-outline:hover,
.modal-actions .btn-primary:hover {
  filter: brightness(0.95);
}

/* responsivo: botões full width em telas menores */
@media (max-width: 520px) {
  .modal-card {
    width: 100%;
  }
  .modal-actions .btn {
    width: 100%;
  }
}
