/* =====================================================================
   Pebble Construction — cost estimator, ZIP checker, form estimate chip
   ===================================================================== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.est { overflow: hidden; }
.est::before {
  content: "";
  position: absolute;
  width: 900px; height: 900px;
  right: -300px; top: -200px;
  background: radial-gradient(circle, rgba(184, 137, 90, .16), rgba(184, 137, 90, 0) 60%);
  pointer-events: none;
}
.est__wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

/* ---------- left: steps ---------- */
.est__main {
  background: var(--ink-2);
  border: 1px solid var(--line-l);
  border-radius: 26px;
  padding: clamp(22px, 3.4vw, 42px);
}
.est__steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}
.est__steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-l);
  transition: color .4s;
}
.est__steps li span {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-l);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  transition: background .4s, border-color .4s, color .4s;
}
.est__steps li.is-active { color: var(--white); }
.est__steps li.is-active span { border-color: var(--brass); color: var(--brass-2); box-shadow: 0 0 0 4px rgba(184, 137, 90, .15); }
.est__steps li.is-done span { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.est__bar { height: 2px; background: var(--line-l); border-radius: 2px; overflow: hidden; margin-bottom: clamp(26px, 3vw, 38px); }
.est__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-2)); transform: scaleX(.25); transform-origin: left; transition: transform .7s var(--ease); }

.est__panes { display: grid; }
.est__pane {
  grid-area: 1 / 1;
  border: 0; margin: 0; padding: 0; min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s linear .6s;
}
.est__pane.is-past { transform: translateX(-40px); }
.est__pane.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: .08s, .08s, 0s; }
.est__q {
  font-family: var(--serif);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 24px;
  padding: 0;
}
.est__sub { margin: 28px 0 12px; font-weight: 600; color: var(--white); font-size: 15px; }
.est__sub small { color: var(--muted-l); font-weight: 400; }

.est__opts { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.est__opts--types { grid-template-columns: repeat(3, 1fr); }
.est__opts--finish, .est__opts--home { grid-template-columns: repeat(3, 1fr); }

/* option card */
.eo { position: relative; display: block; cursor: pointer; }
.eo input { position: absolute; opacity: 0; pointer-events: none; }
.eo__in {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line-l);
  border-radius: 18px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
  transition: border-color .35s, background .35s, transform .45s var(--ease), box-shadow .45s;
}
.eo:hover .eo__in { border-color: rgba(214, 180, 138, .55); transform: translateY(-3px); background: rgba(255, 255, 255, .05); }
.eo input:focus-visible + .eo__in { outline: 2px solid var(--brass); outline-offset: 3px; }
.eo input:checked + .eo__in {
  border-color: var(--brass);
  background: rgba(184, 137, 90, .12);
  box-shadow: 0 20px 40px -24px rgba(184, 137, 90, .6), inset 0 0 0 1px var(--brass);
}
.eo__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.eo__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter .5s; filter: saturate(.85) brightness(.85); }
.eo:hover .eo__img img, .eo input:checked + .eo__in .eo__img img { transform: scale(1.08); filter: none; }
.eo__txt { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; }
.eo__txt strong { color: var(--white); font-size: 16px; font-weight: 600; }
.eo__txt small { color: var(--muted-l); font-size: 13px; line-height: 1.45; }
.eo--type .eo__txt { padding: 12px 14px 14px; }
.eo--type .eo__txt small { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.eo__tick {
  position: absolute;
  top: 12px; right: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brass);
  transform: scale(0);
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.eo__tick::after {
  content: "";
  position: absolute;
  left: 9px; top: 6px;
  width: 6px; height: 11px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.eo input:checked + .eo__in .eo__tick { transform: scale(1); }
.eo__tag {
  position: absolute;
  top: 14px; left: 18px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--brass-2);
  padding: 4px 8px;
  border-radius: 999px;
}
.eo--finish .eo__txt { padding-top: 64px; }
.eo--finish .eo__in::before {
  content: "";
  position: absolute;
  left: 18px; right: 18px; top: 44px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brass) var(--fw, 33%), rgba(255, 255, 255, .1) var(--fw, 33%));
}
.eo--f1 { --fw: 33%; } .eo--f2 { --fw: 66%; } .eo--f3 { --fw: 100%; }
.eo--size .eo__txt strong::before {
  content: "";
  display: block;
  width: var(--sz, 22px); height: var(--sz, 22px);
  border: 1.5px solid var(--brass-2);
  border-radius: 4px;
  margin-bottom: 14px;
  transition: background .3s;
}
.eo--s1 { --sz: 18px; } .eo--s2 { --sz: 28px; } .eo--s3 { --sz: 38px; }
.eo--size input:checked + .eo__in .eo__txt strong::before { background: rgba(214, 180, 138, .25); }

/* extras chips */
.est__extras { display: flex; flex-wrap: wrap; gap: 10px; }
.ex { position: relative; cursor: pointer; }
.ex input { position: absolute; opacity: 0; }
.ex span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--line-l);
  border-radius: 999px;
  font-size: 14px;
  color: rgba(255, 255, 255, .85);
  transition: all .3s;
}
.ex span::before { content: "+"; color: var(--brass-2); font-weight: 600; transition: transform .3s; }
.ex:hover span { border-color: var(--brass-2); }
.ex input:checked + span { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.ex input:checked + span::before { content: "✓"; color: var(--ink); }
.ex input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 3px; }

.est__nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line-l); }
.est__back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted-l); font-weight: 600; font-size: 15px;
  padding: 10px 4px;
  transition: color .3s, opacity .3s;
}
.est__back svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.est__back:hover:not(:disabled) { color: var(--white); }
.est__back:hover:not(:disabled) svg { transform: translateX(-4px); }
.est__back:disabled { opacity: 0; pointer-events: none; }
.est [data-est-next]:disabled { opacity: .4; pointer-events: none; filter: grayscale(.4); }

/* ---------- right: result ---------- */
.est__res {
  position: sticky;
  top: 100px;
  background: linear-gradient(160deg, #f6efe4 0%, #efe4d2 100%);
  color: var(--ink);
  border-radius: 26px;
  padding: clamp(24px, 3vw, 38px);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6);
}
.est__res::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(18, 26, 36, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 26, 36, .05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 55%);
  mask-image: linear-gradient(180deg, #000, transparent 55%);
}
.est__res > * { position: relative; z-index: 1; }
.est__res-k { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin: 0 0 10px; }
.est__res-t { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; margin: 0 0 18px; min-height: 1.1em; }
.est__num {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-family: var(--serif);
  font-size: clamp(46px, 4.6vw, 68px);
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--ink);
  opacity: .25;
  transition: opacity .5s;
}
.est__num i { font-style: normal; color: var(--brass); font-size: .7em; }
.est__res.has-value .est__num { opacity: 1; }
.est__res.is-bump .est__num { animation: bump .6s var(--ease); }
@keyframes bump { 0% { transform: translateY(6px); } 100% { transform: none; } }
.est__scale {
  position: relative;
  height: 10px;
  margin: 22px 0 26px;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, rgba(18, 26, 36, .12) 0 2px, transparent 2px 10%), rgba(18, 26, 36, .06);
}
.est__band {
  position: absolute;
  top: 0; bottom: 0;
  left: 0; width: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--brass), #8f6538);
  box-shadow: 0 6px 16px -6px rgba(143, 101, 56, .8);
  transition: left .8s var(--ease), width .8s var(--ease);
}
.est__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; }
.est__facts div { background: rgba(255, 255, 255, .6); border: 1px solid rgba(18, 26, 36, .08); border-radius: 14px; padding: 12px 14px; }
.est__facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.est__facts dd { margin: 4px 0 0; font-weight: 700; font-size: 15px; }
.est__inc { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 9px; }
.est__inc li { position: relative; padding-left: 26px; font-size: 14.5px; animation: incIn .5s var(--ease) both; }
.est__inc li:nth-child(2) { animation-delay: .06s; } .est__inc li:nth-child(3) { animation-delay: .12s; } .est__inc li:nth-child(4) { animation-delay: .18s; }
.est__inc li::before {
  content: "";
  position: absolute; left: 0; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brass);
}
.est__inc li::after {
  content: ""; position: absolute; left: 5px; top: 7px;
  width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@keyframes incIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.est__res .btn--light { background: var(--ink); color: var(--white); }
.est__res .btn--light:hover { color: var(--ink); }
.est__res .btn--light { --btn-fill: var(--brass); --btn-fill-fg: var(--ink); }
.est__restart { display: block; margin: 14px auto 0; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.est__restart:hover { color: var(--ink); }
.est__fine { margin: 18px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.est.is-complete .est__res, .est__wrap.is-complete .est__res { box-shadow: 0 40px 80px -30px rgba(184, 137, 90, .55), 0 0 0 2px var(--brass); }

@media (max-width: 1100px) {
  .est__opts--types { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .est__wrap { grid-template-columns: 1fr; }
  .est__res { position: relative; top: 0; }
}
@media (max-width: 640px) {
  .est__steps li { font-size: 0; gap: 0; justify-content: center; }
  .est__opts, .est__opts--finish, .est__opts--home { grid-template-columns: 1fr; }
  .est__opts--types { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .eo--finish .eo__txt { padding-top: 56px; }
}

/* ---------- ZIP checker ---------- */
.zip {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px 30px;
  padding: 26px 30px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.zip::before {
  content: "";
  position: absolute; right: -60px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(214, 180, 138, .25);
  box-shadow: 0 0 0 40px rgba(214, 180, 138, .05), 0 0 0 80px rgba(214, 180, 138, .03);
  pointer-events: none;
}
.zip__txt { display: flex; flex-direction: column; gap: 4px; }
.zip__txt strong { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.zip__txt span { color: var(--muted-l); font-size: 14.5px; }
.zip__in { display: flex; gap: 10px; position: relative; }
.zip__in input {
  width: 180px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-l);
  border-radius: 999px;
  padding: 14px 20px;
  color: var(--white);
  font: 600 16px var(--sans, inherit);
  letter-spacing: .12em;
  transition: border-color .3s, box-shadow .3s;
}
.zip__in input::placeholder { color: rgba(255, 255, 255, .35); letter-spacing: .02em; font-weight: 400; }
.zip__in input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(184, 137, 90, .2); }
.zip__out { grid-column: 1 / -1; margin: 0; font-size: 15px; min-height: 0; }
.zip__out:empty { display: none; }
.zip__out { padding: 14px 18px; border-radius: 14px; animation: incIn .45s var(--ease) both; }
.zip__out.is-ok { background: rgba(120, 170, 120, .14); border: 1px solid rgba(140, 190, 140, .35); }
.zip__out.is-warn { background: rgba(214, 180, 138, .1); border: 1px solid rgba(214, 180, 138, .3); }
.zip__out b { color: #a9dba9; }
.zip__out a { color: var(--brass-2); border-bottom: 1px solid currentColor; }
@media (max-width: 760px) {
  .zip { grid-template-columns: 1fr; padding: 24px 22px; }
  .zip__in input { flex: 1; width: auto; min-width: 0; }
}

/* ---------- Estimate chip inside the form ---------- */
.form__est {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 48px 16px 18px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, #f6efe4, #efe4d2);
  border: 1px solid rgba(184, 137, 90, .45);
  animation: incIn .5s var(--ease) both;
}
.form__est[hidden] { display: none; }
.form__est .mono { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.form__est strong { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--ink); }
.form__est small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.form__est button {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 18px; line-height: 1; color: var(--muted);
  transition: background .3s, color .3s;
}
.form__est button:hover { background: var(--ink); color: var(--white); }
.btn.is-busy { opacity: .7; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .est__pane, .est__band, .est__bar i { transition: none; }
  .est__res.is-bump .est__num, .est__inc li, .zip__out, .form__est { animation: none; }
}

/* fixes */
.est__res [hidden], [data-est-send][hidden], [data-est-restart][hidden] { display: none !important; }
.zip__in { width: 100%; justify-content: flex-end; }
@media (max-width: 760px) {
  .zip__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .zip__in .btn { padding-inline: 22px; }
}
