/* Estimate page (/estimate). Builds on home.css tokens and components. */

.est-page { background: var(--paper); }
.est { padding: 48px 0 96px; }
.est-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }

/* ---------- Aside ---------- */
.est-aside { position: sticky; top: calc(var(--header-h) + 32px); }
.est-aside h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin-top: 16px; }
.est-lede { margin-top: 14px; color: var(--ink-2); font-size: 1.1rem; }
.est-gets { list-style: none; margin-top: 28px; }
.est-gets li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.est-gets li:last-child { border-bottom: 1px solid var(--line); }
.est-gets i { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--ink); font-size: 18px; }
.est-gets strong { display: block; }
.est-gets span { font-size: 14.5px; color: var(--muted); }
.est-privacy { display: flex; gap: 10px; margin-top: 22px; font-size: 14px; color: var(--ink-2); }
.est-privacy i { color: var(--good); margin-top: 2px; }

/* ---------- Card ---------- */
.est-card { scroll-margin-top: calc(var(--header-h) + 12px); background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 32px 36px 28px; }
.est-progressbar { list-style: none; display: flex; gap: 8px; margin: 0 0 28px; padding: 0; }
.est-progressbar li {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding-top: 12px; border-top: 3px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.est-progressbar li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--font-mono); background: var(--paper-2); color: var(--muted); }
.est-progressbar li.is-done, .est-progressbar li.is-current { border-top-color: var(--ink); color: var(--ink); }
.est-progressbar li.is-current span { background: var(--accent); color: var(--ink); }
.est-progressbar li.is-done span { background: var(--ink); color: var(--paper); }

.est-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.est-legend { font: 500 1.65rem/1.2 var(--font-display); letter-spacing: -0.01em; padding: 0; margin-bottom: 8px; }
.est-hint { color: var(--ink-2); font-size: 15.5px; margin-bottom: 22px; }

.est-alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 22px; border-radius: 12px;
  background: var(--bad-tint); color: var(--ink); font-size: 15px;
}
.est-alert i { color: var(--bad); font-size: 18px; margin-top: 1px; }
.est-alert strong { display: block; }

/* ---------- Photos ---------- */
.est-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.est-add, .est-photo { aspect-ratio: 4 / 3; border-radius: 14px; position: relative; overflow: hidden; }
.est-add {
  grid-column: span 3; aspect-ratio: auto; min-height: 210px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 2px dashed var(--line-strong); background: var(--paper); cursor: pointer; padding: 20px;
  transition: border-color .2s, background-color .2s;
}
.est-photos.has-photos .est-add { grid-column: auto; min-height: 0; aspect-ratio: 4 / 3; }
.est-add:hover, .est-add.is-drag { border-color: var(--ink); background: var(--accent-tint); }
.est-add:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.est-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.est-add i { font-size: 30px; }
.est-add strong { font-size: 1.05rem; }
.est-add-sub { font-size: 14px; color: var(--muted); }
.est-photos.has-photos .est-add i { font-size: 22px; }
.est-photos.has-photos .est-add-sub { display: none; }
.est-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.est-photo.is-processing::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--paper-2) 30%, var(--card) 50%, var(--paper-2) 70%) 0 0 / 250% 100%;
  animation: est-sheen 1.4s linear infinite;
}
@keyframes est-sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.est-photo-badge { position: absolute; left: 8px; top: 8px; font: 600 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--ink); padding: 5px 7px; border-radius: 5px; }
.est-photo-remove {
  position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(21, 32, 43, .78); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 15px;
}
.est-photo-remove:hover { background: var(--ink); }
.est-count { margin-top: 10px; font-size: 14px; color: var(--muted); }
.est-tips { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; background: var(--paper); }
.est-tips summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.est-tips summary i { color: var(--warn); }
.est-tips ul { padding: 0 0 14px 18px; margin: 0; font-size: 14.5px; color: var(--ink-2); }
.est-tips li { margin: 4px 0; }

/* ---------- Questions ---------- */
.est-q + .est-q { margin-top: 26px; }
.est-q-label { display: block; font-weight: 600; margin-bottom: 12px; }
.est-q-label span, .est-field-label span { font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 6px; }
.est-field-label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 8px; }

.est-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.est-chips label, .est-cards label { position: relative; cursor: pointer; }
.est-chips input, .est-cards input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.est-chips span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper);
  font-size: 15px; font-weight: 500; transition: border-color .15s, background-color .15s;
}
.est-chips--small span { min-height: 40px; padding: 0 14px; font-size: 14.5px; }
.est-chips span:hover { border-color: var(--ink-2); }
.est-chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.est-chips input:focus-visible + span, .est-cards input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.est-cards { display: grid; gap: 10px; }
.est-cards--3 { grid-template-columns: repeat(3, 1fr); }
.est-cards--2 { grid-template-columns: repeat(2, 1fr); }
.est-cards span {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.est-cards span:hover { border-color: var(--ink-2); }
.est-cards input:checked + span { border-color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--ink); }
.est-cards i { font-size: 22px; margin-bottom: 4px; }
.est-cards strong { font-size: 15.5px; }
.est-cards small { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.est-cards em { font: 600 13px/1 var(--font-mono); font-style: normal; color: var(--muted); margin-top: auto; padding-top: 8px; }
.est-cards input:checked + span em { color: var(--accent-deep); }

/* ---------- Review + nav ---------- */
.est-review { margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--paper); display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.est-review-thumbs { display: flex; }
.est-review-thumbs img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 2px solid var(--paper); margin-left: -14px; }
.est-review-thumbs img:first-child { margin-left: 0; }
.est-review dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14px; }
.est-review dt { color: var(--muted); }
.est-review dd { margin: 0; font-weight: 500; }
.est-review button { grid-column: 1 / -1; justify-self: start; border: 0; background: none; padding: 0; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink-2); }
.est-turnstile { margin-top: 20px; min-height: 65px; }

.est-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.est-nav .btn-accent { margin-left: auto; }
.est-fineprint { margin-top: 12px; text-align: right; font-size: 13.5px; color: var(--muted); }

/* ---------- Working overlay ---------- */
.est-working { position: fixed; inset: 0; z-index: 100; background: rgba(21, 32, 43, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.est-working[hidden] { display: none; }
.est-working-card { width: min(440px, 100%); background: var(--card); border-radius: 22px; padding: 28px; box-shadow: var(--shadow-lg); }
.est-scan { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--paper-2) center / cover no-repeat; }
.est-scan::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 24px 24px;
}
.est-scan-line { position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); box-shadow: 0 0 24px 6px rgba(242, 183, 5, .6); animation: est-scan 2.4s ease-in-out infinite alternate; }
@keyframes est-scan { from { top: 4%; } to { top: 94%; } }
.est-working h2 { font: 500 1.5rem/1.2 var(--font-display); margin-top: 22px; }
.est-stages { list-style: none; padding: 0; margin: 16px 0 0; }
.est-stages li { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--muted); font-size: 15px; }
.est-stages li::before {
  content: ""; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line-strong);
}
.est-stages li.is-active { color: var(--ink); font-weight: 600; }
.est-stages li.is-active::before { border-color: var(--line); border-top-color: var(--ink); animation: est-spin .8s linear infinite; }
.est-stages li.is-done { color: var(--ink-2); }
.est-stages li.is-done::before { content: "✓"; display: grid; place-items: center; border: 0; background: var(--good); color: #fff; font-size: 12px; font-weight: 700; }
@keyframes est-spin { to { transform: rotate(360deg); } }
.est-working-note { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */
.est-desktop-only { display: inline; }
@media (hover: none) { .est-desktop-only { display: none; } }
@media (max-width: 960px) {
  .est { padding: 24px 0 64px; }
  .est-grid { grid-template-columns: 1fr; gap: 24px; }
  .est-aside { position: static; }
  .est-aside .est-gets, .est-aside .est-privacy, .est-aside .eyebrow { display: none; }
  .est-aside h1 { font-size: 1.9rem; margin-top: 0; }
  .est-lede { font-size: 1rem; margin-top: 8px; }
}
@media (max-width: 600px) {
  .est-sample-link { display: none; }
  .est .wrap { padding: 0 12px; }
  .est-aside { padding: 0 4px; }
  .est-card { padding: 22px 18px 20px; border-radius: 18px; }
  .est-progressbar li { font-size: 12.5px; gap: 6px; }
  .est-legend { font-size: 1.4rem; }
  .est-photos, .est-photos.has-photos { grid-template-columns: 1fr 1fr; }
  .est-add { grid-column: span 2; min-height: 180px; }
  .est-cards--3 { grid-template-columns: 1fr; }
  .est-cards--3 span { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .est-cards--3 small { flex-basis: 100%; }
  .est-cards--3 em { margin: 0 0 0 auto; padding: 0; order: 2; }
  .est-chips span { min-height: 42px; padding: 0 14px; font-size: 14.5px; }
  .est-review { grid-template-columns: 1fr; }
  .est-nav { position: sticky; bottom: 0; background: var(--card); margin: 24px -18px -20px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-radius: 0 0 18px 18px; z-index: 2; }
  .est-nav .btn { flex: 1; }
  .est-nav .btn-ghost { flex: 0 0 auto; }
  .est-fineprint { text-align: center; margin-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .est-scan-line, .est-stages li.is-active::before, .est-photo.is-processing::after { animation: none; }
}

/* `hidden` must win over .btn's display */
.est-nav [hidden], .est-add[hidden] { display: none !important; }
