/* Reunimos: visual branco, preto e dourado. Mobile first; tokens em :root para trocar a marca num lugar só. */

:root {
  --preto: #111111;
  --grafite: #1c1c1c;
  --ouro: #C9A227;
  --ouro-claro: #E9D38A;
  --ouro-escuro: #8A6A10;      /* texto dourado sobre branco: contraste AA */
  --ouro-fundo: #FBF5E3;       /* realce suave de linhas e avisos */
  --texto: #161616;
  --texto-suave: #5C5C5C;
  --linha: #ECE9E1;
  --borda: #D6D1C4;
  --fundo: #EDEDEA;
  --papel: #FFFFFF;
  --cinza-claro: #F6F5F1;
  --alerta-fundo: #FFF6D6;
  --foco: 0 0 0 3px rgb(201 162 39 / .45);
  --raio: 12px;
  --raio-pequeno: 10px;
  --sombra: 0 1px 2px rgb(17 17 17 / .05), 0 8px 24px rgb(17 17 17 / .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fundo);
  color: var(--texto);
  font: 400 16px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  border-top: 4px solid var(--preto);
  box-shadow: inset 0 -1px 0 var(--ouro);
}
::selection { background: var(--ouro-claro); color: var(--preto); }

main { flex: 1; display: grid; place-items: center; padding: 32px 16px 40px; }

/* ---------- cartões e títulos ---------- */
.cartao {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 28px;
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: 18px;
  box-shadow: var(--sombra);
}
.cartao::before {            /* filete dourado no topo, marca da casa */
  content: '';
  position: absolute; left: 28px; right: 28px; top: -1px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--ouro), transparent);
  border-radius: 0 0 3px 3px;
}
.marca {
  margin: 0 0 6px;
  color: var(--ouro-escuro);
  font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
h1 { margin: 0 0 10px; font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--preto); }
h2 { font-weight: 700; letter-spacing: -.01em; }
.apoio { margin: 0 0 18px; color: var(--texto-suave); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.carregando { color: var(--texto-suave); text-align: center; padding: 40px 0; }

/* ---------- avisos ---------- */
.aviso {
  margin: 0 0 18px;
  padding: 12px 14px 12px 16px;
  background: var(--alerta-fundo);
  color: var(--texto);
  border-left: 3px solid var(--ouro);
  border-radius: 8px;
  font-size: 15px; font-weight: 500;
}
.aviso p { margin: 0 0 4px; }
.aviso p:last-child { margin: 0; }

/* ---------- botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  font: inherit; font-size: 15px; font-weight: 600;
  color: var(--texto);
  background: var(--papel);
  border: 1px solid var(--borda);
  border-radius: var(--raio-pequeno);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.botao:hover { background: var(--cinza-claro); border-color: #B9B3A3; }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: .55; cursor: default; transform: none; }
.botao.principal {
  color: var(--ouro-claro); background: var(--preto); border-color: var(--preto);
  box-shadow: 0 2px 0 var(--ouro) inset;
}
.botao.principal:hover { background: var(--grafite); border-color: var(--grafite); color: #F4DE94; }
.botao.pequeno { width: auto; min-height: 40px; padding: 6px 14px; font-size: 14px; }
.botao:focus-visible, .convite-instalar__link:focus-visible, .aba:focus-visible, .voltar:focus-visible, .linha:focus-visible {
  outline: none; box-shadow: var(--foco);
}

.fechar { width: 40px; height: 40px; font-size: 22px; line-height: 1; color: var(--texto-suave); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.fechar:hover { background: var(--cinza-claro); }
.rodape { padding: 0 16px 16px; text-align: center; }
.pilha { display: grid; gap: 10px; margin-top: 8px; }
.pagina { width: 100%; max-width: 760px; align-self: start; }
.voltar {
  padding: 8px 4px; margin-bottom: 4px;
  font: inherit; font-size: 15px; font-weight: 600;
  color: var(--texto-suave); background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.voltar:hover { color: var(--preto); }
.pagina h1 { margin-bottom: 14px; }

/* ---------- abas (controle segmentado) ---------- */
.abas {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  margin: 0 0 22px; padding: 4px;
  background: var(--cinza-claro); border: 1px solid var(--linha); border-radius: 12px;
}
.aba {
  min-height: 40px; padding: 8px 12px;
  font: inherit; font-size: 15px; font-weight: 600;
  color: var(--texto-suave); background: transparent; border: 0; border-radius: 9px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.aba:hover { color: var(--preto); }
.aba.atual { color: var(--ouro-claro); background: var(--preto); box-shadow: 0 1px 2px rgb(0 0 0 / .15); }

/* ---------- campos ---------- */
input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="date"], input:not([type]),
.campo input, .campo select, .campo textarea, .linha-entrada input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--texto);
  background: var(--papel); border: 1px solid var(--borda); border-radius: var(--raio-pequeno);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #9A9A9A; }
input:hover, select:hover, textarea:hover { border-color: #B9B3A3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--preto); box-shadow: var(--foco); }
input[type="search"] { margin-bottom: 10px; }
.campo { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--texto); }
.campo select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-suave) 50%), linear-gradient(135deg, var(--texto-suave) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.campo textarea { min-height: 96px; resize: vertical; }
.caixa { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; cursor: pointer; }
.caixa input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--preto); }
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.janela .aviso { margin: 12px 0 0; }
.linha-entrada { display: flex; gap: 8px; margin-bottom: 12px; }
.linha-entrada input { flex: 1; min-width: 0; }
.linha-entrada .botao { min-height: 46px; }

/* ---------- listas e linhas ---------- */
.pagina h2 { margin: 26px 0 10px; font-size: 17px; }
.lista {
  margin: 14px 0 0; padding: 0; list-style: none;
  background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden;
  box-shadow: var(--sombra);
}
.lista:empty { display: none; }
.lista li + li { border-top: 1px solid var(--linha); }
.linha {
  display: grid; gap: 2px; width: 100%; padding: 14px 16px;
  font: inherit; font-size: 14px; color: var(--texto-suave); text-align: left;
  background: none; border: 0; cursor: pointer; overflow-wrap: anywhere;
  transition: background-color .12s ease;
}
.linha:hover { background: var(--ouro-fundo); }
.linha strong { color: var(--texto); font-size: 16px; font-weight: 600; }

.escolha { display: flex; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.escolha label { flex: 1; position: relative; }
.escolha input { position: absolute; opacity: 0; pointer-events: none; }
.escolha span {
  display: block; min-height: 46px; padding: 11px 10px; text-align: center; font-weight: 600;
  background: var(--papel); border: 1px solid var(--borda); border-radius: var(--raio-pequeno); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.escolha span:hover { background: var(--cinza-claro); }
.escolha input:checked + span { color: var(--ouro-claro); background: var(--preto); border-color: var(--preto); }
.escolha input:focus-visible + span { box-shadow: var(--foco); }

.sugestoes { margin: -6px 0 14px; padding: 0; list-style: none; }
.sugestoes:empty { display: none; }
.sugestoes button {
  width: 100%; padding: 10px 14px; font: inherit; text-align: left; color: var(--texto);
  background: var(--papel); border: 1px solid var(--linha); cursor: pointer;
}
.sugestoes button:hover { background: var(--ouro-fundo); }
.sugestoes button[aria-selected="true"] { background: var(--alerta-fundo); border-color: var(--ouro); }
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.etiqueta {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding-left: 12px;
  background: var(--ouro-fundo); border: 1px solid var(--ouro-claro); border-radius: 999px; font-size: 14px; overflow-wrap: anywhere;
}
.etiqueta button { width: 32px; height: 32px; font-size: 18px; line-height: 1; color: var(--texto-suave); background: none; border: 0; border-radius: 999px; cursor: pointer; }
.etiqueta button:hover { color: var(--preto); background: rgb(0 0 0 / .05); }
.pagina form > .botao.principal { margin-top: 14px; }
.avisos { margin: 0 0 18px; padding-left: 20px; }
.avisos li { margin-bottom: 8px; }
.opcoes-lista { margin: 0 0 14px; padding: 0; border: 0; }
.opcoes-lista legend { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.caixa.destaque {
  margin: 8px 0 18px; padding: 14px; background: var(--ouro-fundo); border: 1px solid var(--ouro-claro); border-radius: var(--raio-pequeno); font-weight: 600;
}

/* ---------- gravação ---------- */
.gravacao { max-width: 560px; }
.gravacao > .marca, .gravacao > .apoio { text-align: center; }
.cronometro {
  margin: 14px auto 20px; padding: 26px 16px; max-width: 360px;
  color: var(--ouro-claro); background: var(--preto); border-radius: 18px;
  font-size: clamp(44px, 12vw, 64px); font-weight: 800; line-height: 1; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; text-align: center;
  box-shadow: 0 2px 0 var(--ouro) inset, var(--sombra);
}
#alertasGravacao .aviso { margin: 10px 0; }

/* ---------- janelas (diálogos) ---------- */
.janela {
  width: calc(100% - 32px); max-width: 420px; padding: 26px; border: 0; border-radius: 18px;
  color: var(--texto); box-shadow: 0 24px 60px rgb(0 0 0 / .25);
}
.janela::backdrop { background: rgb(17 17 17 / .55); backdrop-filter: blur(2px); }
.janela h2 { margin: 0 0 14px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.janela ol { margin: 0 0 20px; padding-left: 22px; }
.janela li { margin-bottom: 8px; }

/* ---------- transcrição e documento ---------- */
.transcricao {
  margin: 12px 0; padding: 14px 14px 14px 36px; max-height: 50vh; overflow-y: auto;
  background: var(--cinza-claro); border: 1px solid var(--linha); border-radius: var(--raio-pequeno); font-size: 15px;
}
.transcricao li { margin-bottom: 10px; overflow-wrap: anywhere; }
.documento {
  margin: 14px 0; padding: 22px 24px; background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio);
  box-shadow: var(--sombra); font: 400 16px/1.7 Georgia, 'Times New Roman', serif; color: #1d1d1d; overflow-wrap: anywhere;
}
.documento h3 {
  margin: 22px 0 8px; padding-bottom: 6px; font: 700 15px/1.3 Inter, system-ui, sans-serif;
  color: var(--ouro-escuro); letter-spacing: .02em; text-transform: uppercase; border-bottom: 1px solid var(--ouro-claro);
}
.documento h3:first-child { margin-top: 0; }
.editor { min-height: 260px; outline: none; }
.editor:focus-visible { box-shadow: var(--foco); border-radius: 8px; }
.detalhes { margin: 12px 0; }
.detalhes summary { cursor: pointer; padding: 6px 0; font-weight: 600; color: var(--texto); }

/* ---------- filtros e atas ---------- */
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.ata {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
  padding: 14px 16px;
}
.ata > div:first-child { display: grid; gap: 2px; min-width: 0; font-size: 14px; color: var(--texto-suave); }
.ata strong { color: var(--texto); font-size: 16px; font-weight: 600; }
.ata__acoes { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- rodapés e texto longo ---------- */
.rodape-cartao { margin: 18px 0 0; text-align: center; font-size: 14px; }
.rodape-cartao a, .texto-longo a { color: var(--ouro-escuro); font-weight: 600; text-underline-offset: 3px; }
.texto-longo { max-width: 740px; padding: 30px 28px; }
.texto-longo h1 { font-size: 24px; }
.texto-longo h2 { margin: 24px 0 8px; font-size: 17px; }
.texto-longo li { margin-bottom: 8px; }

/* ---------- logo da entrada ---------- */
.logo-entrada {
  display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto 14px;
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / .18));
}
.cartao > .marca { text-align: center; }

/* ---------- convite para instalar (PWA) ---------- */
.convite-instalar {
  position: fixed; left: 12px; right: 12px; z-index: 20;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  background: var(--preto); color: #F5F5F5; border: 1px solid #2a2a2a; border-radius: 14px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .3);
}
.convite-instalar img { width: 40px; height: 40px; border-radius: 10px; }
.convite-instalar__texto { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.convite-instalar__texto div { margin-top: 2px; font-weight: 400; color: #BDBDBD; }
.convite-instalar__acoes { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.convite-instalar__link { min-height: 40px; padding: 0 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ouro-claro); background: none; border: 0; cursor: pointer; }
.convite-instalar__ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--ouro-claro); }
@media (max-width: 480px) {
  .convite-instalar { flex-wrap: wrap; }
  .convite-instalar__acoes { width: 100%; justify-content: flex-end; }
}
@media (min-width: 768px) {
  .convite-instalar { left: auto; max-width: 480px; }
}

/* ---------- telas maiores ---------- */
@media (min-width: 768px) {
  body { font-size: 17px; }
  main { padding: 48px 24px 64px; }
  .cartao { padding: 44px 40px 36px; }
  h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- campo de senha com o botão de mostrar e esconder ---------- */
.campo-senha { position: relative; display: block; }
.campo-senha input { padding-right: 52px; }
.olho-senha {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 40px; padding: 0;
  color: var(--texto-suave); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.olho-senha:hover { color: var(--preto); background: var(--cinza-claro); }
.olho-senha[aria-pressed="true"] { color: var(--ouro-escuro); }
.olho-senha:focus-visible { outline: none; box-shadow: var(--foco); }

/* ---------- ações de texto (Esqueci a senha, Voltar) ---------- */
.link-acao {
  display: block; margin: -4px 0 14px auto; padding: 6px 4px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ouro-escuro);
  background: none; border: 0; border-radius: 6px; cursor: pointer; text-underline-offset: 3px;
}
.link-acao:hover { color: var(--preto); text-decoration: underline; }
.link-acao:focus-visible { outline: none; box-shadow: var(--foco); }
.form-entrada > .link-acao[hidden] { display: none; }
.form-entrada > .botao + .link-acao { margin: 12px auto 0; }
.titulo-acao { margin: 0 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--preto); }

/* ---------- versão e aviso de atualização ---------- */
.versao { margin: 18px 0 0; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--texto-suave); }
.aviso-atualizacao {
  position: fixed; left: 12px; right: 12px; z-index: 30; top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--preto); color: #F5F5F5; border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .3);
  font-size: 14px; font-weight: 600;
}
.aviso-atualizacao__acoes { display: flex; gap: 8px; }
.aviso-atualizacao .botao { min-height: 38px; }
@media (min-width: 768px) { .aviso-atualizacao { left: auto; right: 24px; max-width: 460px; } }

/* ---------- requisitos da senha ---------- */
.requisitos-senha { list-style: none; margin: -6px 0 16px; padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--texto-suave); background: var(--cinza-claro); border: 1px solid var(--linha); border-radius: var(--raio-pequeno); }
.requisitos-senha li { line-height: 1.35; }
.requisitos-senha li.ok { color: var(--ouro-escuro); font-weight: 600; }
.requisitos-senha li:not(.ok) span { color: #9A9A9A; }
@media (max-width: 380px) { .requisitos-senha { grid-template-columns: 1fr; } }
