/* Base visual compartilhada pela loja e pelo painel. */
:root {
  --fundo: #f6f5fb;
  --superficie: #ffffff;
  --superficie-2: #f1eff8;
  --borda: #e4e1ef;
  --texto: #17142b;
  --texto-2: #5d5875;
  --texto-3: #8a85a3;
  --marca: #6d28d9;
  --marca-forte: #5b21b6;
  --marca-suave: #ede7fb;
  --marca-texto: #ffffff;
  --moeda: #d97706;
  --moeda-suave: #fef3c7;
  --ok: #15803d;
  --ok-suave: #dcfce7;
  --alerta: #b45309;
  --alerta-suave: #fef3c7;
  --erro: #c81e1e;
  --erro-suave: #fee2e2;
  --info: #1d4ed8;
  --info-suave: #dbeafe;
  --oferta: #e11d48;
  --sombra: 0 1px 2px rgb(23 20 43 / 6%), 0 4px 16px rgb(23 20 43 / 6%);
  --sombra-forte: 0 12px 40px rgb(23 20 43 / 16%);
  --raio: 14px;
  --raio-p: 9px;
  --fonte: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

:root[data-tema='escuro'] {
  --fundo: #0f0d1a;
  --superficie: #18152a;
  --superficie-2: #211d38;
  --borda: #2e2a4a;
  --texto: #f1effa;
  --texto-2: #b6b0d0;
  --texto-3: #827c9f;
  --marca: #8b5cf6;
  --marca-forte: #a78bfa;
  --marca-suave: #2a2150;
  --moeda: #fbbf24;
  --moeda-suave: #3a2c0b;
  --ok: #4ade80;
  --ok-suave: #12301f;
  --alerta: #fbbf24;
  --alerta-suave: #3a2c0b;
  --erro: #f87171;
  --erro-suave: #3d1517;
  --info: #93c5fd;
  --info-suave: #172a4d;
  --oferta: #fb7185;
  --sombra: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
  --sombra-forte: 0 12px 40px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.55 var(--fonte);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--marca); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
.oculto, [hidden] { display: none !important; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--raio-p);
  border: 1px solid transparent; background: var(--superficie-2); color: var(--texto);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primario { background: var(--marca); color: var(--marca-texto); }
.btn-primario:hover { background: var(--marca-forte); filter: none; }
.btn-contorno { background: transparent; border-color: var(--borda); }
.btn-perigo { background: var(--erro-suave); color: var(--erro); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-moeda { background: var(--moeda); color: #1c1300; }
.btn-p { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn-g { min-height: 50px; padding: 0 24px; font-size: 1.02rem; }
.btn-bloco { width: 100%; }
.btn-icone { width: 42px; padding: 0; }
.btn.carregando { position: relative; color: transparent !important; }
.btn.carregando::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--texto-3) transparent var(--texto-3) transparent;
  animation: girar .7s linear infinite;
}
.btn-primario.carregando::after { border-color: #fff transparent #fff transparent; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo > span, .rotulo { font-size: .86rem; font-weight: 600; color: var(--texto-2); }
.campo small { color: var(--texto-3); font-size: .8rem; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='tel'], input[type='date'],
input[type='datetime-local'], input[type='search'], input[type='url'], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--raio-p);
  border: 1px solid var(--borda); background: var(--superficie); color: var(--texto);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--marca); flex: none; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grade-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 640px) { .grade-2, .grade-3 { grid-template-columns: 1fr; } }

/* ---------- blocos ---------- */
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra); }
.cartao + .cartao { margin-top: 16px; }
.etiqueta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--superficie-2); color: var(--texto-2); white-space: nowrap; }
.etiqueta .ic { width: 14px; height: 14px; }
.et-ok { background: var(--ok-suave); color: var(--ok); }
.et-alerta { background: var(--alerta-suave); color: var(--alerta); }
.et-erro { background: var(--erro-suave); color: var(--erro); }
.et-info { background: var(--info-suave); color: var(--info); }
.et-marca { background: var(--marca-suave); color: var(--marca); }
.et-moeda { background: var(--moeda-suave); color: var(--moeda); }
.selo-verificado { color: var(--marca); display: inline-flex; vertical-align: -3px; }
.selo-verificado .ic { width: 18px; height: 18px; fill: var(--marca-suave); }
.vazio { text-align: center; padding: 48px 16px; color: var(--texto-2); }
.vazio .ic { width: 44px; height: 44px; color: var(--texto-3); margin: 0 auto 12px; }
.alerta-caixa { padding: 12px 14px; border-radius: var(--raio-p); background: var(--info-suave); color: var(--info); margin-bottom: 14px; font-size: .92rem; }
.alerta-caixa.alerta { background: var(--alerta-suave); color: var(--alerta); }
.alerta-caixa.erro { background: var(--erro-suave); color: var(--erro); }
.alerta-caixa.ok { background: var(--ok-suave); color: var(--ok); }
.texto-2 { color: var(--texto-2); }
.texto-3 { color: var(--texto-3); font-size: .86rem; }
.linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.mt { margin-top: 16px; }
.carregando-tela { display: grid; place-items: center; min-height: 40vh; color: var(--texto-3); }
.carregando-tela::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--borda); border-top-color: var(--marca); animation: girar .8s linear infinite; }

/* ---------- tabelas ---------- */
.tabela-rolar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borda); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-3); font-weight: 700; }

/* ---------- texto formatado ---------- */
.texto-rico h2, .texto-rico h3 { margin-top: 1.2em; }
.texto-rico h3:first-child, .texto-rico h2:first-child { margin-top: 0; }
.texto-rico ul, .texto-rico ol { padding-left: 1.3em; margin: 0 0 1em; }
.texto-rico li { margin-bottom: .3em; }
.texto-rico blockquote { margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--marca); background: var(--marca-suave); border-radius: 0 var(--raio-p) var(--raio-p) 0; }
.texto-rico table { margin-bottom: 1em; }

/* ---------- avisos ---------- */
.avisos { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.aviso { padding: 12px 16px; border-radius: var(--raio-p); background: var(--texto); color: var(--superficie); box-shadow: var(--sombra-forte); font-weight: 600; transition: opacity .4s, transform .4s; }
.aviso-erro { background: var(--erro); color: #fff; }
.aviso.saindo { opacity: 0; transform: translateY(8px); }

/* ---------- janelas ---------- */
.janela-fundo { position: fixed; inset: 0; background: rgb(10 8 20 / 55%); z-index: 900; display: grid; place-items: center; padding: 16px; }
.janela { background: var(--superficie); border-radius: var(--raio); box-shadow: var(--sombra-forte); width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 22px; }
.janela-larga { width: min(900px, 100%); }
.janela-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.janela-topo h3 { margin: 0; }
