/* ─────────────────────────────────────────────────────────────────────────
   Grand Renovation — Home-page quote calculator
   Vanilla CSS. Designed to be enqueued in WordPress (admin → enqueue scripts).
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,200..700;1,400&display=swap');

/* Token shims so this drops cleanly into WP themes that don't load
   the Grand brand token sheet. */
.gr-calc {
  --gr-ink:    #1A1A1A;
  --gr-black:  #000000;
  --gr-white:  #FFFFFF;
  --gr-gold:   #F6BA58;
  --gr-taupe:  #C4B8A5;
  --accent:    var(--gr-gold);
  --font-sans: 'Montserrat', system-ui, sans-serif;
}

/* ─── Section shell ──────────────────────────────────────────────────────── */
.gr-calc {
  position: relative;
  background: #0c0c0c;
  color: var(--gr-white);
  padding: clamp(80px, 9vw, 120px) clamp(20px, 5vw, 65px) clamp(60px, 7vw, 100px);
  font-family: var(--font-sans);
  overflow: hidden;
  box-sizing: border-box;
}
.gr-calc *, .gr-calc *::before, .gr-calc *::after { box-sizing: border-box; }
/* Buttons don't inherit color/font from their parent by default — force it. */
.gr-calc button { color: inherit; font: inherit; }

.gr-calc__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: background-image 1.2s ease, opacity 1.2s ease;
  opacity: 0.32;
}
.gr-calc__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(12,12,12,0.95) 70%),
    linear-gradient(180deg, rgba(12,12,12,0.85), rgba(12,12,12,0.6) 40%, rgba(12,12,12,0.95));
}
.gr-calc__inner {
  position: relative; z-index: 2;
  max-width: 920px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 60px;
  text-align: center;
}

/* ─── Heading ────────────────────────────────────────────────────────────── */
.gr-calc__head { display: flex; flex-direction: column; gap: 28px; }
.gr-calc__eyebrow {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--accent);
}
.gr-calc__h {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 200; line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 12px auto 0; max-width: 720px;
}

/* ─── Progress ──────────────────────────────────────────────────────────── */
.gr-calc__progress {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-top: 12px;
}
.gr-calc__dots { display: flex; gap: 10px; align-items: center; }
.gr-calc__dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,0.18);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gr-calc__dot.is-done { background: var(--accent); }
.gr-calc__dot.is-current {
  width: 32px; border-radius: 4px; background: var(--gr-white);
}
.gr-calc__percent {
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums; margin-left: 12px;
  min-width: 110px; text-align: left;
}
.gr-calc__percent .step-of { color: rgba(255,255,255,0.4); }
.gr-calc__percent .pct { color: var(--accent); margin-left: 8px; }

/* ─── Stage (panes) ──────────────────────────────────────────────────────── */
.gr-calc__stage {
  position: relative;
  display: grid;
  /* All panes share row 1 / col 1 — the stage auto-sizes to the tallest pane. */
}
.gr-calc__pane {
  grid-column: 1; grid-row: 1;
  opacity: 0; pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.gr-calc__pane.is-active { opacity: 1; pointer-events: auto; transform: translateY(0); }

.gr-calc__qnum {
  font-size: 64px; font-weight: 100;
  color: rgba(255,255,255,0.18);
  letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gr-calc__qnum em { font-style: normal; color: var(--accent); font-weight: 200; }
.gr-calc__qh {
  font-size: 28px; font-weight: 300;
  margin: 6px 0 8px; line-height: 1.2; letter-spacing: -0.005em;
}
.gr-calc__qsub {
  font-size: 14px; color: rgba(255,255,255,0.6);
  margin: 0 auto 36px; font-weight: 300; max-width: 480px; line-height: 1.5;
}

/* ─── Choice grid + tiles ─────────────────────────────────────────────── */
.gr-calc__grid { display: grid; gap: 12px; }
.gr-calc__grid--4 { grid-template-columns: repeat(4, 1fr); }
.gr-calc__grid--5 { grid-template-columns: repeat(5, 1fr); }
.gr-calc__grid--pair { grid-template-columns: repeat(2, 1fr); }

.gr-calc__opt {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 22px 14px 18px;
  cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: all 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  backdrop-filter: blur(8px);
  min-height: 130px;
  /* enter stagger */
  opacity: 0; transform: translateY(10px);
}
.gr-calc__pane.is-active .gr-calc__opt {
  animation: grCalcOptIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 200ms);
}
@keyframes grCalcOptIn {
  to { opacity: 1; transform: translateY(0); }
}
.gr-calc__opt:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}
.gr-calc__opt.is-selected {
  border-color: var(--accent);
  background: rgba(246,186,88,0.08);
}
.gr-calc__opt-ico {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: all 0.5s ease;
}
.gr-calc__opt:hover .gr-calc__opt-ico,
.gr-calc__opt.is-selected .gr-calc__opt-ico {
  color: var(--accent); border-color: var(--accent);
}
.gr-calc__opt-ico svg { display: block; }
.gr-calc__opt-lbl { font-size: 13px; font-weight: 500; line-height: 1.25; }
.gr-calc__opt-sub {
  font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 400;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.gr-calc__opt-group {
  position: absolute; top: 8px; left: 10px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.32);
}
.gr-calc__opt.is-selected .gr-calc__opt-group { color: var(--accent); }

/* ─── Scope step — surface slider + tier cards ───────────────────────── */
.gr-calc__scope {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 520px; margin: 0 auto 36px;
}
.gr-calc__scope--fixed { gap: 6px; }
.gr-calc__scope-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
}
.gr-calc__scope-val {
  font-size: 72px; font-weight: 100;
  line-height: 1; letter-spacing: -0.025em;
  color: var(--gr-white); font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 4px;
}
.gr-calc__scope-val .unit {
  font-size: 24px; font-weight: 200;
  color: var(--accent); letter-spacing: 0;
}
.gr-calc__scope-hint {
  font-size: 13px; color: rgba(255,255,255,0.55);
  font-weight: 300; max-width: 360px; text-align: center; line-height: 1.5;
}

/* Range slider — webkit + firefox */
.gr-calc__scope-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; max-width: 480px;
  height: 2px; background: rgba(255,255,255,0.15);
  outline: none; cursor: pointer; margin: 8px 0 0;
}
.gr-calc__scope-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--accent);
  border: 3px solid var(--gr-ink);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 6px rgba(246,186,88,0.15);
  cursor: grab;
  transition: transform 0.2s ease;
}
.gr-calc__scope-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.gr-calc__scope-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.05); }
.gr-calc__scope-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--accent);
  border: 3px solid var(--gr-ink);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 6px rgba(246,186,88,0.15);
  cursor: grab;
}
.gr-calc__scope-slider::-moz-range-track { background: rgba(255,255,255,0.15); height: 2px; }
.gr-calc__scope-bounds {
  display: flex; justify-content: space-between; width: 100%; max-width: 480px;
  font-size: 11px; color: rgba(255,255,255,0.35);
  font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  margin-top: 4px;
}

/* Tier cards */
.gr-calc__tiers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 720px; margin: 0 auto;
}
.gr-calc__tier {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 26px 18px 20px;
  cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  backdrop-filter: blur(8px);
  font-family: inherit; color: inherit;
  opacity: 0; transform: translateY(10px);
}
.gr-calc__pane.is-active .gr-calc__tier {
  animation: grCalcOptIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 100ms + 350ms);
}
.gr-calc__tier:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}
.gr-calc__tier.is-selected {
  border-color: var(--accent);
  background: rgba(246,186,88,0.08);
}
.gr-calc__tier-name {
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
}
.gr-calc__tier.is-selected .gr-calc__tier-name { color: var(--accent); }
.gr-calc__tier-price {
  font-size: 36px; font-weight: 200; letter-spacing: -0.015em;
  color: var(--gr-white); font-variant-numeric: tabular-nums;
  line-height: 1.1; margin: 4px 0 2px;
  transition: color 0.4s ease;
}
.gr-calc__tier:hover .gr-calc__tier-price,
.gr-calc__tier.is-selected .gr-calc__tier-price { color: var(--accent); }
.gr-calc__tier-sub {
  font-size: 12px; color: rgba(255,255,255,0.5);
  font-weight: 300; line-height: 1.4; max-width: 180px;
}

.gr-calc__estimate-note {
  text-align: center; margin: 22px auto 0;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); font-weight: 500;
}
.gr-calc__min-note {
  text-align: center; margin: 6px auto 0;
  font-size: 10.5px; color: rgba(255,255,255,0.32);
  font-weight: 400; letter-spacing: 0.04em;
  max-width: 540px;
}

@media (max-width: 760px) {
  .gr-calc__tiers { grid-template-columns: 1fr; max-width: 360px; }
  .gr-calc__tier-price { font-size: 32px; }
  .gr-calc__scope-val { font-size: 56px; }
}

/* ─── Form fields (location + contact) ─────────────────────────────────── */
.gr-calc__form {
  display: grid; gap: 14px; max-width: 520px; margin: 0 auto;
}
.gr-calc__form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gr-calc__input {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.15);
  color: var(--gr-white); padding: 18px 22px;
  font-family: inherit; font-size: 16px; font-weight: 300;
  border-radius: 0; outline: none; text-align: center;
  transition: all 0.5s ease;
}
.gr-calc__input::placeholder { color: rgba(255,255,255,0.3); }
.gr-calc__input:focus { border-color: var(--accent); background: rgba(246,186,88,0.04); }

.gr-calc__textarea {
  text-align: left;
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
  padding: 16px 20px;
  font-size: 15px;
}
.gr-calc__textarea::placeholder { font-size: 14px; line-height: 1.5; }

.gr-calc__cities {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 6px;
}
.gr-calc__chip {
  border: 1px solid rgba(255,255,255,0.18);
  padding: 9px 18px; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.75); cursor: pointer;
  letter-spacing: 0.06em; transition: all 0.5s ease;
  border-radius: 999px; background: transparent;
  font-family: inherit;
}
.gr-calc__chip:hover { border-color: var(--accent); color: var(--gr-white); }
.gr-calc__chip.is-selected { border-color: var(--accent); color: var(--accent); background: rgba(246,186,88,0.06); }

/* ─── Footer (confidence + controls) ───────────────────────────────────── */
.gr-calc__foot { display: flex; flex-direction: column; gap: 28px; align-items: center; }
.gr-calc__confidence {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
  min-height: 22px;
}
.gr-calc__confidence-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  animation: grCalcPulse 1.6s ease-in-out infinite;
}
@keyframes grCalcPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.4); }
}

.gr-calc__controls {
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.gr-calc__btn {
  border: 1px solid rgba(255,255,255,0.3); background: transparent;
  color: var(--gr-white); padding: 14px 32px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; cursor: pointer;
  transition: all 0.6s ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.gr-calc__btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.55); }
.gr-calc__btn:disabled { opacity: 0.25; cursor: not-allowed; }
.gr-calc__btn--primary {
  background: var(--accent); color: var(--gr-ink); border-color: var(--accent);
}
.gr-calc__btn--primary:hover:not(:disabled) {
  background: transparent; color: var(--accent);
}
.gr-calc__btn--ghost {
  border-color: transparent; color: rgba(255,255,255,0.55); padding: 14px 18px;
}
.gr-calc__btn--ghost:hover:not(:disabled) {
  color: var(--gr-white); background: transparent; border-color: transparent;
}
/* `hidden` attribute must override the flex display rule above. */
.gr-calc__btn[hidden] { display: none !important; }

/* ─── Done state ─────────────────────────────────────────────────────── */
.gr-calc__done {
  display: none; flex-direction: column; align-items: center; gap: 22px;
  padding: 20px 0; opacity: 0;
  transition: opacity 0.6s ease;
}
.gr-calc__done.is-active { display: flex; opacity: 1; }
.gr-calc__done .icon {
  width: 72px; height: 72px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.gr-calc__done h4 { font-size: 32px; font-weight: 200; margin: 0; letter-spacing: -0.005em; }
.gr-calc__done p { font-size: 15px; color: rgba(255,255,255,0.65); margin: 0; max-width: 420px; line-height: 1.6; font-weight: 300; }

/* ─── Wrapper for CF7 — hide CF7's own response box until success ───── */
.gr-calc .wpcf7-response-output { display: none; }
.gr-calc.is-sent .wpcf7-response-output { display: block; }

/* ─── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .gr-calc { padding: 64px 18px 56px; min-height: 0; }
  .gr-calc__h { font-size: 32px; }
  .gr-calc__qh { font-size: 22px; }
  .gr-calc__qnum { font-size: 48px; }
  .gr-calc__grid--4 { grid-template-columns: repeat(2, 1fr); }
  .gr-calc__grid--5 { grid-template-columns: repeat(2, 1fr); }
  .gr-calc__form .row2 { grid-template-columns: 1fr; }
  .gr-calc__percent { display: none; }
  .gr-calc__controls { flex-wrap: wrap; }
}

/* ─── Optional context-hero (demo page only) ──────────────────────── */
.gr-context-hero {
  position: relative;
  height: 280px;
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end;
  padding: 32px clamp(20px, 5vw, 65px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-sans);
  color: var(--gr-white);
}
.gr-context-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
}
.gr-context-hero .ch-inner {
  position: relative; z-index: 2;
  max-width: 1320px; margin: 0 auto; width: 100%;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.gr-context-hero .ch-text { display: flex; flex-direction: column; gap: 4px; }
.gr-context-hero .ch-eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gr-taupe); font-weight: 600;
}
.gr-context-hero h3 {
  font-size: 28px; font-weight: 300; margin: 0;
  color: var(--gr-white); letter-spacing: -0.005em;
}
.gr-context-hero .ch-scroll {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); font-weight: 600;
}
