/* Fontes do site tclaviation.com, hospedadas aqui (a CSP so permite 'self'). Variaveis, subconjunto latino (cobre o portugues). */
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --bg: #ffffff;
  --alt: #f7f5f2;
  --surface: #ffffff;
  --text: #1e1919;
  --muted: #5d5a57;
  --line: #e7e3dd;
  --primary: #0061fe;
  --primary-hover: #0052d6;
  --accent: #0061fe;
  --accent-soft: #e6f0ff;
  --ok: #1b7a46;
  --warn-bg: #fff4d6;
  --warn: #7a5200;
  --err-bg: #fdecec;
  --err: #b42318;
  --radius: 16px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; overflow-x: hidden;
}
h1, h2, h3, .brand { font-family: var(--font-head); }
h1 { font-size: 1.6rem; margin: 0.4em 0 0.3em; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 1.6em 0 0.3em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.center { text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }

.topbar { background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { background: var(--primary); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 0.85rem; letter-spacing: 0.04em; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 6px; }

/* pagina inicial */
.hero { background: var(--alt); border: 1px solid var(--line); border-radius: 16px; padding: 32px 24px; margin-bottom: 20px; }
.hero h1 { font-size: 2.2rem; margin: 0 0 10px; letter-spacing: -0.01em; }
.hero p { margin: 0 0 16px; max-width: 62ch; color: var(--muted); font-size: 1.05rem; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.badges li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 0.9rem; font-weight: 600; }
.search-box { margin: 0 0 14px; }
.search-box input[type=search] {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.search-box input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip { font: inherit; font-size: 0.9rem; font-weight: 600; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-desc { margin: 0 0 12px; color: var(--muted); }
.empty { text-align: center; padding: 32px 0; color: var(--muted); font-size: 1.05rem; }
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 16px; color: var(--muted); font-size: 0.9rem; }

/* grade de cards */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; color: var(--text); text-decoration: none; min-width: 0;
  transition: border-color .15s;
}
a.card:hover, a.card:focus-visible { border-color: var(--accent); }
.card-glyph { width: 40px; height: 40px; border-radius: 8px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; color: var(--accent); margin-bottom: 6px; }
.card-name { font-weight: 600; font-family: var(--font-head); }
.card-desc { color: var(--muted); font-size: 0.9rem; }
.card-off { opacity: .6; }
.badge { align-self: flex-start; margin-top: 6px; font-size: 0.75rem; background: var(--alt); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 1px 10px; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; border-radius: 8px; }

/* formularios */
label { display: block; font-weight: 600; margin: 14px 0 4px; font-size: 0.95rem; }
label.check, label.radio { font-weight: 400; display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { margin-top: 4px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hint { font-size: 0.85rem; color: var(--muted); margin: 4px 0 0; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 18px;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { display: block; width: 100%; margin-top: 16px; }
.btn-sm { padding: 4px 10px; font-size: 0.85rem; }

.alert { border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-ok { background: rgba(27,122,70,.12); color: var(--ok); }

/* painel da ferramenta */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 16px 0; }
.drop {
  border: 2px dashed var(--line); border-radius: 16px; padding: 28px 16px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--surface);
}
.drop.over, .drop:hover { border-color: var(--accent); color: var(--text); }
.drop strong { color: var(--text); }
.files { list-style: none; margin: 12px 0 0; padding: 0; }
.files li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; background: var(--surface); min-width: 0;
}
.files li.dragging { opacity: .4; }
.files li.over { border-color: var(--accent); }
.files .grip { cursor: grab; color: var(--muted); user-select: none; }
.files .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fsize { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.tools-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 260px; }
.pos-grid label { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; text-align: center; cursor: pointer; font-weight: 400; font-size: 0.85rem; display: block; }
.pos-grid input { position: absolute; opacity: 0; pointer-events: none; }
.pos-grid input:checked + span { color: var(--primary); font-weight: 700; }
.pos-grid label:has(input:checked) { border-color: var(--accent); background: var(--alt); }

.meter { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter > div { height: 100%; width: 0; background: var(--err); transition: width .2s, background .2s; }

.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 12px 0 4px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.progress.indeterminate > div { width: 40%; animation: slide 1s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

.thumbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-top: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface); text-align: center; min-width: 0; }
.thumb.dragging { opacity: .4; }
.thumb.over { border-color: var(--accent); }
.thumb-box { height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--alt); border-radius: 4px; cursor: grab; }
.thumb-box canvas { max-width: 100%; max-height: 100%; transition: transform .2s; }
.thumb-num { font-size: 0.8rem; color: var(--muted); margin: 4px 0; }
.thumb-actions { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.thumb-actions .btn { padding: 2px 8px; font-size: 0.85rem; }

.result { margin-top: 16px; }
.result .sizes { font-size: 1.05rem; margin: 6px 0; }

/* telas de acesso */
.auth-body { display: flex; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; height: fit-content; }
.auth-card .brand { margin-bottom: 8px; }
.qr { max-width: 100%; height: auto; background: #fff; border-radius: 8px; }
.secret { word-break: break-all; font-size: 0.95rem; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes li { background: var(--alt); border-radius: 8px; padding: 8px; text-align: center; }
.codes code { font-size: 1.05rem; }

@media (max-width: 520px) {
  h1 { font-size: 1.35rem; }
  .hero { padding: 22px 16px; }
  .hero h1 { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
}

/* ---- PageCanvas (editar, assinar, ocultar, formularios) ---- */
.pc { margin-top: 12px; }
.pc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.pc-label { font-size: 0.9rem; color: var(--muted); min-width: 110px; text-align: center; }
.pc-scroll { overflow: auto; max-height: 85vh; background: var(--alt); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.pc-stage { position: relative; margin: 0 auto; background: #fff; border: 1px solid var(--line); }
.pc-canvas { display: block; }
.pc-overlay { position: absolute; inset: 0; touch-action: pan-x pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.pc-overlay.drawing { touch-action: none; cursor: crosshair; }
.pc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pc-line { pointer-events: stroke; cursor: move; }
.pc-line.sel { filter: drop-shadow(0 0 2px #0061fe); }
.pc-item { position: absolute; box-sizing: border-box; touch-action: none; cursor: move; line-height: 1.2; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; }
.pc-item.sel { outline: 2px solid #0061fe; outline-offset: 1px; overflow: visible; }
.pc-text { padding: 0; outline: 1px dashed rgba(0,97,254,.45); }
.pc-rect { border-style: solid; border-color: #000; }
.pc-erase { outline: 1px dashed #888; }
.pc-image img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pc-redact { outline: 1px dashed #c00; opacity: .85; }
.pc-field { background: rgba(0,97,254,.12); outline: 1px dashed #0061fe; }
.pc-stamp { background: rgba(0,97,254,.1); outline: 2px dashed #0052d6; color: #0052d6; font-size: 0.8rem; }
.pc-ghost { background: rgba(0,97,254,.15); outline: 1px dashed #0061fe; pointer-events: none; }
.pc-tag { position: absolute; left: 2px; top: 1px; font-size: 11px; line-height: 1.1; color: #0052d6; background: rgba(255,255,255,.8); padding: 0 3px; border-radius: 3px; max-width: 95%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.pc-handle { position: absolute; right: -12px; bottom: -12px; width: 24px; height: 24px; background: #0061fe; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; touch-action: none; z-index: 3; }
.pc-handle.pc-pt { right: auto; bottom: auto; margin: -12px 0 0 -12px; cursor: grab; }

.pc-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pc-tools .btn { padding: 6px 12px; }
.pc-tools .btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.prop-panel { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px 12px; margin-top: 8px; background: var(--alt); }
.prop-panel h3 { font-size: 1rem; margin: 10px 0 0; }
.sigpad { display: block; width: 100%; max-width: 480px; height: 160px; background: #fff; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tabs .btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* relatorios (validar assinatura) */
.report { margin-top: 12px; }
.report-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 10px 0; background: var(--surface); }
.report-card.ok { border-left: 6px solid var(--ok); }
.report-card.bad { border-left: 6px solid var(--err); }
.report-card.warn { border-left: 6px solid #c98a00; }
.report dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.report dt { color: var(--muted); }
.report dd { margin: 0; overflow-wrap: anywhere; }
.form-fields label { margin-top: 10px; }

/* ---- Geo (ler PDF georreferenciado, DWG/DXF -> GeoPDF) ---- */
.geo-view { margin-top: 12px; }
.geo-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; cursor: crosshair; }
.geo-readout { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; background: var(--alt); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.geo-readout:empty { display: none; }
.geo-scroll { overflow-x: auto; }
.geo-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.geo-table th, .geo-table td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: middle; white-space: nowrap; }
.geo-table input[type=text] { min-width: 110px; }
.geo-pre { max-height: 220px; overflow: auto; font-size: 0.8rem; background: var(--alt); border: 1px solid var(--line); border-radius: 6px; padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.geo-layers { margin: 6px 0 0; padding-left: 20px; columns: 2; }
.layer-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; background: var(--alt); }
.swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 3px; margin: 3px 4px 0 0; flex: none; }
@media (max-width: 520px) { .geo-layers { columns: 1; } }

/* ---- Conversor de coordenadas ---- */
.coord-texto { width: 100%; min-height: 160px; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 0.92rem; resize: vertical; }
.coord-destinos label.check { flex-wrap: wrap; }
.coord-expl { flex-basis: 100%; margin: 0 0 0 26px; }
.coord-mais { margin-top: 14px; }
.coord-mais summary { cursor: pointer; font-weight: 600; }
.coord-table td, .coord-table th { white-space: nowrap; }
.coord-table .coord-nome { font-weight: 600; }
.coord-table tr.sub td { font-size: 0.8rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 0; }
.coord-val { font-variant-numeric: tabular-nums; }
button.copy { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 4px; margin-left: 4px; font-size: 0.85rem; border-radius: 4px; }
button.copy:hover { color: var(--primary); background: var(--alt); }
.coord-alvo { margin-top: 18px; }
.coord-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.coord-erros { margin: 6px 0 0; padding-left: 20px; }
.coord-erros code { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.coord-export { margin-top: 20px; }
.coord-erro { color: var(--err); }


[hidden] { display: none !important; }

/* Tornar PDF preenchivel */
.pre-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
@media (max-width: 800px) { .pre-wrap { grid-template-columns: minmax(0, 1fr); } }
.pre-side { min-width: 0; }
.pre-list { list-style: none; margin: 8px 0; padding: 0; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pre-list button { display: flex; width: 100%; gap: 6px; align-items: center; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; cursor: pointer; min-height: 40px; }
.pre-list button.sel { background: rgba(0,97,254,.14); }
.pre-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-badge { font-size: .72rem; border-radius: 10px; padding: 1px 7px; color: #fff; flex: none; }
.pre-badge.pre-texto { background: #0061fe; } .pre-badge.pre-data { background: #7b3fb8; }
.pre-badge.pre-checkbox { background: #1f8a4c; } .pre-badge.pre-radio { background: #d4730c; }
.pc-item.pre-texto { background: rgba(0,97,254,.16); outline: 1px solid #0061fe; }
.pc-item.pre-data { background: rgba(123,63,184,.16); outline: 1px solid #7b3fb8; }
.pc-item.pre-checkbox { background: rgba(31,138,76,.2); outline: 1px solid #1f8a4c; }
.pc-item.pre-radio { background: rgba(212,115,12,.2); outline: 1px solid #d4730c; }
.pc-item.pre-low { outline-style: dashed; }
.pc-item.pre-off { opacity: .3; filter: grayscale(1); }
.pc-item.sel { outline: 2px solid #0061fe; }
.pre-filters { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pre-filters label.check { margin: 2px 0; }

/* PDF para DWG */
.pdw-box { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pdw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pc-item.pdw-pt { background: rgba(212,0,0,.22); border: 2px solid #d40000; border-radius: 50%; }
.pc-item.pdw-pt .pc-tag { color: #d40000; font-weight: 700; }

/* Fase 4: previa da traducao e resumo renderizado */
.preview { white-space: pre-wrap; max-height: 260px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.9rem; }
.md h3, .md h4, .md h5 { margin: 14px 0 6px; }
.md p, .md ul, .md ol { margin: 6px 0; }
.md ul, .md ol { padding-left: 22px; }

/* Girar PDF: grade de miniaturas com rotacao ao vivo */
.girar-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.girar-titulo { font-size: 1rem; margin: 16px 0 6px; overflow-wrap: anywhere; }
.girar-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.girar-card { border: 1px solid var(--line); border-radius: 16px; padding: 8px; background: var(--surface); min-width: 0; }
.girar-box { aspect-ratio: 1 / 1; padding: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--alt); border-radius: 10px; cursor: pointer; }
.girar-box canvas { max-width: 100%; max-height: 100%; transition: transform .2s; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.girar-box.girada { outline: 2px solid var(--accent); }
.girar-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 6px; }
.girar-foot .btn { padding: 2px 10px; font-size: 1rem; }
.girar-num { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.girar-badge { font-weight: 600; }
.girar-badge.on { color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 0 6px; }
@media (max-width: 480px) { .girar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Acabamento "macio" (cantos generosos, sombra suave, botoes em pilula) ---------- */
:root { --r-card: 20px; --r-field: 12px; --shadow-1: 0 1px 2px rgba(30, 25, 25, .04), 0 4px 16px rgba(30, 25, 25, .05); --shadow-2: 0 2px 6px rgba(30, 25, 25, .06), 0 12px 32px rgba(30, 25, 25, .08); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3 { letter-spacing: -0.02em; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }
.brand-mark { border-radius: 10px; }
.hero { border: 0; border-radius: 28px; padding: 48px 32px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.hero p { font-size: 1.15rem; }
.badges li { border-color: transparent; box-shadow: var(--shadow-1); }
.search-box input[type=search] { border-radius: 999px; padding: 16px 24px; font-size: 1.05rem; box-shadow: var(--shadow-1); }
.chip { padding: 6px 16px; }
.chip:hover { background: var(--accent-soft); border-color: transparent; }
.grid { gap: 16px; }
.card { border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow-1); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: transparent; }
.card-glyph { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 10px; }
.panel, .report-card, .auth-card { border-radius: var(--r-card); box-shadow: var(--shadow-1); }
.drop { border-radius: var(--r-card); }
.btn { border-radius: 999px; padding: 10px 20px; font-weight: 600; transition: background-color .15s ease, border-color .15s ease, transform .1s ease; }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 5px 12px; }
input[type=text], input[type=password], input[type=number], select, textarea { border-radius: var(--r-field); }
.alert, .geo-readout, .prop-panel, .pc-scroll, .sigpad, .thumb, .pos-grid label { border-radius: var(--r-field); }
.girar-card { border-radius: var(--r-card); box-shadow: var(--shadow-1); }
.girar-box { border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } a.card:hover { transform: none; } }

/* ---------- Menu do topo (atalhos + Converter + Todas as ferramentas) ---------- */
.topbar-in { position: relative; gap: 16px; }
.nav-main { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav-wrap { position: static; }
.nav-item { font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text); text-decoration: none; background: none; border: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-item:hover, .nav-item[aria-expanded="true"] { background: var(--alt); }
.nav-item.is-atual { color: var(--accent); }
.nav-caret { font-size: 0.75rem; transition: transform .15s ease; }
.nav-item[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-painel { position: absolute; left: 16px; right: 16px; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-2); padding: 24px; display: grid; gap: 8px 24px; z-index: 30; max-height: calc(100vh - 96px); overflow: auto; }
.nav-painel[hidden] { display: none; }
.nav-painel-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.nav-painel-mega { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.nav-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-col-titulo { font-family: var(--font-head); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 6px; }
.nav-tool { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 0.93rem; min-width: 0; }
.nav-tool:hover { background: var(--alt); }
.nav-tool.is-atual { background: var(--accent-soft); color: var(--accent); }
.nav-glyph { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.nav-tool-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-burger { display: none; flex: none; width: 40px; height: 40px; border: 0; background: none; border-radius: 12px; cursor: pointer; padding: 10px 9px; flex-direction: column; justify-content: space-between; }
.nav-burger:hover { background: var(--alt); }
.nav-burger span { display: block; height: 2px; border-radius: 2px; background: var(--text); }
@media (max-width: 900px) {
  .nav-burger { display: flex; }
  .topbar-in { flex-wrap: wrap; }
  .nav-main { display: none; order: 9; flex-basis: 100%; flex-direction: column; align-items: stretch; padding: 8px 0 12px; }
  body.nav-aberto .nav-main { display: flex; }
  .nav-item { justify-content: space-between; border-radius: 12px; }
  .nav-painel { position: static; box-shadow: none; border: 0; padding: 4px 0 8px; max-height: none; grid-template-columns: 1fr; max-width: none; border-radius: 0; }
}
.topbar .link-btn { font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); text-decoration: none; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.topbar .link-btn:hover { background: var(--alt); }

/* ===================== Direção final: cinza + azul-marinho (Apple × Samsung) ===================== */
:root {
  --bg: #eceef2;            /* cinza da página */
  --alt: #e2e5ea;           /* cinza um tom abaixo (faixas, caixas de miniatura) */
  --surface: #f7f8fa;       /* cartões: cinza quase claro, sem branco puro */
  --text: #151b26;
  --muted: #586273;
  --line: #d6dbe2;
  --primary: #1b3566;       /* azul-marinho */
  --primary-hover: #132849;
  --accent: #1b3566;
  --accent-soft: #dfe5f0;
  --navy-deep: #0f1f3d;
  --shadow-1: 0 1px 2px rgba(15, 31, 61, .05), 0 6px 20px rgba(15, 31, 61, .06);
  --shadow-2: 0 2px 8px rgba(15, 31, 61, .08), 0 18px 40px rgba(15, 31, 61, .12);
}
::selection { background: #c9d4e8; color: var(--navy-deep); }
html { scrollbar-color: #b9c1cd transparent; }
a { color: var(--primary); text-underline-offset: 3px; }

/* topo: transparente no início, vidro cinza ao rolar */
.topbar { background: transparent; border-bottom: 1px solid transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background-color .25s ease, border-color .25s ease, backdrop-filter .25s ease; }
body.rolou .topbar { background: rgba(236, 238, 242, .72); border-bottom-color: rgba(21, 27, 38, .08); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.brand-mark { background: var(--primary); }

/* apresentação em azul-marinho */
.hero { background: var(--navy-deep); color: #eef2f8; }
.hero h1 { color: #fff; }
.hero p { color: #b8c4d8; }
.badges li { background: rgba(255, 255, 255, .08); color: #e3e9f3; border: 1px solid rgba(255, 255, 255, .14); box-shadow: none; }

/* busca e chips */
.search-box input[type=search] { background: var(--surface); border-color: var(--line); }
.search-box input[type=search]:focus { outline: 3px solid rgba(27, 53, 102, .25); outline-offset: 0; border-color: var(--primary); }
.chip { background: var(--surface); }
.chip:hover { background: var(--accent-soft); color: var(--primary); }

/* cartões */
.card { background: var(--surface); border-color: transparent; }
a.card:hover { background: #fbfcfd; }
.card-glyph { background: var(--accent-soft); color: var(--primary); }

/* botões: primário marinho, secundário cinza sem borda */
.btn { background: var(--alt); border-color: transparent; color: var(--text); }
.btn:hover { background: #d7dbe2; border-color: transparent; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 31, 61, .2), 0 6px 16px rgba(27, 53, 102, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: 3px solid rgba(27, 53, 102, .35); outline-offset: 2px; }
.btn[disabled] { background: #d3d8e0; color: #8a93a2; box-shadow: none; opacity: 1; }

/* voltar */
.btn-back { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 12px; padding: 7px 16px 7px 12px; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.9rem; text-decoration: none; box-shadow: var(--shadow-1); transition: background-color .15s ease, transform .15s ease; }
.btn-back:hover { background: #fbfcfd; transform: translateX(-2px); }
.btn-back svg { color: var(--primary); }

/* telas das ferramentas */
.panel { background: var(--surface); border-color: transparent; }
.drop { background: var(--bg); border: 2px dashed #c3cad5; }
.drop.over, .drop:hover { background: var(--accent-soft); border-color: var(--primary); }
input[type=text], input[type=password], input[type=number], select, textarea { background: #fff0; background-color: var(--bg); border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(27, 53, 102, .25); outline-offset: 0; border-color: var(--primary); }
.girar-card { background: var(--surface); border-color: transparent; }
.girar-box { background: var(--alt); }
.girar-box.girada { outline-color: var(--primary); }
.topbar .link-btn { border-color: var(--line); background: var(--surface); }
.nav-painel { background: rgba(247, 248, 250, .92); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border-color: rgba(21, 27, 38, .08); }
.nav-item:hover, .nav-item[aria-expanded="true"] { background: rgba(21, 27, 38, .06); }
.nav-tool:hover { background: rgba(21, 27, 38, .05); }
.site-foot, footer { color: var(--muted); }

/* ===== Ícones SVG, área de envio e lista de arquivos ===== */
svg.icon { width: 1em; height: 1em; display: block; }
.card-glyph svg.icon { width: 24px; height: 24px; }
.nav-glyph svg.icon { width: 18px; height: 18px; }
.nav-glyph { color: var(--primary); }
.tool-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 6px; }
.tool-head h1 { margin: 0; }
.tool-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.tool-ico svg.icon { width: 26px; height: 26px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 20px; border: 2px dashed rgba(27, 53, 102, .25); background: var(--surface); }
.drop.over { border-color: var(--primary); background: var(--accent-soft); }
.drop-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.drop-ico svg.icon { width: 40px; height: 40px; }
.drop-title { font-family: 'Schibsted Grotesk', 'Hanken Grotesk', system-ui, sans-serif; font-size: 1.15rem; color: var(--text); }
.drop-or { color: var(--muted); font-size: .9rem; }
.drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.drop-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.drop-actions .btn svg.icon { width: 18px; height: 18px; }
.files li { background: var(--alt); border: 0; border-radius: 14px; padding: 10px 14px; gap: 12px; }
.files .fico { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.files .fico svg.icon { width: 18px; height: 18px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(21, 27, 38, .07); color: var(--text); }

/* ---------- Rodapé completo ---------- */
.foot { margin-top: 64px; background: var(--navy-deep); color: #b8c4d8; }
.foot a { color: #e3e9f3; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot-in { padding-top: 48px; padding-bottom: 28px; }
.foot-top { display: grid; gap: 32px; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
.foot-marca p { margin: 12px 0 0; max-width: 42ch; line-height: 1.55; font-size: 0.95rem; }
.foot .brand { color: #fff; }
.foot .brand-mark { background: #fff; color: var(--navy-deep); }
.foot-selo { color: #8fa0bd; font-size: 0.88rem !important; }
.foot-titulo { font-family: var(--font-head); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8fa0bd; margin-bottom: 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.95rem; }
.foot-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 0.85rem; color: #8fa0bd; }
@media (max-width: 760px) { .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-marca { grid-column: 1 / -1; } }

/* ---------- Páginas legais ---------- */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); margin: 8px 0 4px; }
.legal-data { color: var(--muted); margin: 0 0 24px; font-size: 0.9rem; }
.legal h2 { font-size: 1.15rem; margin: 32px 0 8px; }
.legal p, .legal li { line-height: 1.65; color: #2a3242; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }

/* ---------- Carrossel do topo (troca suave, não atrapalha o uso) ---------- */
.promo { position: relative; overflow: hidden; padding: 0; min-height: 300px; display: grid; }
.promo-slide { grid-area: 1 / 1; padding: 48px 32px 64px; opacity: 0; visibility: hidden; transition: opacity .8s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .8s; position: relative; display: flex; flex-direction: column; justify-content: center; }
.promo-slide.is-on { opacity: 1; visibility: visible; transition: opacity .8s cubic-bezier(.2, .7, .2, 1), visibility 0s; }
.promo-slide > p { margin: 0 0 16px; max-width: 58ch; color: #b8c4d8; font-size: 1.1rem; }
.promo-titulo { font-family: var(--font-head); font-weight: 700; color: #fff !important; font-size: clamp(1.8rem, 3.6vw, 2.6rem) !important; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 12px !important; }
.promo-foto { padding: 0; }
.promo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% 45%; }
.promo-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 31, 61, .96) 0%, rgba(15, 31, 61, .85) 38%, rgba(15, 31, 61, .2) 75%, rgba(15, 31, 61, 0) 100%); }
.promo-txt { position: relative; z-index: 1; padding: 48px 32px 64px; max-width: 560px; }
.promo-txt p { margin: 0 0 16px; color: #c9d3e3; font-size: 1.1rem; }
.btn-claro { background: #fff; color: var(--navy-deep); box-shadow: none; align-self: flex-start; }
.btn-claro:hover { background: #e9edf4; }
.promo-dots { position: absolute; left: 32px; bottom: 22px; display: flex; gap: 8px; z-index: 2; }
.promo-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .35); cursor: pointer; transition: width .3s ease, background-color .3s ease; }
.promo-dot.is-on { width: 28px; background: #fff; }
.promo-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 640px) { .promo-slide, .promo-txt { padding: 32px 20px 56px; } .promo-dots { left: 20px; } .promo-foto::after { background: rgba(15, 31, 61, .82); } }
@media (prefers-reduced-motion: reduce) { .promo-slide, .promo-slide.is-on { transition: none; } }
