/* Caixa RT — app do frentista. Uma coluna, botões grandes, lê bem na pista com sol. */
:root {
  --bg: #f3f6f7; --surface: #ffffff; --fg: #15232a; --muted: #5b6b73; --line: #d3dde1;
  --petrol: #0f5a6e; --petrol-fg: #ffffff; --amber: #b86b06; --ok: #2e7d4f; --crit: #b42318;
  --ok-bg: #e4f3ea; --warn-bg: #fbeedb; --crit-bg: #fbe3e0; --info-bg: #e3eef1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1518; --surface: #162127; --fg: #e6edf0; --muted: #9db0b8; --line: #27383f;
    --petrol: #5cb8cf; --petrol-fg: #06212a; --amber: #f0a83a; --ok: #5fc48a; --crit: #f2766b;
    --ok-bg: #163324; --warn-bg: #3a2a10; --crit-bg: #3e1a17; --info-bg: #1b2e36;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
.topo {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.marca { font-weight: 800; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.ponto { width: 12px; height: 12px; border-radius: 50%; background: var(--petrol); display: inline-block; }
.quem { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.link { background: none; border: 0; color: var(--petrol); font: inherit; text-decoration: underline; padding: 4px; }
.teste { background: var(--amber); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; }
body.modo-teste .topo { border-bottom: 3px solid var(--amber); }
main { flex: 1; display: grid; align-content: start; gap: 14px; padding-block: 18px 28px; max-width: 560px; width: 100%; margin: 0 auto; }
h1 { font-size: 24px; margin: 0; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 15px; margin: 18px 0 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0; }
.ajuda, .dica { color: var(--muted); }
.dica { font-size: 15px; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input[type="password"], input[type="text"] {
  width: 100%; font: inherit; font-size: 22px; letter-spacing: .15em; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--fg);
}
form { display: grid; gap: 12px; }
.btn {
  font: inherit; font-weight: 700; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); text-align: left; cursor: pointer; min-height: 56px;
}
.btn.principal { background: var(--petrol); color: var(--petrol-fg); border-color: var(--petrol); text-align: center; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .link:focus-visible, input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.grade { display: grid; gap: 10px; }
.btn.tipo { display: grid; gap: 2px; padding: 16px; }
.btn.tipo strong { font-size: 19px; }
.btn.tipo small { font-weight: 400; color: var(--muted); font-size: 14px; }
.lista { display: grid; gap: 8px; }
.lista .btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lista .btn small { color: var(--muted); font-weight: 400; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.erro { color: var(--crit); font-weight: 600; }
.historico { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.historico li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.historico li .hora { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.historico .vazio { color: var(--muted); border-style: dashed; }
.moldura { background: #000; border-radius: 12px; overflow: hidden; max-height: 48dvh; display: flex; justify-content: center; }
.moldura img { max-width: 100%; max-height: 48dvh; object-fit: contain; display: block; }
.checagens { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checagens li { padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.checagens li::before { content: "●"; font-size: 12px; }
.checagens .ok { background: var(--ok-bg); color: var(--ok); }
.checagens .aviso { background: var(--warn-bg); color: var(--amber); }
.checagens .erro { background: var(--crit-bg); color: var(--crit); }
.acoes { display: grid; gap: 10px; }
.enviando { display: flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--petrol); border-radius: 50%; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
.recibo { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; margin-bottom: 8px; }
.recibo.ok { border-left-color: var(--ok); }
.recibo.revisar { border-left-color: var(--amber); }
.recibo.ruim { border-left-color: var(--crit); }
.recibo .titulo { font-weight: 800; }
.recibo .valor { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.recibo .falta { color: var(--amber); font-weight: 600; }
.recibo .meta { color: var(--muted); font-size: 14px; }
.aviso-geral { padding: 12px 14px; border-radius: 10px; background: var(--info-bg); font-weight: 600; }
.aviso-geral.ruim { background: var(--crit-bg); color: var(--crit); }
.aviso-geral.bom { background: var(--ok-bg); color: var(--ok); }
/* câmera ao vivo com moldura */
.camera { position: relative; background: #000; border-radius: 12px; overflow: hidden; height: 66dvh; min-height: 360px; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.guia {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(74%, 400px); aspect-ratio: 1 / 1.85; max-height: 78%;
  border: 3px solid rgba(255, 255, 255, .85); border-radius: 10px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .48); transition: border-color .2s;
}
.guia.ruim { border-color: #f2766b; }
.guia.quase { border-color: #f0a83a; }
.guia.bom { border-color: #5fc48a; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .48), 0 0 0 4px rgba(95, 196, 138, .35); }
.canto { position: absolute; width: 22px; height: 22px; border: 4px solid #fff; }
.canto.tl { left: -4px; top: -4px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.canto.tr { right: -4px; top: -4px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.canto.bl { left: -4px; bottom: -4px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.canto.br { right: -4px; bottom: -4px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.dica-camera {
  position: absolute; left: 12px; right: 12px; bottom: 12px; text-align: center; font-weight: 700; font-size: 16px;
  color: #fff; background: rgba(0, 0, 0, .62); padding: 10px 12px; border-radius: 10px;
}
.controles-camera { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.controles-camera .link { color: var(--fg); text-decoration: none; font-weight: 600; }
.controles-camera .link:last-child { text-align: right; }
.obturador {
  width: 76px; height: 76px; border-radius: 50%; border: 5px solid var(--fg); background: var(--surface); cursor: pointer; position: relative;
}
.obturador::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--petrol); }
.obturador:active::after { inset: 10px; }
.obturador:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.rodape { color: var(--muted); font-size: 13px; text-align: center; padding-block: 10px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
[hidden] { display: none !important; }
