/* Identidade visual Grupo AB Areias: azul #0095eb, verde #90c700, marinho #073f75, Poppins. */
:root {
  --azul: #0095eb;
  --azul-forte: #0a6cc2;
  --azul-forte-hover: #0859a3;
  --azul-claro: #e6f4fd;
  --marinho: #073f75;
  --verde: #90c700;
  --verde-escuro: #4f7a00;
  --verde-claro: #f1f9e0;
  --tinta: #161922;
  --texto: #2b3240;
  --texto-2: #5d6676;
  --texto-3: #8a93a3;
  --borda: #e2e8f0;
  --borda-forte: #cbd5e1;
  --fundo: #f2f6fa;
  --card: #ffffff;
  --erro: #c62828;
  --erro-claro: #fdecec;
  --aviso: #9a5b00;
  --aviso-claro: #fff6e0;
  --raio: 14px;
  --raio-p: 10px;
  --sombra: 0 1px 2px rgba(7, 63, 117, .06), 0 4px 16px rgba(7, 63, 117, .06);
  --sombra-alta: 0 10px 40px rgba(7, 63, 117, .18);
  --fonte: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- modo escuro ---------- */
:root.dark-mode {
  color-scheme: dark;
  --azul-forte: #1f7fd0;
  --azul-forte-hover: #2b8fe0;
  --azul-claro: #12304a;
  --verde-escuro: #b6e04a;
  --verde-claro: #1e2b0c;
  --tinta: #eef3f8;
  --texto: #d3dde7;
  --texto-2: #9fb0c2;
  --texto-3: #74879b;
  --borda: #22344a;
  --borda-forte: #2f465e;
  --fundo: #0a1420;
  --card: #101d2c;
  --campo: #0c1826;
  --sutil: #142436;
  --abas: #0d1928;
  --erro: #ff8a80;
  --erro-claro: #3a1818;
  --aviso: #ffc95c;
  --aviso-claro: #352909;
  --destaque-texto: #8fd0ff;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --sombra-alta: 0 10px 40px rgba(0, 0, 0, .5);
}
:root { --campo: #fff; --sutil: #f3f6fa; --abas: #e7edf4; --destaque-texto: var(--marinho); }

#btn-tema {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 14px 8px 10px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--borda); box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  font: 600 13px var(--fonte); color: var(--texto);
}
#btn-tema:hover { border-color: var(--azul); color: var(--azul-forte); }
.dark-mode #btn-tema:hover { color: var(--destaque-texto); }
#btn-tema svg { width: 20px; height: 20px; flex: none; }
@media print { #btn-tema { display: none; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--fonte); font-size: 14px; line-height: 1.5;
  color: var(--texto); background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--tinta); margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--azul-forte); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--raio-p); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, opacity .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:focus-visible, .campo:focus-visible, .chip:focus-visible, .aba:focus-visible { outline: 3px solid rgba(0, 149, 235, .35); outline-offset: 1px; }
.btn-primario { background: var(--azul-forte); color: #fff; }
.btn-primario:hover:not(:disabled) { background: var(--azul-forte-hover); }
.btn-verde { background: var(--verde); color: #1d2b00; }
.btn-verde:hover:not(:disabled) { background: #82b400; }
.btn-sec { background: var(--card); color: var(--tinta); border-color: var(--borda-forte); }
.btn-sec:hover:not(:disabled) { border-color: var(--azul); color: var(--azul-forte); }
.btn-fantasma { background: transparent; color: var(--texto-2); }
.btn-fantasma:hover:not(:disabled) { background: var(--azul-claro); color: var(--azul-forte); }
.btn-perigo { background: var(--card); color: var(--erro); border-color: #f2c4c4; }
.btn-perigo:hover:not(:disabled) { background: var(--erro-claro); }
.btn-p { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-p svg { width: 16px; height: 16px; }
.btn-icone { width: 38px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.carregando:disabled { opacity: .85; }
.btn.carregando { position: relative; color: transparent !important; pointer-events: none; }
.btn.carregando::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent;
  animation: girar .7s linear infinite;
}
.btn-sec.carregando::after, .btn-fantasma.carregando::after { border-color: var(--azul) var(--azul) transparent transparent; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- campos ---------- */
.rotulo { display: block; font-size: 13px; font-weight: 500; color: var(--tinta); margin-bottom: 6px; }
.rotulo small { font-weight: 400; color: var(--texto-3); }
.campo {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--borda-forte); border-radius: var(--raio-p);
  background: var(--campo); transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea.campo { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; }
.campo::placeholder { color: var(--texto-3); }
.campo:hover { border-color: var(--texto-3); }
.campo:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0, 149, 235, .15); }
.campo.invalido { border-color: var(--erro); box-shadow: 0 0 0 3px rgba(198, 40, 40, .1); }
.campo-p { height: 38px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
select.campo {
  appearance: none; padding-right: 38px; cursor: pointer;
  background: var(--campo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d6676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.ajuda { font-size: 12px; color: var(--texto-2); margin-top: 6px; }
.ajuda.erro { color: var(--erro); }
.com-sufixo { position: relative; }
.com-sufixo .campo { padding-right: 46px; }
.com-sufixo .sufixo { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-size: 13px; pointer-events: none; }
.com-prefixo { position: relative; }
.com-prefixo .campo { padding-left: 40px; }
.com-prefixo .prefixo { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-size: 13px; pointer-events: none; }

/* interruptor */
.chave { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; color: var(--texto-2); }
.chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chave .trilho { width: 40px; height: 22px; border-radius: 22px; background: var(--borda-forte); position: relative; transition: background .15s; flex: none; }
.chave .trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.chave input:checked + .trilho { background: var(--azul-forte); }
.chave input:checked + .trilho::after { transform: translateX(18px); }
.chave input:focus-visible + .trilho { outline: 3px solid rgba(0, 149, 235, .35); outline-offset: 1px; }

/* ---------- cartões ---------- */
.cartao { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); }
.cartao-corpo { padding: 22px 24px; }
.cartao-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cartao-topo p { color: var(--texto-2); font-size: 13px; margin-top: 2px; }
.passo { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--azul-claro); color: var(--azul-forte); font-weight: 600; font-size: 13px; margin-right: 10px; flex: none; }
.titulo-passo { display: flex; align-items: center; }

.selo { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.selo-verde { background: var(--verde-claro); color: var(--verde-escuro); }
.selo-azul { background: var(--azul-claro); color: var(--azul-forte); }
.selo-cinza { background: var(--sutil); color: var(--texto-2); }
.selo-aviso { background: var(--aviso-claro); color: var(--aviso); }

.alerta { display: flex; gap: 10px; padding: 10px 14px; border-radius: var(--raio-p); font-size: 13px; align-items: flex-start; }
.alerta svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alerta-erro { background: var(--erro-claro); color: var(--erro); }
.alerta-aviso { background: var(--aviso-claro); color: var(--aviso); }
.alerta-info { background: var(--azul-claro); color: var(--destaque-texto); }

/* ---------- avisos flutuantes ---------- */
#avisos { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 460px; }
.aviso-flutuante {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
  background: var(--tinta); color: #fff; font-size: 13.5px; box-shadow: var(--sombra-alta); animation: subir .2s ease-out;
}
.aviso-flutuante.erro { background: var(--erro); }
.aviso-flutuante svg { width: 18px; height: 18px; flex: none; }
@keyframes subir { from { opacity: 0; transform: translateY(8px); } }

/* barra da marca no topo */
.faixa-marca { height: 4px; background: linear-gradient(90deg, var(--marinho) 0%, var(--azul) 55%, var(--verde) 100%); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
