/* FarejaLeads: estilos comuns do portal. Identidade "Faro" (seção 11 da especificação do portal). */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jakarta-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jakarta-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --primaria: #0f766e;
  --primaria-escura: #115e59;
  --primaria-clara: #ccfbf1;
  --primaria-fundo: #f0fdfa;
  --acento: #f59e0b;
  --acento-escuro: #b45309;
  --acento-fundo: #fffbeb;
  --fundo: #f6f8f7;
  --superficie: #ffffff;
  --borda: #e1e7e5;
  --borda-forte: #c5cfcc;
  --texto: #15201e;
  --texto-suave: #586763;
  --erro: #b91c1c;
  --erro-fundo: #fef2f2;
  --ok: #15803d;
  --ok-fundo: #f0fdf4;
  --raio: 10px;
  --raio-pequeno: 6px;
  --sombra: 0 1px 2px rgb(16 24 22 / 6%), 0 2px 8px rgb(16 24 22 / 5%);
  --fonte: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topo: 56px;
  --menu: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fundo);
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--primaria); }
code { font-size: .9em; background: var(--primaria-fundo); padding: .05em .35em; border-radius: 4px; }
[hidden] { display: none !important; }
.suave { color: var(--texto-suave); }
.pequeno { font-size: .85rem; }
.reticencias { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- Layout: topo fixo + menu lateral -------------------------------------------------- */
.topo {
  position: fixed; inset: 0 0 auto 0; height: var(--topo); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--superficie); border-bottom: 1px solid var(--borda);
}
.topo .marca { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--texto); font-weight: 700; font-size: 1.05rem; }
.topo .marca img { width: 28px; height: 28px; }
.topo .marca span b { color: var(--primaria); }
.topo .espaco { flex: 1; }
.topo .usuario { max-width: 220px; }
.botao-menu { display: none; }
.ambiente { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ambiente.producao { background: var(--primaria-clara); color: var(--primaria-escura); }
.ambiente.emulador { background: var(--acento-fundo); color: var(--acento-escuro); border: 1px solid var(--acento); }

.menu {
  position: fixed; top: var(--topo); bottom: 0; left: 0; width: var(--menu); z-index: 20;
  overflow-y: auto; padding: 16px 10px; background: var(--superficie); border-right: 1px solid var(--borda);
}
.menu .grupo { margin-bottom: 18px; }
.menu .grupo-titulo { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); padding: 0 10px 6px; font-weight: 700; }
.menu a {
  display: block; padding: 8px 10px; border-radius: var(--raio-pequeno); color: var(--texto);
  text-decoration: none; font-weight: 500;
}
.menu a:hover { background: var(--fundo); }
.menu a.ativo { background: var(--primaria-fundo); color: var(--primaria-escura); font-weight: 700; }
.menu a.desligado { color: var(--texto-suave); pointer-events: none; opacity: .6; }

.conteudo { margin: var(--topo) 0 0 var(--menu); padding: 24px; max-width: 1200px; }
.cabecalho-pagina { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.cabecalho-pagina h1 { margin: 0; flex: 1; min-width: 200px; }

@media (max-width: 900px) {
  .botao-menu { display: inline-flex; }
  .menu { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--sombra); }
  body.menu-aberto .menu { transform: none; }
  .conteudo { margin-left: 0; padding: 16px; }
  .topo .usuario { display: none; }
}

/* ---- Componentes ------------------------------------------------------------------------ */
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; box-shadow: var(--sombra); margin-bottom: 16px; }
.cartao > h2:first-child, .cartao > h3:first-child { margin-top: 0; }

.grade { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.grade .largo { grid-column: 1 / -1; }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--raio-pequeno); border: 1px solid var(--borda-forte);
  background: var(--superficie); color: var(--texto); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.botao:hover { background: var(--fundo); }
.botao:disabled { opacity: .55; cursor: not-allowed; }
.botao.primario { background: var(--primaria); border-color: var(--primaria); color: #fff; }
.botao.primario:hover { background: var(--primaria-escura); }
.botao.perigo { color: var(--erro); border-color: #f1b7b7; }
.botao.perigo:hover { background: var(--erro-fundo); }
.botao.fantasma { border-color: transparent; background: transparent; }
.botao.pequeno { min-height: 30px; padding: 0 10px; font-size: .85rem; }
.botao.icone { width: 34px; padding: 0; }

.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo > label, .campo > .rotulo { font-weight: 600; font-size: .9rem; }
.campo .ajuda { font-size: .8rem; color: var(--texto-suave); }
.campo .ajuda a { white-space: nowrap; }
.campo .erro-campo { font-size: .82rem; color: var(--erro); font-weight: 600; }
.campo.com-erro input, .campo.com-erro textarea, .campo.com-erro select, .campo.com-erro .caixa { border-color: var(--erro); }
input[type="text"], input[type="password"], input[type="tel"], input[type="email"], input[type="number"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--borda-forte); border-radius: var(--raio-pequeno);
  font: inherit; color: var(--texto); background: var(--superficie);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
textarea.alto { min-height: 220px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus, .botao:focus-visible { outline: 2px solid var(--primaria); outline-offset: 1px; }
.caixa { border: 1px solid var(--borda); border-radius: var(--raio-pequeno); padding: 10px; background: var(--fundo); }

.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.interruptor input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--borda-forte); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.interruptor input:checked { background: var(--primaria); }
.interruptor input:checked::after { left: 21px; }

.opcoes-marcar { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.opcoes-marcar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

.abas { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--borda); margin-bottom: 16px; scrollbar-width: thin; }
.abas button {
  border: 0; background: none; font: inherit; font-weight: 600; color: var(--texto-suave); padding: 10px 12px;
  border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
}
.abas button[aria-selected="true"] { color: var(--primaria-escura); border-bottom-color: var(--primaria); }

.selo { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--fundo); color: var(--texto-suave); border: 1px solid var(--borda); white-space: nowrap; }
.selo.ok { background: var(--ok-fundo); color: var(--ok); border-color: #bbe5c8; }
.selo.erro { background: var(--erro-fundo); color: var(--erro); border-color: #f1b7b7; }
.selo.aviso { background: var(--acento-fundo); color: var(--acento-escuro); border-color: #f6d58c; }
.selo.primario { background: var(--primaria-fundo); color: var(--primaria-escura); border-color: var(--primaria-clara); }

.alerta { border-radius: var(--raio-pequeno); padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.alerta.info { background: var(--primaria-fundo); border-color: var(--primaria-clara); }
.alerta.aviso { background: var(--acento-fundo); border-color: #f6d58c; }
.alerta.erro { background: var(--erro-fundo); border-color: #f1b7b7; color: #7f1d1d; }
.alerta.ok { background: var(--ok-fundo); border-color: #bbe5c8; }
.alerta ul { margin: 6px 0 0; padding-left: 20px; }

.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-suave); }
.tabela tbody tr:hover { background: var(--fundo); }
.tabela td.numero, .tabela th.numero { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .tabela thead { display: none; }
  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100%; }
  .tabela tr { border: 1px solid var(--borda); border-radius: var(--raio-pequeno); margin-bottom: 10px; background: var(--superficie); }
  .tabela td { border: 0; padding: 6px 12px; text-align: left !important; }
  .tabela td[data-rotulo]::before { content: attr(data-rotulo); display: block; font-size: .72rem; color: var(--texto-suave); font-weight: 700; text-transform: uppercase; }
}

.linhas { display: flex; flex-direction: column; gap: 6px; }
.linha { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.linha > .cresce { flex: 1 1 180px; min-width: 0; }
.linha > .fixo { flex: none; }
.linha > select.fixo, .linha > input.fixo { width: auto; max-width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px dashed var(--primaria); color: var(--primaria-escura); background: var(--primaria-fundo); border-radius: 999px; padding: 1px 10px; font-size: .8rem; cursor: pointer; font-family: inherit; }

.barra-acoes { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 0; margin-top: 8px; background: linear-gradient(transparent, var(--fundo) 30%); }
.barra-acoes .estado { margin-right: auto; font-size: .88rem; color: var(--texto-suave); }

.grupo-campos { border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; margin: 0 0 14px; background: var(--superficie); }
.grupo-campos > legend { font-weight: 700; padding: 0 6px; }

.prioridade { border-left: 3px solid var(--primaria); padding-left: 10px; margin-bottom: 12px; }
.prioridade h4 { margin: 0 0 6px; font-size: .9rem; color: var(--primaria-escura); }

dialog.modal { border: 0; border-radius: var(--raio); padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 20px 50px rgb(0 0 0 / 25%); }
dialog.modal::backdrop { background: rgb(15 23 21 / 45%); }
dialog.modal .corpo { padding: 20px; }
dialog.modal .rodape { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--borda); background: var(--fundo); }

.avisos-toast { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: var(--raio-pequeno); background: var(--texto); color: #fff; box-shadow: var(--sombra); font-weight: 500; }
.toast.erro { background: var(--erro); }
.toast.ok { background: var(--primaria-escura); }

.carregando { color: var(--texto-suave); padding: 24px 0; }
.vazio { text-align: center; color: var(--texto-suave); padding: 32px 12px; }

/* ---- Login ------------------------------------------------------------------------------ */
.pagina-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--primaria-fundo), var(--fundo) 60%); }
.pagina-login .cartao { width: min(400px, 100%); text-align: center; padding: 32px 24px; }
.pagina-login .logo { width: 56px; height: 56px; }
.pagina-login h1 { margin: 10px 0 4px; }
.pagina-login h1 b { color: var(--primaria); }
.pagina-login .botao { width: 100%; margin-top: 18px; min-height: 44px; }
.uid { font-family: ui-monospace, Consolas, monospace; word-break: break-all; background: var(--fundo); padding: 6px 8px; border-radius: 4px; display: block; margin-top: 6px; user-select: all; }

/* ---- Login, verificação em duas etapas e Minha conta ------------------------------------ */
.passo-login { text-align: left; margin-top: 16px; }
.passo-login h2 { text-align: center; }
.passo, .passo-login > div { display: flex; flex-direction: column; gap: 10px; }
.passo-login .botao { margin-top: 4px; }
.passo .rotulo, .campo .rotulo { font-weight: 600; font-size: .9rem; }
.campo-codigo { font-size: 1.4rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.recaptcha { height: 0; overflow: hidden; }
.totp .passos { padding-left: 20px; margin: 0 0 8px; }
.totp .passos li { margin-bottom: 8px; }
.totp .sem-marcador { list-style: none; }
.totp .qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--borda); border-radius: var(--raio-pequeno); }
.ativacao:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--borda); display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.fatores { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.fatores li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--borda); border-radius: var(--raio-pequeno); }
.faixa-mfa { font-size: .82rem; font-weight: 600; color: var(--acento-escuro); background: var(--acento-fundo); border: 1px solid var(--acento); border-radius: 999px; padding: 3px 10px; text-decoration: none; white-space: nowrap; }
.faixa-mfa:hover { text-decoration: underline; }
a.usuario { text-decoration: none; }
a.usuario:hover { text-decoration: underline; }
.conteudo > .cartao + .cartao, .conteudo > section.cartao, .conteudo > form.cartao { margin-bottom: 16px; }
dialog.tutorial .rodape { align-items: center; }
dialog.tutorial .espaco { flex: 1; }
@media (max-width: 720px) { .faixa-mfa { display: none; } }
