/* ASi Imperium — Scope & Estimate
   Two columns on desktop, stacked on a phone. The result card sticks so the range
   stays in view while the answers change; on a phone a compact bar carries it instead.
   Performance rules (AGENTS.md §6a): no backdrop-filter, transitions on named
   properties only, the one animated bar moves by transform. */

.est {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 40px;
  align-items: start;
  margin-top: 44px;
  text-align: left;
}
@media (max-width: 940px) {
  .est { grid-template-columns: 1fr; gap: 28px; }
}

/* ---- progress ---- */
.est__progress { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.est__progress-fill { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .45s cubic-bezier(.23, 1, .32, 1); }
.est__progress-text { font-size: .82rem; color: var(--text-muted); margin: 10px 0 0; }

/* ---- steps ---- */
.est__group { border: 0; margin: 30px 0 0; padding: 0; min-width: 0; }
.est__step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: 0 0 14px;
  font-family: var(--serif, 'Newsreader', Georgia, serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
}
.est__step em { font-style: normal; font-family: var(--mono, 'IBM Plex Mono', monospace); font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); }
.est__num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--card-bg);
  transition: background-color .25s, border-color .25s, color .25s;
}
.est__group.is-done .est__num { background: var(--accent); border-color: var(--accent); color: #fff; }
.est__note { font-size: .8rem; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }

.est__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.est__opts--tight { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

.est-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 40px 16px 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: border-color .2s, background-color .2s, transform .2s, box-shadow .2s;
}
.est-opt:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .07); }
.est-opt:focus-visible, .est__extra:focus-within, .est__mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.est-opt.on { border-color: var(--accent); background: rgba(199, 123, 46, .08); box-shadow: 0 0 0 1px var(--accent) inset; }
.est-opt__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.est-opt__label { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.est-opt__hint { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.est-opt__icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s, color .2s;
}
.est-opt__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.est-opt.on .est-opt__icon { background: var(--accent); color: #fff; }
.est-opt__scale { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.est-opt__scale i { display: block; width: 5px; border-radius: 2px; background: var(--border); }
.est-opt__scale i:nth-child(1) { height: 6px; }
.est-opt__scale i:nth-child(2) { height: 10px; }
.est-opt__scale i:nth-child(3) { height: 14px; }
.est-opt__scale i:nth-child(4) { height: 18px; }
.est-opt__scale i.on { background: var(--accent); }
.est-opt__tick {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: transparent;
  transition: background-color .2s, border-color .2s, color .2s;
}
.est-opt.on .est-opt__tick { background: var(--accent); border-color: var(--accent); color: #fff; }

.est__extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.est__extra {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "box label" "box cost";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--card-bg);
  transition: border-color .2s, background-color .2s;
}
.est__extra:hover { border-color: var(--accent); }
.est__extra.on { border-color: var(--accent); background: rgba(199, 123, 46, .08); }
.est__extra input { grid-area: box; accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.est__extra-label { grid-area: label; font-size: .9rem; font-weight: 500; }
.est__extra-cost { grid-area: cost; font-family: var(--mono, 'IBM Plex Mono', monospace); font-size: .68rem; color: var(--text-muted); }

/* ---- result card ---- */
.est__result {
  background: #1C1B19;
  color: #EDEAE4;
  border-radius: 14px;
  padding: 28px 26px;
  position: sticky;
  top: 110px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}
.est__rlabel {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #A8A298;
  margin: 22px 0 8px;
}
.est__result > div > .est__rlabel:first-child { margin-top: 0; }
.est__empty-t { font-family: var(--serif, 'Newsreader', Georgia, serif); font-size: 1.45rem; line-height: 1.3; margin: 0 0 10px; }
.est__empty-s { font-size: .82rem; color: #A8A298; margin: 0; }
.est__figure {
  font-family: var(--serif, 'Newsreader', Georgia, serif);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  line-height: 1.1;
  color: #F0B574;
  margin: 0 0 14px;
  font-variant-numeric: tabular-nums;
}
.est__time { font-family: var(--serif, 'Newsreader', Georgia, serif); font-size: 1.3rem; margin: 0 0 12px; }
.est__scale { position: relative; height: 8px; border-radius: 4px; background: #34312C; }
.est__band { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #C77B2E, #F0B574); transition: left .45s cubic-bezier(.23, 1, .32, 1), width .45s cubic-bezier(.23, 1, .32, 1); }
.est__scale--time .est__band { background: linear-gradient(90deg, #2E7D4F, #3DDC84); }
.est__ticks { display: flex; justify-content: space-between; font-family: var(--mono, 'IBM Plex Mono', monospace); font-size: .6rem; color: #8A857C; margin-top: 6px; }
.est__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.est__chips span { font-size: .76rem; border: 1px solid #45413A; border-radius: 999px; padding: 4px 10px; color: #D9D4CA; }
.est__includes { list-style: none; padding: 0; margin: 0; }
.est__includes li { position: relative; padding-left: 20px; margin-bottom: 7px; font-size: .86rem; color: #D9D4CA; line-height: 1.5; }
.est__includes li::before { content: "\2713"; position: absolute; left: 0; color: #F0B574; font-weight: 700; }
.est__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.est__actions .btn { font-size: .86rem; flex: 1 1 auto; justify-content: center; min-height: 44px; padding: 12px 16px; }
.est__actions .btn-secondary { background: transparent; color: #EDEAE4; border-color: #5A554C; }
.est__actions .btn-secondary:hover { border-color: #F0B574; color: #F0B574; }
.est__caveat, .est__process { font-size: .78rem; line-height: 1.6; color: #A8A298; margin: 18px 0 0; }
.est__caveat a { color: #F0B574; }
.est__process { padding-top: 16px; border-top: 1px solid #34312C; }

/* ---- phone: compact range bar while answering ---- */
.est__mini { display: none; }
@media (max-width: 940px) {
  .est__result { position: static; }
  .est__mini {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    position: sticky;
    bottom: 84px; /* clears the floating WhatsApp and chat buttons */
    margin-top: 22px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: #1C1B19;
    color: #EDEAE4;
    font-family: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    cursor: pointer;
    z-index: 5;
  }
  .est__mini-k { font-family: var(--mono, 'IBM Plex Mono', monospace); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: #A8A298; }
  .est__mini strong { font-family: var(--serif, 'Newsreader', Georgia, serif); font-weight: 400; font-size: 1.15rem; color: #F0B574; }
  .est__mini-go { margin-left: auto; font-size: .8rem; }
  .est-opt { padding: 14px 38px 14px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .est-opt, .est__band, .est__progress-fill { transition: none; }
  .est-opt:hover { transform: none; }
}

/* Four sizes read as a 2 x 2, not three and an orphan. */
.est__group[data-step="size"] .est__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* The homepage restyles .btn-primary for its own sections; inside the dark card it must
   stay the accent, or the main action disappears. */
.est__actions .btn-primary { background: #C77B2E !important; border-color: #C77B2E !important; color: #fff !important; }
.est__actions .btn-primary:hover { background: #E6A44A !important; border-color: #E6A44A !important; }

/* On a desktop the card is taller than the screen once it fills in; cap it so the range at
   the top never scrolls out of view while the visitor answers the later questions. */
@media (min-width: 941px) {
  .est__result { max-height: calc(100vh - 130px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
