/* Respondi: base do painel. Tokens da identidade do Grupo Participa (sistema-grupo-participa-v2). Claro é o padrão. */
@font-face { font-family: "Inter"; src: url("../fontes/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fontes/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root, :root[data-theme="light"] {
  --accent: #E07F10; --accent-forte: #B86200; --accent-suave: rgba(224,127,16,.12); --accent-texto: #0f172a;
  --s0: #eef1f6; --s1: #ffffff; --s2: #f6f8fb; --s3: #e9edf3; --s4: #dde3ec;
  --fg: #0f172a; --fg2: #475569; --fg3: #64748b;
  --borda: rgba(15,23,42,.12); --borda-forte: rgba(15,23,42,.22);
  --red: #dc2626; --red-suave: rgba(220,38,38,.1); --green: #15803d; --green-suave: rgba(22,163,74,.12);
  --sombra: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.08);
  --sombra-menu: 0 12px 32px rgba(15,23,42,.16), 0 2px 6px rgba(15,23,42,.08);
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px;
  --ease-out: cubic-bezier(.23,1,.32,1);
  --topo-h: 60px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent: #F29725; --accent-forte: #F7AE55; --accent-suave: rgba(242,151,37,.14); --accent-texto: #0d0d0d;
  --s0: #000000; --s1: #0d0d0d; --s2: #141414; --s3: #1c1c1c; --s4: #242424;
  --fg: #f0f0f0; --fg2: #a6a6a6; --fg3: #8a8a8a;
  --borda: rgba(255,255,255,.08); --borda-forte: rgba(255,255,255,.18);
  --red: #f87171; --red-suave: rgba(248,113,113,.12); --green: #4ade80; --green-suave: rgba(74,222,128,.12);
  --sombra: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
  --sombra-menu: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5;
  color: var(--fg); background: var(--s0); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
@media (min-width: 900px) { h1 { font-size: 28px; } h2 { font-size: 20px; } }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="light"] .so-escuro, :root:not([data-theme="dark"]) .so-escuro { display: none; }
:root[data-theme="dark"] .so-claro { display: none; }
:root[data-theme="dark"] .so-escuro { display: block; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s var(--ease-out); }
.btn:active { transform: scale(.98); }
.btn-primario { background: var(--accent); color: var(--accent-texto); }
.btn-primario:hover { background: var(--accent-forte); }
.btn-escuro { background: var(--fg); color: var(--s1); }
.btn-escuro:hover { opacity: .88; }
.btn-secundario { background: var(--s1); border-color: var(--borda-forte); color: var(--fg); }
.btn-secundario:hover { background: var(--s2); }
.btn-fantasma { background: transparent; color: var(--fg); }
.btn-fantasma:hover { background: var(--s3); }
.btn-perigo { background: var(--red); color: #fff; }
.btn-perigo:hover { filter: brightness(.92); }
.btn-largo { width: 100%; min-height: 48px; }
.btn-peq { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-icone { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--fg2); transition: background-color .15s, color .15s; }
.btn-icone:hover { background: var(--s3); color: var(--fg); }
.btn-icone[aria-pressed="true"] { background: var(--s3); color: var(--fg); }

/* Campos */
.campo { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--fg2); }
.campo input, .campo select, .campo textarea, .entrada { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--borda-forte);
  border-radius: var(--r-md); background: var(--s1); color: var(--fg); font-size: 15px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.campo textarea, textarea.entrada { min-height: 88px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-suave); }
.campo-ajuda { font-size: 12px; font-weight: 400; color: var(--fg3); }
.pilha { display: grid; gap: 16px; }
.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.alerta-erro { background: var(--red-suave); color: var(--red); }
.alerta-ok { background: var(--green-suave); color: var(--green); }

/* Interruptor */
.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.interruptor input { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: var(--s4); position: relative; margin: 0; cursor: pointer; transition: background-color .2s; flex: none; }
.interruptor input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s var(--ease-out); }
.interruptor input:checked { background: var(--accent); }
.interruptor input:checked::after { transform: translateX(16px); }

/* Barra do topo */
.topo { position: sticky; top: 0; z-index: 30; height: var(--topo-h); display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--s1); border-bottom: 1px solid var(--borda); }
.topo-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-gp img { height: 22px; width: auto; }
.marca-produto { font-weight: 600; font-size: 15px; padding-left: 10px; border-left: 1px solid var(--borda-forte); }
.topo-meio { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; }
.topo-acoes { display: flex; align-items: center; gap: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-texto); font-weight: 600; font-size: 14px; }

/* Menus suspensos */
.menu-ancora { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; padding: 6px; border-radius: var(--r-md);
  background: var(--s1); border: 1px solid var(--borda); box-shadow: var(--sombra-menu); animation: menu-entra .16s var(--ease-out); }
.menu.esquerda { right: auto; left: 0; }
@keyframes menu-entra { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-cab { padding: 8px 10px 10px; border-bottom: 1px solid var(--borda); margin-bottom: 6px; display: grid; font-size: 13px; }
.menu-cab span { color: var(--fg3); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none;
  text-align: left; font-size: 14px; color: var(--fg); text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--s3); outline: 0; }
.menu-item.perigo { color: var(--red); }
.menu-sep { height: 1px; background: var(--borda); margin: 6px 0; }

/* Janela (modal) */
.janela-fundo { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(2,6,23,.5);
  animation: fundo-entra .18s ease-out; }
@keyframes fundo-entra { from { opacity: 0; } }
.janela { width: min(100%, 460px); max-height: calc(100svh - 32px); overflow: auto; padding: 24px; border-radius: var(--r-xl); background: var(--s1);
  box-shadow: var(--sombra-menu); animation: janela-entra .22s var(--ease-out); }
.janela.larga { width: min(100%, 720px); }
@keyframes janela-entra { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.janela h2 { margin-bottom: 8px; }
.janela > p { color: var(--fg2); margin-bottom: 16px; }
.janela-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* Aviso rápido */
.avisos { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; pointer-events: none; }
.aviso { padding: 10px 16px; border-radius: var(--r-md); background: var(--fg); color: var(--s1); font-size: 14px; font-weight: 600; box-shadow: var(--sombra-menu);
  animation: aviso-entra .25s var(--ease-out); }
.aviso.erro { background: var(--red); color: #fff; }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(8px); } }

.carregando { padding: 48px; text-align: center; color: var(--fg3); }
.vazio { display: grid; place-items: center; gap: 12px; text-align: center; padding: 64px 16px; color: var(--fg2); }
.vazio h2 { color: var(--fg); }
.etiqueta { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--s3); color: var(--fg2); }
.etiqueta.ok { background: var(--green-suave); color: var(--green); }
.etiqueta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.erro-pagina { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 16px; }
.erro-cod { font-size: 56px; font-weight: 600; color: var(--accent); line-height: 1; }
.erro-pagina p { color: var(--fg2); margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
