/* OrçaObra Fácil — azul de planta, amarelo de trena, cinza de concreto. Feito para ler no sol, com luva e pressa. */
:root {
  --planta: #16365C; --planta-fundo: #0F2744; --trena: #FFC61A; --trena-escuro: #E0A800;
  --concreto: #ECEEF1; --branco: #fff; --tinta: #14202E; --cimento: #5F6B79; --risco: #D5DAE0;
  --ok: #17794E; --alerta: #B8420B; --alerta-fundo: #FFF1E6; --perigo: #B3261E;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif; --texto: 'Barlow', system-ui, sans-serif;
  --raio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--concreto); color: var(--tinta); font: 500 17px/1.4 var(--texto); -webkit-tap-highlight-color: transparent; }
h1, h2, p, ul, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
:focus-visible { outline: 3px solid var(--trena-escuro); outline-offset: 2px; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
main { padding: 16px 16px 40px; display: grid; gap: 14px; }
main.com-barra, main:has(+ .barra) { padding-bottom: 120px; }

/* a trena: a marca do app */
.trena { height: 14px; background:
  repeating-linear-gradient(90deg, var(--tinta) 0 1.5px, transparent 1.5px 40px) 0 0 / 100% 9px no-repeat,
  repeating-linear-gradient(90deg, var(--tinta) 0 1px, transparent 1px 8px) 0 0 / 100% 5px no-repeat,
  var(--trena); }

.topo { position: sticky; top: 0; z-index: 5; background: var(--planta); color: #fff; }
.topo-linha { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 6px 16px; }
.topo h1 { font: 700 26px/1.1 var(--display); letter-spacing: .01em; text-transform: uppercase; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volta { color: #fff; display: grid; place-items: center; width: 44px; height: 44px; margin-left: -12px; border-radius: 50%; }
.marca { font: 600 24px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; flex: 1; }
.marca b { color: var(--trena); font-weight: 700; }
.marca.grande { font-size: 44px; }
.link-topo { color: #fff; font-size: 15px; font-weight: 600; text-underline-offset: 4px; padding: 12px 0; }

.secao { font: 700 21px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--planta); margin-top: 10px; }
.dica { color: var(--cimento); font-size: 15px; }
.cartao { background: var(--branco); border-radius: var(--raio); padding: 16px; display: grid; gap: 14px; }

label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--cimento); }
input, select, textarea { font: 500 17px/1.3 var(--texto); color: var(--tinta); width: 100%; min-height: 50px; padding: 11px 12px; border: 1.5px solid var(--risco); border-radius: 10px; background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--planta); box-shadow: 0 0 0 3px #16365c26; }
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.check { grid-template-columns: 30px 1fr; align-items: start; color: var(--tinta); font-size: 16px; }
.check input { width: 26px; height: 26px; min-height: 0; accent-color: var(--planta); margin-top: 2px; }
.check small { display: block; color: var(--cimento); font-weight: 500; }
legend { font-size: 14px; font-weight: 600; color: var(--cimento); margin-bottom: 8px; }
fieldset { display: grid; gap: 8px; }

.botao { font: 600 17px/1 var(--texto); display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 18px; width: 100%; border: 1.5px solid var(--planta); border-radius: 12px; background: var(--branco); color: var(--planta); cursor: pointer; text-decoration: none; }
.botao.principal { background: var(--trena); border-color: var(--trena); color: var(--tinta); font-weight: 700; }
.botao.principal:active { background: var(--trena-escuro); }
.botao.perigo { border-color: transparent; background: none; color: var(--perigo); font-size: 15px; min-height: 44px; }
.botao.pequeno { min-height: 44px; font-size: 15px; width: auto; }
.botao:disabled { opacity: .6; }
.link { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--concreto); color: var(--cimento); font-size: 22px; line-height: 1; cursor: pointer; }

.faixa { display: block; background: #E3EBF5; color: var(--planta); border-left: 5px solid var(--planta); border-radius: 8px; padding: 12px 14px; font-size: 15px; text-decoration: none; }
.faixa.alerta { background: var(--alerta-fundo); color: var(--alerta); border-color: var(--alerta); }
.alerta-txt, .duvida-txt { color: var(--alerta) !important; font-style: normal; font-weight: 600; }

/* listas */
.lista { background: var(--branco); border-radius: var(--raio); overflow: hidden; }
.lista li + li { border-top: 1px solid var(--concreto); }
.linha { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 68px; padding: 12px 14px 12px 16px; background: none; border: 0; text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer; }
.linha > svg { color: var(--risco); }
.linha-texto { flex: 1; min-width: 0; display: grid; gap: 2px; }
.linha-texto b { font-weight: 600; }
.linha small { color: var(--cimento); font-size: 14px; }
.linha-valor { text-align: right; display: grid; gap: 3px; justify-items: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.selo { font-weight: 700; font-size: 12px !important; text-transform: uppercase; letter-spacing: .05em; }
.selo.enviado { color: var(--planta) !important; } .selo.aprovado { color: var(--ok) !important; }
.tem-duvida { box-shadow: inset 5px 0 0 var(--alerta); background: var(--alerta-fundo); }
.total-comodo { display: flex; justify-content: space-between; padding: 12px 16px 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.vazio { background: var(--branco); border-radius: var(--raio); padding: 28px 20px; text-align: center; display: grid; gap: 6px; color: var(--cimento); }
.vazio b { color: var(--tinta); font-size: 19px; }

/* cômodo */
.medidas { background: var(--trena); border-radius: var(--raio); padding: 14px; display: grid; gap: 10px; }
.medidas-campos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.medidas label { color: var(--tinta); font-size: 13px; }
.medidas input { border-color: var(--tinta); font: 700 22px/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.medidas-calc { font-size: 14px; font-weight: 600; }
.captura { background: var(--planta); color: #fff; border-radius: var(--raio); padding: 24px 16px 18px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.captura-estado { font-size: 15px; color: #C9D6E6; } .captura-estado b { color: #fff; font-size: 19px; }
.gravar { width: 104px; height: 104px; border-radius: 50%; border: 0; background: var(--trena); color: var(--tinta); display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 8px #ffffff1f; }
.gravar svg { width: 46px; height: 46px; }
.gravar.gravando { background: #E5352B; color: #fff; animation: pulso 1.2s ease-in-out infinite; }
.gravar.lendo { background: #ffffff1f; box-shadow: none; }
.gira { width: 44px; height: 44px; border-radius: 50%; border: 5px solid #ffffff40; border-top-color: var(--trena); animation: gira .9s linear infinite; }
.foto-nota { background: transparent; border-color: #ffffff66; color: #fff; margin-top: 4px; }
.entendi { font-size: 15px; background: var(--branco); border-radius: 10px; padding: 12px 14px; color: var(--cimento); }
.entendi b { color: var(--tinta); }
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fotos figure { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--risco); }
.fotos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos .x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; background: #14202ecc; color: #fff; }
.mais-foto { aspect-ratio: 4/3; border: 2px dashed var(--cimento); border-radius: 10px; place-items: center; align-content: center; cursor: pointer; }

/* fechamento */
.parcela { display: grid; grid-template-columns: 1fr 72px auto 40px; gap: 6px; align-items: center; }
.parcela input:nth-child(2) { text-align: right; }
.resumo > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.resumo span { color: var(--cimento); }
.resumo-total { border-top: 2px solid var(--tinta); padding-top: 12px; font: 700 28px/1 var(--display); }
.resumo-total span { color: var(--tinta); text-transform: uppercase; }
.barra { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; background: var(--branco); border-top: 1px solid var(--risco); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: center; justify-content: center; }
.barra > * { max-width: 528px; }
.barra-total { display: grid; flex: none; } .barra-total small { color: var(--cimento); font-size: 13px; }
.barra-total b { font: 700 26px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* empresa */
.logo-linha { display: flex; align-items: center; gap: 14px; }
.logo { width: 84px; height: 84px; object-fit: contain; border-radius: 10px; border: 1.5px solid var(--risco); background: #fff; }
.logo.sem { display: grid; place-items: center; font-size: 13px; color: var(--cimento); border-style: dashed; }
.preco { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--concreto); }
.preco > input:first-child { grid-column: 1 / 3; } .preco > select { grid-column: 1 / 3; }
.preco > .x { grid-row: 1; grid-column: 3; }
.conta { font-size: 15px; color: var(--cimento); } .conta b { color: var(--tinta); }

/* login */
.login { padding: 0; gap: 0; min-height: 100dvh; align-content: start; background: var(--planta); }
.login-topo { padding: 56px 24px 28px; color: #C9D6E6; background:
  linear-gradient(#ffffff0d 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, #ffffff0d 1px, transparent 1px) 0 0 / 24px 24px, var(--planta); }
.login-topo .marca { color: #fff; margin-bottom: 8px; }
.login .cartao { margin: 24px 16px; }
.login h1 { font: 700 26px/1 var(--display); text-transform: uppercase; }

/* folha de baixo e avisos */
dialog { border: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; border-radius: 20px 20px 0 0; color: var(--tinta); overflow-y: auto; }
dialog::backdrop { background: #0f274499; }
dialog > * { display: grid; gap: 14px; }
dialog h2 { font: 700 24px/1 var(--display); text-transform: uppercase; }
.folha-botoes { display: flex; gap: 8px; } .folha-botoes .principal { flex: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 16px/1 var(--texto); min-height: 46px; padding: 0 16px; border-radius: 23px; border: 1.5px solid var(--planta); background: #fff; color: var(--planta); cursor: pointer; }
#avisos { position: fixed; left: 12px; right: 12px; bottom: 96px; z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.aviso { background: var(--tinta); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 15px; max-width: 520px; box-shadow: 0 6px 20px #0003; }
.aviso.erro { background: var(--perigo); }

@keyframes pulso { 50% { box-shadow: 0 0 0 16px #e5352b33; } }
@keyframes gira { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .gravar.gravando, .gira { animation-duration: 4s; } }
@media (max-width: 360px) { .dupla { grid-template-columns: 1fr; } body { font-size: 16px; } }
