/* ============================================================================
 *  modal-cadastro-inicial.css
 * ----------------------------------------------------------------------------
 *  #cw-modal-root fica FORA de #customware-root, então as classes da app
 *  (.field, .form-grid-*, .btn, estilos automáticos de input/select, etc.)
 *  não alcançam o modal. Aqui replicamos esses estilos re-escopados em
 *  #cw-modal-root, espelhando assets/css/global.css e telas/perfil/peril-vars.css,
 *  e ajustando para o modal ser confortável de ver/clicar no desktop e no mobile.
 * ========================================================================== */

/* ──────────────────────────────────────────────────────────────
   ISOLAMENTO — #cw-modal-root vive FORA de #customware-root, então o CSS do
   tema e do WordPress core cascateia aqui. Este bloco neutraliza o que o tema/WP
   costumam impor (margens de h*/p, estilos de button/a/input, listas, etc.) ANTES
   das nossas regras. Tudo é escopado em `#cw-modal-root` (especificidade alta),
   então também não vaza nada deste arquivo para fora do modal.
   ────────────────────────────────────────────────────────────── */
#cw-modal-root,
#cw-modal-root *,
#cw-modal-root *::before,
#cw-modal-root *::after {
  box-sizing: border-box;
}
#cw-modal-root h1, #cw-modal-root h2, #cw-modal-root h3, #cw-modal-root h4, #cw-modal-root h5, #cw-modal-root h6,
#cw-modal-root p, #cw-modal-root figure, #cw-modal-root blockquote, #cw-modal-root dl, #cw-modal-root dd, #cw-modal-root ul, #cw-modal-root ol {
  margin: 0;
  padding: 0;
}
#cw-modal-root h1, #cw-modal-root h2, #cw-modal-root h3, #cw-modal-root h4, #cw-modal-root h5, #cw-modal-root h6 {
  font: inherit;
  color: inherit;
}
#cw-modal-root ul, #cw-modal-root ol { list-style: none; }
#cw-modal-root a { color: inherit; text-decoration: none; background: transparent; }
#cw-modal-root button {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
  text-align: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
}
#cw-modal-root input, #cw-modal-root select, #cw-modal-root textarea {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
  line-height: normal;
  background: transparent;
}
#cw-modal-root img, #cw-modal-root video { max-width: 100%; height: auto; display: block; }
/* SVGs dos ícones (×, +) — defesa extra; o tamanho/cor reais vêm de style inline no próprio <svg> */
#cw-modal-root svg {
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  overflow: visible;
  pointer-events: none;
}
#cw-modal-root svg line,
#cw-modal-root svg path,
#cw-modal-root svg polyline,
#cw-modal-root svg circle {
  fill: none;
  stroke: currentColor;
}

#cw-modal-root {
  /* Tokens de design (mesmos valores de peril-vars.css) */
  --primaria:   #08344c;
  --destaque:   #FEBD0D;
  --success:    #22c55e;
  --text-1:     #f0f4f8;
  --text-2:     #b8c9d9;
  --text-3:     #6b8fa8;
  --border:     rgba(255,255,255,0.10);
  --surface-2:  rgba(255,255,255,0.05);
  --ease-out:   cubic-bezier(0.22, 0.61, 0.36, 1);

  font-family: "AmsiPro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ──────────────────────────────────────────────────────────────
   Overlay + caixa do modal
   ────────────────────────────────────────────────────────────── */
#cw-modal-root .cwci-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow-y: auto;          /* se a caixa for maior que a tela, rola o overlay */
}
#cw-modal-root .cwci-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  box-sizing: border-box;
  padding: 28px 32px;
  border-radius: 18px;
  background: rgba(8, 52, 76, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  color: var(--text-1);
}

#cw-modal-root .cwci-titulo {
  margin: 0 0 4px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-1);
}
#cw-modal-root .cwci-subtitulo {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--destaque);
}

/* Indicador de progresso (bolinhas) */
#cw-modal-root .cwci-dots {
  display: flex;
  gap: 7px;
  margin-bottom: 22px;
}
#cw-modal-root .cwci-dot {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 220ms;
}
#cw-modal-root .cwci-dot.on { background: var(--destaque); }

/* Área de conteúdo (rola se passar da altura disponível) */
#cw-modal-root .cwci-content {
  flex: 1 1 auto;
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;        /* respiro p/ a scrollbar não colar nos campos */
}

/* Cabeçalho do passo (título grande + descrição) */
#cw-modal-root .cwci-step-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-1);
}

/* Texto de ajuda do passo — descreve o dado que está sendo inserido */
#cw-modal-root .cwci-help {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
}
#cw-modal-root .cwci-help strong {
  color: var(--text-1);
  font-weight: 700;
}

/* Contador de caracteres do nome (passo 2) — fica vermelho quando passa do limite */
#cw-modal-root .opt.cwci-over {
  color: #FCA5A5;
  font-weight: 700;
}

/* Aviso (amarelo) — nome longo demais, senha curta, etc. */
#cw-modal-root .cwci-warn {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -4px 0 16px;
  padding: 11px 13px;
  background: rgba(254, 189, 13, 0.10);
  border: 1px solid rgba(254, 189, 13, 0.30);
  color: #FBD96B;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  border-radius: 10px;
}
/* Variante "erro forte" — bem em evidência (passo 8: senhas não conferem) */
#cw-modal-root .cwci-warn.cwci-warn-erro {
  margin: 6px 0 16px;
  padding: 13px 16px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.50);
  color: #FCA5A5;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
  animation: cwci-shake 380ms ease;
}
@keyframes cwci-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px); }
  38% { transform: translateX(5px); }
  58% { transform: translateX(-3px); }
  78% { transform: translateX(3px); }
}
/* Input em estado de erro — borda vermelha (passo 8: campo "Confirmar nova senha").
   `!important` para vencer a regra :focus dos inputs (borda dourada), independente da ordem. */
#cw-modal-root .cwci-input-erro,
#cw-modal-root .cwci-input-erro:hover,
#cw-modal-root .cwci-input-erro:focus {
  border-color: rgba(239, 68, 68, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
}

/* Sugestões de nome abreviado (passo 2) */
#cw-modal-root .cwci-sugestoes { margin-top: 4px; }
#cw-modal-root .cwci-sugestoes-titulo {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
#cw-modal-root .cwci-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#cw-modal-root .cwci-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
#cw-modal-root .cwci-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
}
#cw-modal-root .cwci-chip.active {
  background: rgba(254, 189, 13, 0.12);
  border-color: rgba(254, 189, 13, 0.40);
  color: var(--destaque);
}
#cw-modal-root .cwci-chip-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cw-modal-root .cwci-chip-len {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}
#cw-modal-root .cwci-chip.active .cwci-chip-len { color: var(--destaque); background: rgba(254, 189, 13, 0.18); }

/* Botão pequeno (ex.: "+ Adicionar rede") */
#cw-modal-root .btn-sm {
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px;
  border-radius: 9px;
  gap: 6px;
}

/* Linha de rede social extra (passo 7): [select 35%] [input 50%] [× remover 15%] na mesma linha */
#cw-modal-root .cwci-rede-row {
  display: grid;
  grid-template-columns: 7fr 10fr 3fr;   /* ≈ 35% / 50% / 15% (o gap come um pouquinho) */
  gap: 8px;
  align-items: stretch;                  /* select, input e botão ficam com a mesma altura */
  margin-bottom: 14px;
}
#cw-modal-root .cwci-rede-row select { padding-right: 24px; min-width: 0; }   /* coluna estreita: mais espaço útil */
#cw-modal-root .cwci-rede-rm {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-3);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
#cw-modal-root .cwci-rede-rm:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}
#cw-modal-root .cwci-add-rede { margin-top: 2px; }

/* Botão de texto "Mostrar/Ocultar senha" (passo 8) */
#cw-modal-root .cwci-ver-senha {
  display: inline-block;
  margin-top: 2px;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#cw-modal-root .cwci-ver-senha:hover { color: var(--text-2); }

/* Player de vídeo (step 1) — controles próprios FORA do vídeo */
#cw-modal-root .cwci-player { display: block; }
#cw-modal-root .cwci-player-video {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
#cw-modal-root .cwci-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 50vh;
  outline: none;
}
#cw-modal-root .cwci-player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(6, 30, 48, 0.78);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
#cw-modal-root .cwci-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--destaque);
  border-radius: 50%;
  display: inline-block;
  animation: cwci-spin 0.8s linear infinite;
}
/* Barra de controles abaixo do vídeo */
#cw-modal-root .cwci-player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
}
#cw-modal-root .cwci-player-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
#cw-modal-root .cwci-player-btn:hover { background: rgba(254, 189, 13, 0.18); color: var(--destaque); }
#cw-modal-root .cwci-player-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  overflow: hidden;
}
#cw-modal-root .cwci-player-fill {
  height: 100%;
  background: var(--destaque);
  transition: width 120ms linear;
}
#cw-modal-root .cwci-player-time {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: center;
}
#cw-modal-root .cwci-player-aviso {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}
/* Fallback de TEXTO (step 1, quando não há vídeo) — vindo do campo texto_modal_inicial */
#cw-modal-root .cwci-video-ph.cwci-texto-fallback {
  aspect-ratio: auto;
  padding: 24px 26px;
  text-align: left;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  white-space: pre-line;   /* preserva quebras de linha do texto plano (caso o campo seja Blocks/plain text) */
}
#cw-modal-root .cwci-video-ph.cwci-texto-fallback p { margin: 0 0 10px; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback p:last-child { margin-bottom: 0; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback strong { color: var(--text-1); font-weight: 700; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback em { font-style: italic; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback a { color: var(--destaque); text-decoration: underline; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback ul,
#cw-modal-root .cwci-video-ph.cwci-texto-fallback ol { margin: 0 0 10px; padding-left: 22px; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback ul { list-style: disc; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback ol { list-style: decimal; }
#cw-modal-root .cwci-video-ph.cwci-texto-fallback h1,
#cw-modal-root .cwci-video-ph.cwci-texto-fallback h2,
#cw-modal-root .cwci-video-ph.cwci-texto-fallback h3 { color: var(--text-1); margin: 0 0 8px; font-weight: 700; }

/* Placeholder mostrado quando não há vídeo configurado (step 1) */
#cw-modal-root .cwci-video-ph {
  aspect-ratio: 16 / 9;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: var(--text-3);
  font-size: 15px;
  font-weight: 500;
}

/* Seletor segmentado (ex.: Celular | Fixo no step 4) */
#cw-modal-root .cwci-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
#cw-modal-root .cwci-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 160ms, color 160ms;
}
#cw-modal-root .cwci-seg-btn:hover { color: var(--text-1); }
#cw-modal-root .cwci-seg-btn.active {
  background: var(--destaque);
  color: var(--primaria);
}

/* ──────────────────────────────────────────────────────────────
   Seção e campos de formulário — espelham peril-vars.css
   ────────────────────────────────────────────────────────────── */
#cw-modal-root .editor-section { margin-bottom: 4px; }
#cw-modal-root .editor-section > h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

#cw-modal-root .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}
#cw-modal-root .field > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
#cw-modal-root .field .opt {
  color: var(--text-3);
  font-weight: 400;
}

/* Grids de formulário */
#cw-modal-root .form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
#cw-modal-root .form-grid-cep {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  gap: 0 14px;
}
#cw-modal-root .form-grid-cidade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;   /* Estado: largura suficiente p/ "Selecione"/UF */
  gap: 0 14px;
}
/* Linha "Nome (70%)" + "Tipo (30%)" do bloco de endereço */
#cw-modal-root .cwci-grid-7030 {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 0 14px;
}
/* Grade das redes sociais (step 7): 2 colunas em telas largas */
#cw-modal-root .cwci-redes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

/* ──────────────────────────────────────────────────────────────
   Inputs / select — espelham assets/css/global.css (um pouco maiores)
   ────────────────────────────────────────────────────────────── */
#cw-modal-root input[type="text"],
#cw-modal-root input[type="tel"],
#cw-modal-root input[type="password"],
#cw-modal-root input[type="email"],
#cw-modal-root input:not([type]),
#cw-modal-root textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #f0f4f8;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 160ms, background-color 160ms, box-shadow 160ms;
}
#cw-modal-root input[type="text"]:hover,
#cw-modal-root input[type="tel"]:hover,
#cw-modal-root input[type="password"]:hover,
#cw-modal-root input[type="email"]:hover,
#cw-modal-root input:not([type]):hover,
#cw-modal-root textarea:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.09);
}
#cw-modal-root input[type="text"]:focus,
#cw-modal-root input[type="tel"]:focus,
#cw-modal-root input[type="password"]:focus,
#cw-modal-root input[type="email"]:focus,
#cw-modal-root input:not([type]):focus,
#cw-modal-root textarea:focus {
  border-color: #FEBD0D;
  background-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(254, 189, 13, 0.15);
}
#cw-modal-root input::placeholder,
#cw-modal-root textarea::placeholder {
  color: #6b8fa8;
  font-style: normal;
}

#cw-modal-root select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b8fa8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 11px 28px 11px 14px;       /* só o suficiente p/ não passar por baixo da seta */
  font-size: 14px;
  font-family: inherit;
  color: #f0f4f8;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;            /* se ainda assim faltar espaço, "…" em vez de cortar seco */
  transition: border-color 160ms, background-color 160ms, box-shadow 160ms;
}
#cw-modal-root select:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background-color: rgba(255, 255, 255, 0.09);
}
#cw-modal-root select:focus {
  border-color: #FEBD0D;
  background-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(254, 189, 13, 0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23FEBD0D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
#cw-modal-root select option {
  background-color: #061E30;
  color: #f0f4f8;
}

/* ──────────────────────────────────────────────────────────────
   Botões — espelham assets/css/global.css (alvos de toque maiores)
   ────────────────────────────────────────────────────────────── */
#cw-modal-root .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  min-height: 44px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  outline: none;
  transition: background 160ms, border-color 160ms, opacity 160ms, transform 120ms, box-shadow 160ms;
  user-select: none;
  box-sizing: border-box;
}
#cw-modal-root .btn:active { transform: scale(0.97); }
#cw-modal-root .btn:disabled,
#cw-modal-root .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
#cw-modal-root .btn-primary {
  background: var(--destaque);
  color: var(--primaria);
  border-color: var(--destaque);
}
#cw-modal-root .btn-primary:hover {
  background: #ffd152;
  border-color: #ffd152;
  box-shadow: 0 6px 20px rgba(254, 189, 13, 0.30);
}
#cw-modal-root .btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  border-color: rgba(255, 255, 255, 0.12);
}
#cw-modal-root .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Spinner do botão "Salvando…/Concluindo…" */
#cw-modal-root .cwci-btn-spin {
  width: 14px;
  height: 14px;
  border: 2px solid var(--primaria);
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: cwci-spin 0.8s linear infinite;
}
@keyframes cwci-spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────────────────────────────
   Rodapé com os botões de navegação
   ────────────────────────────────────────────────────────────── */
#cw-modal-root .cwci-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
/* No desktop esse bloco (Voltar/Pular) fica à esquerda e empurra o botão principal p/ a direita */
#cw-modal-root .cwci-footer-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}
#cw-modal-root .cwci-btn-main { flex: 0 0 auto; }

/* ──────────────────────────────────────────────────────────────
   Erro de salvamento — espelha peril-vars.css .tab-save-error
   ────────────────────────────────────────────────────────────── */
#cw-modal-root .tab-save-error {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 13px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  margin-top: 14px;
}

/* Animação de entrada — usa o keyframe global peril-fade-slide-in (peril-vars.css) */
#cw-modal-root .fade-slide-in {
  animation: peril-fade-slide-in 260ms var(--ease-out);
}

/* ============================================================================
 *  RESPONSIVO — celular
 * ========================================================================== */
@media (max-width: 600px) {
  /* O overlay vira "folha" quase cheia, fixada embaixo */
  #cw-modal-root .cwci-overlay {
    align-items: flex-end;
    padding: 0;
  }
  #cw-modal-root .cwci-box {
    width: 100%;
    max-height: 96vh;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-bottom: none;
  }
  #cw-modal-root .cwci-titulo   { font-size: 20px; }
  #cw-modal-root .cwci-step-title { font-size: 16.5px; }
  #cw-modal-root .cwci-help     { font-size: 15px; margin-bottom: 18px; }

  /* Inputs com 16px → iOS não dá zoom ao focar; padding um pouco maior p/ toque */
  #cw-modal-root input[type="text"],
  #cw-modal-root input[type="tel"],
  #cw-modal-root input[type="password"],
  #cw-modal-root input[type="email"],
  #cw-modal-root input:not([type]),
  #cw-modal-root textarea,
  #cw-modal-root select {
    font-size: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #cw-modal-root select { padding-right: 30px; }

  #cw-modal-root .field { margin-bottom: 16px; }

  /* Todas as grades viram 1 coluna */
  #cw-modal-root .form-grid-2,
  #cw-modal-root .form-grid-cep,
  #cw-modal-root .form-grid-cidade,
  #cw-modal-root .cwci-grid-7030,
  #cw-modal-root .cwci-redes-grid { grid-template-columns: 1fr; }

  /* Rodapé: botão principal ocupa a largura toda e fica embaixo (alcance do polegar);
     Voltar/Pular dividem a linha de cima */
  #cw-modal-root .cwci-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }
  #cw-modal-root .cwci-footer-secondary { flex: 0 0 auto; }
  #cw-modal-root .cwci-footer-secondary:empty { display: none; }
  #cw-modal-root .cwci-footer-secondary .btn { flex: 1; }
  #cw-modal-root .cwci-btn-main { width: 100%; }
  #cw-modal-root .btn { min-height: 48px; }
}

/* Tablets / telas médias: redes em 1 coluna para não ficar apertado */
@media (min-width: 601px) and (max-width: 720px) {
  #cw-modal-root .cwci-redes-grid { grid-template-columns: 1fr; }
}
