/* BETUMINOSOS — folha de estilo única.
   Os textos já são escritos em caixa alta no HTML; não se usa text-transform,
   para preservar a grafia técnica das unidades (m, cm, m², m³, kg, t). */

:root {
  --navy: #142d40;
  --navy-forte: #193d51;
  --navy-claro: #173c51;
  --ambar: #f7bc42;
  --fundo: #f6f8fa;
  --texto: #162e40;
  --texto-suave: #526875;
  --borda: #dce4e9;
  --borda-campo: #b9c7d0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #eef2f5;
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3 { margin: 0; }
p { margin: 0 0 10px; }
.oculto { display: none !important; }

button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #2895ba; outline-offset: 3px; }

/* ------------------------------------------------------------- estruturas */

.tela-carregando {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--texto-suave);
  letter-spacing: 1px;
}

.tela-acesso, .tela-termo {
  max-width: 660px;
  min-height: 100vh;
  margin: auto;
  padding: 24px 18px;
  background: var(--fundo);
}

.cartao-topo {
  background: var(--navy);
  border-bottom: 4px solid var(--ambar);
  border-radius: 10px 10px 0 0;
  color: #fff;
  padding: 22px;
}
.cartao-topo strong { letter-spacing: 2px; font-size: 17px; }
.cartao-topo p { color: #bfced8; font-size: 12px; margin: 8px 0 0; }

.cartao {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 0 0 10px 10px;
  padding: 24px;
}
.cartao h1 { font-size: 21px; font-weight: 700; line-height: 1.3; margin: 0 0 20px; }

.abas-acesso {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: #e4ebf0;
  border-radius: 9px;
  padding: 5px;
  margin-bottom: 22px;
}
.aba-acesso {
  border: 0;
  background: transparent;
  border-radius: 6px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 600;
  color: #4a6474;
}
.aba-acesso.ativa { background: #fff; color: var(--navy-forte); box-shadow: 0 1px 4px #172e4015; }

.form-acesso .primary { margin-top: 6px; }

.link {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--navy-forte);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
}

/* ----------------------------------------------------------------- termo */

#termo-texto p { font-size: 14px; line-height: 1.7; margin-bottom: 18px; }

.termo-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-top: 1px solid var(--borda);
  margin: 12px 0 18px;
  padding: 18px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.termo-check input {
  width: 22px; height: 22px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--navy-forte);
}

/* ------------------------------------------------------------ aplicativo */

.app {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: auto;
  padding-bottom: 15px;
  background: var(--fundo);
  box-shadow: 0 0 65px #193d5110;
}

/* CABEÇALHO
   Linha 1: símbolo e nome à esquerda, "VERSÃO 1.0" à direita, com a
   primeira linha da versão alinhada à linha do nome do aplicativo.
   Linha 2: crédito do desenvolvedor abaixo de todo o conjunto do logo. */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 16px;
  row-gap: 12px;
  background: var(--navy);
  border-bottom: 4px solid var(--ambar);
  color: #fff;
  padding: 20px 22px;
}
.masthead .version {
  grid-area: 1 / 2;
  justify-self: end;
  text-align: right;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: .5px;
}
.masthead .version .rotulo {
  display: block;
  font-size: 12px;
  line-height: 22px;          /* casa com a linha de "BETUMINOSOS" */
  color: #bfced8;
}
.masthead .version b {
  display: block;
  font-size: 21px;
  line-height: 1.15;
  color: var(--ambar);
}
.masthead .brand {
  grid-area: 1 / 1;
  justify-self: start;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 43px; height: 43px;
  flex-shrink: 0;
  border: 1px solid #486072;
  border-radius: 9px;
  color: var(--ambar);
}
.brand-texto { min-width: 0; text-align: left; }
.brand-texto strong {
  display: block;
  font-size: 17px;
  line-height: 22px;
  letter-spacing: 2px;
  overflow-wrap: anywhere;
}
.brand-sub {
  display: block;
  margin-top: 2px;
  color: #bfced8;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.brand-credit {
  grid-column: 1 / -1;
  margin: 0;
  text-align: left;
  color: #bfced8;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.barra-conta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 22px;
  background: #e8eef2;
  border-bottom: 1px solid var(--borda);
  color: #3d5666;
  font-size: 13px;
}
#conta-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-conta .link { width: auto; flex-shrink: 0; margin: 0; padding: 4px 0; font-size: 13px; }

.intro { padding: 26px 22px 20px; }
.eyebrow { letter-spacing: 1.6px; color: var(--texto-suave); font-size: 12px; font-weight: 700; margin: 0 0 10px; }
.intro h1 { font-size: 33px; font-weight: 700; line-height: 1.12; letter-spacing: -1px; margin: 0 0 12px; }
.intro > p:last-child { color: #536977; font-size: 15px; margin: 0; }

.main-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 0 20px 14px;
  padding: 5px;
  background: #e4ebf0;
  border-radius: 9px;
}
.tab {
  border: 0;
  background: transparent;
  border-radius: 6px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: #4a6474;
}
.tab.ativa { background: #fff; color: var(--navy-forte); box-shadow: 0 1px 4px #172e4015; }
.count { background: #e5ecf0; border-radius: 4px; padding: 0 6px; font-size: 12px; }
.tab.ativa .count { background: #eef3f6; }

.panel {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 12px;
  margin: 0 20px 16px;
  padding: 22px;
}
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.section-title > span {
  display: grid; place-items: center;
  min-width: 30px; height: 30px;
  background: #edf3f6; border-radius: 5px;
  color: #537481; font: 700 13px monospace;
}
.section-title h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.section-help { color: var(--texto-suave); font-size: 14px; margin: -12px 0 20px; }

/* ---------------------------------------------------------------- campos */

.field { margin-bottom: 18px; min-width: 0; }
.field label { display: block; margin-bottom: 7px; color: #364e5d; font-size: 13.5px; font-weight: 600; }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--borda-campo);
  border-radius: 6px;
  color: var(--texto);
  font-size: 16px;
  font-family: inherit;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #537481 50%), linear-gradient(135deg, #537481 50%, transparent 50%); background-position: right 18px center, right 12px center; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.field input:focus, .field select:focus { outline: 2px solid #2684a4; outline-offset: 1px; }
.required { color: #ad6200; }
.hint { color: #596f7b; font-size: 13px; line-height: 1.5; margin: 7px 0 0; }
.notice {
  background: #fff7e5;
  border-left: 3px solid #dfa12c;
  color: #715319;
  font-size: 14px;
  line-height: 1.55;
  margin: 4px 0 0;
  padding: 12px;
}
.feedback { color: #225d66; font-size: 14px; margin: 12px 0 0; }
.feedback:empty { display: none; }
.feedback.erro { color: #9a2b1f; }

.primary, .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}
.primary { width: 100%; background: var(--navy-forte); border: 1px solid var(--navy-forte); color: #fff; }
.primary:hover:not(:disabled) { background: #235672; }
.secondary { background: #fff; border: 1px solid var(--borda-campo); color: var(--navy-forte); }
.wide { width: 100%; margin-top: 10px; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* -------------------------------------------------------------- resultado */

.geometry-summary {
  display: flex; flex-direction: column; gap: 2px;
  background: #edf4f7;
  border-left: 3px solid #38758c;
  border-radius: 0 6px 6px 0;
  margin: 6px 0 20px;
  padding: 16px 18px;
}
.geometry-summary span { color: #557180; font-size: 13px; }
.geometry-summary strong { font-size: 21px; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.geometry-summary strong:last-child { margin-bottom: 0; }

.result {
  background: var(--navy-claro);
  border-top: 4px solid var(--ambar);
  border-radius: 12px;
  color: #fff;
  margin: 0 20px 14px;
  padding: 24px;
}
.result .eyebrow { color: #c1d2dc; }
.big-number {
  font-size: 40px; font-weight: 700; line-height: 1.2;
  letter-spacing: -1px; overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.big-number span { color: #b6cdd9; font-size: 22px; font-weight: 400; }
.result > p { color: #cedee6; margin: 5px 0 20px; }
.result-line {
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid #ffffff22;
  margin-top: 12px; padding-top: 12px;
}
.result-line span { color: #bfd0da; font-size: 13px; }
.result-line strong { font-size: 19px; font-weight: 600; }

.empty-result {
  display: flex; align-items: center; gap: 15px;
  border: 1px dashed #acbec9; border-radius: 12px;
  color: #5b7180; margin: 0 20px 16px; padding: 22px;
}
.empty-result p { margin: 0; font-size: 14px; }

.painting-result {
  background: #eaf2f6;
  border: 1px solid #c1d7e2;
  border-radius: 10px;
  margin: 0 20px 16px;
  padding: 20px;
}
.painting-result > strong { display: block; font-size: 28px; font-weight: 700; }
.painting-result p { color: #486776; font-size: 14px; margin: 8px 0; }
.combined { display: flex; flex-direction: column; border-top: 1px solid #c1d7e2; margin-top: 14px; padding-top: 14px; font-size: 14px; }
.combined b { font-size: 22px; }

details { border-top: 1px solid #e0e7eb; border-bottom: 1px solid #e0e7eb; margin: 8px 0 20px; padding: 12px 0; }
summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.memory { color: #506675; margin: 0 22px 24px; }
.memory p { font-size: 13.5px; }

.micro-note {
  background: #eef3f6; border-radius: 8px;
  color: #476573; font-size: 14px;
  margin: 0 22px 20px; padding: 14px;
}

/* -------------------------------------------------------------- histórico */

.exports button, .exports a { min-height: 48px; }
.file-ready {
  display: flex; flex-direction: column; gap: 8px;
  background: #eef5f8; border: 1px solid #bfd4df; border-radius: 8px;
  margin-top: 16px; padding: 16px;
}
.file-ready > strong { font-size: 14px; overflow-wrap: anywhere; }
.file-ready > span { color: var(--texto-suave); font-size: 13px; }
.file-ready a { text-decoration: none; }
.file-ready .file-open { text-align: center; margin-top: 6px; font-size: 14px; text-decoration: underline; color: var(--navy-forte); }

.report-heading { margin: 22px 22px 16px; }
.report-heading h2 { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.report-heading p { margin-top: 6px; }

.empty {
  border: 1px dashed #bbcbd4; border-radius: 12px;
  color: #516976; margin: 0 20px 20px; padding: 30px 20px; text-align: center;
}
.empty h3 { font-size: 17px; font-weight: 600; }
.empty p { font-size: 14px; }

.record {
  background: #fff; border: 1px solid #d7e0e6; border-radius: 10px;
  margin: 0 20px 16px; padding: 20px; overflow-wrap: anywhere;
}
.record-top { display: flex; align-items: center; justify-content: space-between; color: #576c79; font-size: 14px; }
.pill { background: #e8f0f5; border-radius: 4px; color: #245169; font-size: 12px; font-weight: 600; letter-spacing: .4px; padding: 4px 8px; }
.record h3 { font-size: 21px; font-weight: 700; line-height: 1.2; margin: 14px 0 3px; }
.record-name { color: #5a7180; font-size: 15px; margin: 0 0 18px; }
.record dl { margin: 0; }
.record dt { color: #687e8a; font-size: 12px; letter-spacing: .5px; margin-top: 14px; }
.record dd { font-size: 14px; margin: 3px 0 0; }
.record footer { border-top: 1px solid #e4eaee; color: #617885; font-size: 12px; margin-top: 18px; padding-top: 14px; }
.next-service {
  background: #fff5dc; border-radius: 5px; color: #705113;
  font-size: 13px; margin-top: 18px; padding: 12px;
}

.app-footer { color: #68808d; font-size: 12px; line-height: 1.7; padding: 18px 22px; text-align: center; }

/* ------------------------------------------------------------ responsivo */

.rotate { display: none; }

@media (max-width: 400px) {
  .masthead { padding: 18px 16px; column-gap: 10px; }
  .brand-icon { width: 38px; height: 38px; }
  .masthead .brand { gap: 9px; }
  .brand-texto strong { font-size: 15px; letter-spacing: 1px; }
  .brand-sub { font-size: 12px; }
  .panel, .record, .result, .painting-result { margin-left: 12px; margin-right: 12px; }
  .panel, .record { padding: 17px; }
  .intro { padding: 22px 16px 18px; }
  .intro h1 { font-size: 29px; }
  .big-number { font-size: 34px; }
  .main-tabs { margin-left: 12px; margin-right: 12px; }
}

@media (max-width: 330px) {
  .masthead { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .masthead .brand { grid-area: auto; justify-self: start; }
  .masthead .version { grid-area: auto; justify-self: start; text-align: left; }
  .masthead .version .rotulo { line-height: 1.4; }
  .brand-texto, .brand-credit { text-align: left; }
}

@media (orientation: landscape) and (max-height: 500px) and (hover: none) {
  .app, .tela-acesso, .tela-termo, .tela-carregando { display: none !important; }
  .rotate {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100dvh; padding: 24px; text-align: center;
    background: var(--navy); color: #fff;
  }
  .rotate h1 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
}

@page { size: A4 portrait; margin: 16mm; }

@media print {
  body { background: #fff; font-size: 12px; }
  .app { max-width: none; box-shadow: none; background: #fff; padding: 0; }
  .rotate, .no-print, .app-footer { display: none !important; }
  .masthead { background: #fff; color: var(--navy); border-bottom: 2px solid var(--navy); padding: 0 0 12px; }
  .brand-sub, .brand-credit { color: var(--texto-suave); }
  .record { border: 1px solid #aab9c1; break-inside: avoid; margin: 0 0 18px; padding: 16px; }
  .panel, .result, .painting-result { margin-left: 0; margin-right: 0; }
}
