/* ============================================================
   PRICE CALCULATOR — 4-step planner with live summary
   ============================================================ */

/* ---------- hero ---------- */
.calc-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--ink); color: var(--text-on-dark); padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(6rem, 9vw, 7.5rem); }
.calc-hero .section-bg { position: absolute; inset: -10% 0; z-index: -1; pointer-events: none; will-change: transform; }
.calc-hero .section-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.calc-hero .section-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31,29,27,0.9), rgba(31,29,27,0.55) 60%, rgba(31,29,27,0.7)), linear-gradient(180deg, rgba(31,29,27,0.4), rgba(31,29,27,0.85)); }
.calc-hero .eyebrow { color: var(--gold-fleck-light); }
.calc-hero h1 { color: var(--text-on-dark); max-width: 16ch; }
.calc-hero h1 em { font-style: italic; color: var(--gold-fleck-light); font-weight: 500; }
.calc-hero p:not(.eyebrow) { color: var(--text-on-dark-muted); max-width: 56ch; font-weight: 300; margin-top: 1rem; }

/* ---------- layout ---------- */
.calc-section { padding-top: 0; margin-top: -4.2rem; position: relative; z-index: 2; }
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.6rem; align-items: start; }

/* ---------- wizard card ---------- */
.calc-wizard { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px -28px rgba(31,29,27,0.35); padding: clamp(1.4rem, 3.5vw, 2.6rem); }
.calc-progress { position: relative; margin-bottom: 0.6rem; }
.calc-stepper-line { position: absolute; left: 22px; right: 22px; top: 17px; height: 2px; background: var(--stone-deep); border-radius: 2px; overflow: hidden; }
.calc-stepper-line span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aventurine), var(--gold-fleck)); transition: width 0.6s var(--ease); }
.calc-stepper { position: relative; display: flex; justify-content: space-between; }
.calc-stepper li { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; flex: 0 0 auto; min-width: 64px; }
.calc-stepper-dot { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--stone-deep); color: var(--text-muted); font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.calc-stepper-label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); text-align: center; transition: color 0.3s var(--ease); }
.calc-stepper li.is-current .calc-stepper-dot { border-color: var(--aventurine); background: var(--aventurine); color: #fff; transform: scale(1.1); box-shadow: 0 0 0 5px rgba(136,94,67,0.15); }
.calc-stepper li.is-current .calc-stepper-label { color: var(--ink); font-weight: 500; }
.calc-stepper li.is-done .calc-stepper-dot { border-color: var(--aventurine); background: var(--aventurine); color: #fff; font-size: 0; }
.calc-stepper li.is-done .calc-stepper-dot::before { content: ""; width: 12px; height: 7px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.calc-step-label { position: absolute; left: -9999px; }

/* ---------- steps ---------- */
.calc-step { border: none; padding: 0; margin: 1.8rem 0 0; min-width: 0; display: none; }
.calc-step.is-active { display: block; animation: calc-in 0.5s var(--ease); }
@keyframes calc-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.calc-step legend { font-family: var(--font-display); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 500; color: var(--ink); padding: 0; margin-bottom: 1.3rem; line-height: 1.15; float: left; width: 100%; }
.calc-step legend + * { clear: both; }
.calc-sublabel { display: block; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; color: var(--aventurine); margin: 1.7rem 0 0.8rem; }
.calc-hint { font-size: 0.82rem; color: var(--text-muted); margin: 0.6rem 0 0; max-width: none; }
.calc-hint--lead { margin: 0 0 1.2rem; }
.calc-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--aventurine); border-bottom: 1px solid var(--gold-fleck); cursor: pointer; }
.calc-link:hover { border-bottom-color: var(--aventurine); }

/* option inputs are visually hidden; the label is the control */
.calc-card input, .calc-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

/* big cards (type + finish) */
.calc-cards { display: grid; gap: 1rem; }
.calc-cards--2 { grid-template-columns: repeat(2, 1fr); }
.calc-cards--3 { grid-template-columns: repeat(3, 1fr); }
.calc-card { position: relative; cursor: pointer; display: block; }
.calc-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; height: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); padding: 1.3rem 1.3rem 1.2rem; transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.calc-card-body svg { width: 44px; height: 44px; color: var(--aventurine); margin-bottom: 0.6rem; transition: transform 0.5s var(--ease); }
.calc-card--tier .calc-card-body svg { width: 28px; height: 28px; }
.calc-card-body strong { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.calc-card-body em { font-style: normal; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.calc-card::after, .calc-tile::after { content: ""; position: absolute; top: 0.85rem; right: 0.85rem; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease); }
.calc-card.is-checked::after, .calc-tile.is-checked::after { background: var(--aventurine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l5 5L19.5 7'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--aventurine); transform: scale(1.05); }
.calc-card:hover .calc-card-body { border-color: var(--gold-fleck); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.calc-card:hover svg { transform: scale(1.08) rotate(-2deg); }
.calc-card.is-checked .calc-card-body { border-color: var(--aventurine); background: #FBF3EA; box-shadow: 0 0 0 3px rgba(136,94,67,0.12); }
.calc-card input:focus-visible + .calc-card-body, .calc-tile input:focus-visible + span { outline: 2px solid var(--aventurine); outline-offset: 2px; }

/* pill tiles (sizes, space types, scope, budget) */
.calc-tiles { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.calc-tile { position: relative; cursor: pointer; display: block; }
.calc-tile > span { display: flex; align-items: center; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0.75em 3rem 0.75em 1.2em; font-size: 0.9rem; font-weight: 500; color: var(--text); transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease); }
.calc-tile::after { top: 50%; right: 0.9rem; margin-top: -11px; width: 20px; height: 20px; margin-top: -10px; }
.calc-tile:hover > span { border-color: var(--gold-fleck); transform: translateY(-2px); }
.calc-tile.is-checked > span { border-color: var(--aventurine); background: #FBF3EA; color: var(--ink); }
.calc-tiles--wrap .calc-tile { flex: 1 1 calc(50% - 0.7rem); }
.calc-tiles--budget { display: grid; grid-template-columns: repeat(3, 1fr); }
.calc-tiles--budget .calc-tile > span { justify-content: flex-start; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; min-height: 60px; }
.calc-tiles--budget .calc-tile:last-child > span { font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }

/* carpet area input */
.calc-input-unit { position: relative; max-width: 320px; }
.calc-input-unit input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0.95em 4.2rem 0.95em 1.1em; font: inherit; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--ink); transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease); -moz-appearance: textfield; }
.calc-input-unit input::-webkit-outer-spin-button, .calc-input-unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input-unit input::placeholder { color: #B5AB9E; font-weight: 500; }
.calc-input-unit input:focus { outline: none; border-color: var(--aventurine); background: #fff; box-shadow: 0 0 0 3px rgba(136,94,67,0.14); }
.calc-input-unit span { position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; pointer-events: none; }
.calc-area { margin-bottom: 0.4rem; }
.calc-area .calc-sublabel { margin-top: 0; }

/* budget helper + send */
.calc-perft { margin: 1.2rem 0 0; padding: 0.9rem 1.1rem; background: var(--stone); border-radius: 10px; font-size: 0.86rem; color: var(--text-muted); max-width: none; animation: calc-in 0.4s var(--ease); }
.calc-perft strong { color: var(--ink); font-weight: 600; }
.calc-send { margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px dashed var(--line); }
.calc-send .form-field { max-width: 380px; }
.calc-send .btn { margin-top: 0.4rem; }
.calc-send-note { text-align: center; font-size: 0.76rem; color: var(--text-muted); margin: 0.8rem auto 0; }
.btn.is-disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.btn.is-disabled:hover { transform: none; box-shadow: none; }

.calc-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--stone-deep); }
.calc-nav .btn { flex: 1; max-width: 240px; }
.calc-nav .btn:only-of-type, .calc-nav #calcNext:last-child { margin-left: auto; }
.calc-wizard .form-error { display: block; margin-top: 0.6rem; }

/* ---------- live summary ---------- */
.calc-summary { position: sticky; top: 100px; background: var(--ink); color: var(--text-on-dark); border-radius: 14px; padding: 1.7rem 1.6rem; box-shadow: 0 24px 60px -28px rgba(31,29,27,0.5); }
.calc-summary h2 { color: var(--text-on-dark); font-size: 1.7rem; margin-bottom: 1.1rem; }
.calc-summary dl { margin: 0; display: flex; flex-direction: column; }
.calc-summary dl > div { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 0; border-top: 1px solid var(--line-on-dark); }
.calc-summary dt { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-fleck-light); }
.calc-summary dd { margin: 0; font-size: 0.92rem; line-height: 1.45; color: var(--text-on-dark); word-break: break-word; }
.calc-summary-points { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-on-dark); display: flex; flex-direction: column; gap: 0.6rem; }
.calc-summary-points li { display: flex; gap: 0.6rem; font-size: 0.8rem; color: var(--text-on-dark-muted); }
.calc-summary-points svg { width: 16px; height: 16px; color: var(--gold-fleck-light); flex-shrink: 0; margin-top: 2px; }

/* ---------- what happens next ---------- */
.calc-how { background: var(--stone); }
.calc-how h2 em { font-style: italic; color: var(--aventurine); font-weight: 500; }
.calc-how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; counter-reset: none; }
.calc-how-steps li { border-top: 2px solid var(--gold-fleck); padding-top: 1.2rem; }
.calc-how-steps span { display: block; font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--gold-fleck); margin-bottom: 0.8rem; }
.calc-how-steps h3 { font-size: 1.45rem; margin-bottom: 0.4rem; }
.calc-how-steps p { color: var(--text-muted); font-size: 0.88rem; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-summary { position: static; }
  .calc-summary dl { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 1.4rem; }
  .calc-tiles--budget { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .calc-cards--2, .calc-cards--3 { grid-template-columns: 1fr; }
  .calc-tiles--wrap .calc-tile { flex-basis: 100%; }
  .calc-tiles--budget { grid-template-columns: 1fr 1fr; }
  .calc-tiles--budget .calc-tile > span { font-size: 1.05rem; padding-left: 0.9em; }
  .calc-stepper li { min-width: 0; }
  .calc-stepper-label { font-size: 0.56rem; letter-spacing: 0.08em; }
  .calc-how-steps { grid-template-columns: 1fr; }
  .calc-nav .btn { max-width: none; }
  .calc-summary dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .calc-step.is-active, .calc-perft { animation: none; } }
