/* =====================================================================
   Instant price estimator ("Transparent Budget Plans") - homepage.
   Kept in its own file, loaded only by the section that uses it, so it
   never collides with style.css. Uses the site's existing tokens.
   ===================================================================== */

/* style.css sets body { overflow-x: hidden }, which turns body into a scroll
   container. The viewport is what actually scrolls, so nothing inside body
   can ever be position: sticky. html already clips horizontal overflow
   (overflow-x: clip), so body does not need to - and must not, for the
   estimate panel to follow the scroll. The inline overflow the mobile nav
   sets on body still wins over this rule. */
body { overflow-x: clip; overflow-y: visible; }
@supports not (overflow-x: clip) { body { overflow-x: visible; } }

.estimator-section {
  background: var(--bg-soft);
}

.estimator-section .section-heading p {
  color: var(--gray);
  margin-top: 14px;
  line-height: 1.7;
}

/* ---- layout: steps on the left, sticky estimate on the right -------- */
.est-layout {
  display: grid;
  grid-template-columns: minmax(0, 13fr) minmax(0, 7fr);   /* 65% / 35% */
  gap: 30px;
  align-items: start;
}

.est-steps {
  display: grid;
  gap: 24px;
}

.est-card {
  background: #0e182f;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 28px 30px;
}

.est-step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.est-step-head h3 {
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.est-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--white);
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- step 1: budget slider ------------------------------------------ */
.est-budget-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 18px;
  line-height: 1;
}

.est-cur {
  color: var(--primary-light);
  font-size: 22px;
  font-weight: 800;
}

#estBudgetValue {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -1px;
}

.est-range {
  --fill: 21%;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed var(--fill), rgba(255, 255, 255, 0.08) var(--fill));
  outline: none;
  cursor: pointer;
}

.est-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 5px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25), var(--neon-glow);
  cursor: grab;
  transition: transform 0.15s ease;
}

.est-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 5px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25), var(--neon-glow);
  cursor: grab;
}

.est-range:active::-webkit-slider-thumb { transform: scale(1.1); cursor: grabbing; }

.est-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.55); }
.est-range:focus-visible::-moz-range-thumb    { box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.55); }

.est-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--gray);
  font-size: 14px;
  font-weight: 600;
}

/* ---- step 2 + 3: selectable cards ------------------------------------ */
.est-tiers,
.est-types {
  display: grid;
  gap: 14px;
}

.est-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.est-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.est-tier,
.est-type {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px 18px 18px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.est-tier:hover,
.est-type:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.est-tier.is-selected,
.est-type.is-selected {
  border-color: var(--primary-light);
  background: rgba(168, 85, 247, 0.06);
  box-shadow: 0 0 0 1px var(--primary-light), 0 12px 30px -12px rgba(168, 85, 247, 0.35);
}

.est-tier:focus-visible,
.est-type:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.est-badge {
  justify-self: start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 5px 11px;
}

.est-tier.is-selected .est-badge {
  color: var(--white);
  background: var(--gradient);
}

.est-tier-name,
.est-type-name {
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
}

/* Tier names stay on one line. The size follows the width of the tier row
   (container query units) so "React / Next.js + CMS" fits three-across at
   any viewport; browsers without cqi fall back to a fixed 16px. */
.est-tiers { container-type: inline-size; }

.est-tier-name {
  white-space: nowrap;
  letter-spacing: -0.2px;
  font-size: 16px;
  font-size: clamp(13px, 2.35cqi, 17px);
}

.est-tier-price {
  color: var(--primary-light);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.est-tier-price small {
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
  margin-right: 2px;
}

.est-tier-desc,
.est-type-desc {
  color: var(--gray);
  font-size: 14.5px;
  line-height: 1.6;
}

.est-tier-fit {
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.est-tier-fit.is-ok   { color: #34d399; }
.est-tier-fit.is-over { color: #fbbf24; }

/* ---- estimate panel --------------------------------------------------- */
.est-result {
  /* Sticks below the header while the steps scroll past, and is pushed up
     again when the bottom of its grid area - the bottom of step 3 - arrives. */
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.25), var(--glass-shadow);
  background: linear-gradient(160deg, rgba(79, 70, 229, 0.14) 0%, #0e182f 45%);
}

.est-result-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 10px;
}

.est-result-price {
  color: var(--white);
  font-size: clamp(36px, 4.5vw, 46px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.est-result-price small {
  color: var(--gray);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  margin-right: 4px;
}

.est-result-summary {
  color: var(--gray);
  font-weight: 600;
  margin-top: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.est-lists {
  display: grid;
  gap: 18px;
  margin: 20px 0 24px;
}

.est-lists h4 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
  margin: 0 0 10px;
}

.est-lists ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.est-lists li {
  color: var(--white);
  font-size: 15px;
  padding-left: 26px;
  position: relative;
}

.est-lists li::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 1px;
}

.est-inc li::before { content: "\f00c"; color: #34d399; }
.est-not li         { color: var(--gray); }
.est-not li::before { content: "\f00d"; color: #f87171; }

.est-result .btn + .btn { margin-top: 10px; }

.est-note {
  color: var(--gray-dark);
  font-size: 13px;
  margin: 16px 0 0;
  line-height: 1.6;
}

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 991px) {
  .est-layout {
    grid-template-columns: 1fr;
  }
  .est-result {
    position: static;
  }
}

@media (max-width: 699px) {
  .est-tiers { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .est-card { padding: 22px 18px; }
  .est-tier, .est-type { padding: 18px; }
  .est-types { grid-template-columns: 1fr; }
}

/* =====================================================================
   Cost bands on /pricing - the work the website estimator does not
   price. Lives here because /pricing already loads this file.
   ===================================================================== */

.pricing-bands {
  background: var(--bg);
}

.pricing-bands .section-heading p {
  color: var(--gray);
  margin-top: 14px;
  line-height: 1.7;
}

.band-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.band-card {
  background: #0e182f;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.band-card h3 {
  color: var(--white);
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 22px;
}

.band-list {
  margin: 0;
  display: grid;
  gap: 18px;
}

.band-list > div {
  display: grid;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--card-border);
}

.band-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.band-list dt {
  color: var(--gray);
  font-size: 14.5px;
  line-height: 1.55;
}

.band-list dd {
  margin: 0;
  color: var(--primary-light);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.band-note {
  color: var(--gray-dark);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 20px 0 0;
}

.band-link {
  margin-top: auto;
  padding-top: 20px;
  color: var(--primary-light);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.25s ease, color 0.25s ease;
}

.band-link:hover {
  color: var(--white);
  gap: 12px;
}

.band-link i { font-size: 13px; }

.band-footnote {
  color: var(--gray);
  text-align: center;
  max-width: 760px;
  margin: 30px auto 0;
  line-height: 1.75;
}

@media (max-width: 767px) {
  .band-grid { grid-template-columns: 1fr; }
  .band-card { padding: 24px 20px; }
  .band-list dd { font-size: 23px; }
}
