/* =====================================================
   ANAGRAMA · Calculadora de Custo de Obra — estilos
   Marca: sage · papel · grafite · geometria triangular
   ===================================================== */

:root {
  --sage: #9CA8A2;
  --sage-deep: #6F7E77;
  --sage-mist: #EEF1EF;
  --ink: #2B3230;
  --ink-soft: #5A625F;
  --paper: #FAFAF8;
  --card: #FFFFFF;
  --line: #E2E6E3;
  --danger: #B3452F;
  --radius: 14px;
  --shadow-soft: 0 1px 2px rgba(43,50,48,.05), 0 8px 24px rgba(43,50,48,.06);
  --shadow-lift: 0 2px 4px rgba(43,50,48,.06), 0 14px 34px rgba(43,50,48,.10);
  --font-display: "Josefin Sans", "Segoe UI", sans-serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22,.82,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  touch-action: manipulation;
}

/* ---------- motivo geométrico de fundo ---------- */
.bg-motif {
  position: fixed;
  width: min(38vw, 300px);
  color: var(--sage);
  opacity: .16;
  pointer-events: none;
  z-index: 0;
}
.bg-motif--tl { top: -20px; left: -20px; }
.bg-motif--br { bottom: -20px; right: -20px; }

/* ---------- casca ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.brand { text-align: center; margin-bottom: 28px; }
.brand__logo {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  letter-spacing: .42em;
  margin-right: -.42em; /* compensa tracking no centro */
  color: var(--ink);
}
.brand__sub {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: .18em;
  margin-right: -.18em;
  color: var(--sage-deep);
  text-transform: lowercase;
}

/* ---------- progresso ---------- */
.progress { margin-bottom: 28px; }
.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.progress__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  color: var(--sage-deep);
  background: none;
  border: none;
  min-height: 44px;
  padding: 0 6px;
  cursor: pointer;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s var(--ease);
}
.progress__back:hover { color: var(--ink); }
.progress__track {
  height: 3px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--sage-deep);
  border-radius: 99px;
  transition: width .45s var(--ease);
}

/* ---------- etapas ---------- */
.step {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: step-in .35s var(--ease) both;
}
.step.is-active { display: flex; }
.step.is-leaving { animation: step-out .22s ease-in both; }

@keyframes step-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes step-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-14px); }
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(34px, 8vw, 46px);
  line-height: 1.15;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lede { font-size: 17px; color: var(--ink-soft); }
.lede strong { color: var(--ink); font-weight: 600; }

.fineprint { font-size: 13.5px; color: var(--ink-soft); }
.fineprint--center { text-align: center; margin-top: 4px; }

.question {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 6vw, 30px);
  line-height: 1.3;
  letter-spacing: .03em;
}
.question__hint { font-size: 15px; color: var(--ink-soft); margin-top: -8px; }

/* ---------- opções (cards) ---------- */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.options--stack { grid-template-columns: 1fr; }
@media (max-width: 480px) { .options { grid-template-columns: 1fr; } }

.option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  font-family: var(--font-body);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  min-height: 64px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.option:hover { transform: translateY(-2px); border-color: var(--sage); box-shadow: var(--shadow-lift); }
.option:active { transform: scale(.98); }
.option.is-selected { border-color: var(--sage-deep); background: var(--sage-mist); }

.option__icon { width: 30px; height: 30px; color: var(--sage-deep); margin-bottom: 2px; }
.option__label { font-weight: 600; font-size: 15.5px; color: var(--ink); line-height: 1.35; }
.option__hint { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  min-height: 48px;
  width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(111,126,119,.18);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field textarea { resize: vertical; line-height: 1.55; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236F7E77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.field input[type="file"] {
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
}
.field input[type="file"]::file-selector-button {
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-deep);
  background: var(--sage-mist);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  margin-right: 12px;
  cursor: pointer;
}
.field__help { font-size: 13px; color: var(--ink-soft); }
.field__error {
  display: none;
  font-size: 13px;
  color: var(--danger);
}
.field input[aria-invalid="true"] ~ .field__error { display: block; }

#form-contato, #form-briefing { display: flex; flex-direction: column; gap: 16px; }

.thanks__icon { width: 64px; height: 64px; color: var(--sage-deep); }

.fallback {
  border-left: 3px solid var(--danger);
  background: #FBF1EE;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px;
  font-size: 14.5px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta-card__alt {
  font-size: 13.5px;
  text-align: center;
  color: #AEB9B3;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.cta-card__alt:hover { color: #fff; }

/* área */
.area-input {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}
.area-input input {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 64px;
  width: 3.2ch;
  text-align: right;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--line);
  transition: border-color .2s var(--ease);
}
.area-input input:focus { outline: none; border-color: var(--sage-deep); }
.area-input__unit {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  color: var(--sage-deep);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--line);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sage-deep);
  border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
  transition: transform .15s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--sage-deep); border: 3px solid #fff;
  box-shadow: var(--shadow-soft);
}
input[type="range"]:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 6px; }

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

/* ---------- botões ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  min-height: 52px;
  padding: 16px 24px 14px;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn--primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { background: #1E2422; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn--primary:active { transform: scale(.98); }
.btn--primary:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--sage); color: var(--ink); }
.btn:focus-visible { outline: 3px solid var(--sage-deep); outline-offset: 2px; }

/* ---------- resultado ---------- */
.result-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.result-range {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.result-range__value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(30px, 7.5vw, 44px);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.result-range__sep { color: var(--sage-deep); flex: none; }

.result-permsq { font-size: 14px; color: var(--ink-soft); }

.result-block {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.result-block__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 14px;
}

/* composição — barras */
.compo { display: flex; flex-direction: column; gap: 12px; }
.compo__row { display: flex; flex-direction: column; gap: 5px; }
.compo__meta {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}
.compo__pct { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.compo__track { height: 8px; background: var(--sage-mist); border-radius: 99px; overflow: hidden; }
.compo__fill {
  height: 100%;
  width: 0%;
  background: var(--sage-deep);
  border-radius: 99px;
  transition: width .8s var(--ease);
}
.compo__row:nth-child(2) .compo__fill { background: var(--sage); }
.compo__row:nth-child(3) .compo__fill { background: #B9C2BC; }
.compo__row:nth-child(4) .compo__fill { background: #CDD5D0; }

/* fatores */
.fatores { list-style: none; counter-reset: fator; display: flex; flex-direction: column; gap: 16px; }
.fatores li { counter-increment: fator; display: flex; gap: 14px; }
.fatores li::before {
  content: counter(fator, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 24px;
  color: var(--sage);
  line-height: 1.1;
  flex: none;
}
.fatores h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.fatores p { font-size: 14px; color: var(--ink-soft); }

.renova {
  border-left: 3px solid var(--sage-deep);
  background: var(--sage-mist);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  font-size: 14.5px;
}

.culture {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: .04em;
  text-align: center;
  color: var(--sage-deep);
  padding: 8px 12px;
}

.cta-card {
  background: var(--ink);
  color: #F3F5F4;
  border-radius: var(--radius);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lift);
}
.cta-card__kicker {
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage);
}
.cta-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: .03em;
  line-height: 1.3;
}
.cta-card__text { font-size: 14.5px; color: #C9D0CC; }
.cta-card__text strong { color: #fff; }
.cta-card .btn--primary { background: var(--sage); color: var(--ink); }
.cta-card .btn--primary:hover { background: #AEB9B3; }
.cta-card .btn--ghost { color: #AEB9B3; border-color: #4A524F; }
.cta-card .btn--ghost:hover { color: #fff; border-color: var(--sage); }

/* ---------- rodapé ---------- */
.foot {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: .8;
}

/* ---------- acessibilidade ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
