/* Aanbouwconfigurator Projectbouw: bouwt voort op style.css en aanbouw-ontwerp.css */

.cf-intro { padding: clamp(32px, 4vw, 56px) 0 clamp(20px, 2.5vw, 32px); background: var(--color-cream); }
.cf-intro h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; }
.cf-intro .pf-lead { max-width: 56ch; }

.cf { padding: 0 0 var(--space-xl); background: var(--color-cream); }
.cf-noscript { padding: 16px 20px; background: #fbfaf7; border: 1px solid var(--hair); }
.cf-grid { display: grid; gap: var(--space-md); padding: 0 var(--space-md); max-width: calc(var(--container-max) + 160px); margin: 0 auto; }
@media (min-width: 1024px) {
  .cf-grid { grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
  .cf-sheet { position: sticky; top: calc(var(--header-h) + 16px); }
}

/* ---------- Tekenvel ---------- */
.cf-sheet { padding: 14px 16px 16px; }
.cf-sheet__tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.cf-sheet__t { font-family: var(--font-display); font-weight: 600; font-size: 0.9375rem; }
.cf-badge { padding: 4px 10px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 0.75rem; border: 1px solid currentColor; }
.cf-badge.is-ok { color: #2f6b3a; background: #eef5ee; }
.cf-badge.is-warn { color: var(--brass-ink); background: #f8f1e3; }
.cf-draw { display: block; width: 100%; height: auto; }
.cf-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 0.875rem; line-height: 1.5; color: var(--ink-soft); }

.cf-draw .lb { font-family: var(--font-body); font-size: 11px; fill: var(--ink-soft); }
.cf-draw .lb.mute { fill: #6a6a67; }
.cf-draw .lb.strong { font-family: var(--font-display); font-weight: 600; font-size: 13px; fill: var(--ink); }
.cf-draw .lb.dimt { font-size: 11px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.cf-draw .lb.limitlb { fill: var(--brass-ink); font-weight: 600; }
.cf-draw .ln { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.cf-draw .ln.thin { stroke-width: 1; }
.cf-draw .ln.dim { stroke: var(--ink-soft); stroke-width: 1; }
.cf-draw .ln.glassline { stroke: var(--brass-ink); stroke-width: 2; }
.cf-draw .cf-house { fill: #f1efe8; stroke: none; }
.cf-draw .cf-wall { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: square; }
.cf-draw .cf-wall--new { stroke: var(--brass-ink); stroke-width: 4.5; }
.cf-draw .cf-new-fill { opacity: 0.4; }
.cf-draw .cf-vv { fill: none; stroke: #b5532a; stroke-width: 1; opacity: 0.55; }
.cf-draw .cf-glass { fill: rgba(140, 180, 200, 0.25); stroke: #4d7d93; stroke-width: 1.2; stroke-dasharray: 4 3; }
.cf-draw .cf-beam { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 7 4; }
.cf-draw .cf-gap { fill: none; stroke: #fbfaf7; stroke-width: 7; }
.cf-draw .cf-limit { fill: none; stroke: var(--brass); stroke-width: 1; stroke-dasharray: 3 4; }
.cf-draw .cf-limit.is-over { stroke: var(--brass-ink); stroke-width: 1.6; }
.cf-draw .pt { fill: none; stroke: rgba(26, 26, 24, 0.55); stroke-width: 0.8; }
.cf-draw .pt--soft { stroke: rgba(26, 26, 24, 0.3); }
.cf-draw .pt--brass { stroke: var(--brass); stroke-width: 1; }
.cf-draw .pd { fill: rgba(26, 26, 24, 0.4); }
.cf-draw .cf-house-e { fill: #f1efe8; stroke: var(--ink); stroke-width: 1.4; }
.cf-draw .cf-erase { fill: none; stroke: #fbfaf7; stroke-width: 3; }
.cf-draw .cf-face { fill: #fbfaf7; stroke: none; }
.cf-draw .cf-face-pat { stroke: var(--brass-ink); stroke-width: 1.6; }
.cf-draw .cf-trim { stroke: var(--ink); stroke-width: 3; }
.cf-draw .cf-pui { fill: rgba(140, 180, 200, 0.28); stroke: var(--ink); stroke-width: 2.2; }
.cf-draw .cf-mullion { fill: none; stroke: var(--ink); stroke-width: 2; }
.cf-draw .cf-glass-e { fill: rgba(140, 180, 200, 0.35); stroke: #4d7d93; stroke-width: 1.2; }

/* ---------- Paneel ---------- */
.cf-panel { display: grid; gap: var(--space-md); }
.cf-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1.5px solid var(--ink); }
.cf-steps li + li { border-left: 1px solid var(--ink); }
.cf-steps button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 56px;
  padding: 8px 10px; border: 0; background: transparent; text-align: left; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.8125rem; line-height: 1.2; color: var(--ink);
  transition: background-color 0.2s;
}
.cf-steps button span { font-size: 0.75rem; font-weight: 500; color: var(--color-grey-on-cream); font-variant-numeric: tabular-nums; }
.cf-steps button:hover { background: #fbfaf7; }
.cf-steps button[aria-current="step"] { background: var(--ink); color: var(--color-white); }
.cf-steps button[aria-current="step"] span { color: var(--brass); }
.cf-steps button.is-done span::after { content: " ✓"; color: var(--brass-ink); }
.cf-steps button:focus-visible { outline: 2px solid var(--brass); outline-offset: -4px; }
@media (max-width: 560px) {
  .cf-steps button { font-size: 0; align-items: center; min-height: 44px; }
  .cf-steps button span { font-size: 0.875rem; }
}

.cf-form { display: grid; gap: var(--space-md); }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-step h2 { font-size: var(--fs-28); margin-bottom: var(--space-sm); }
.cf-step h2:focus { outline: none; }
.cf-step fieldset { border: 0; margin: 0 0 var(--space-md); padding: 0; min-width: 0; }
.cf-step legend { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; margin-bottom: 10px; padding: 0; }
.cf-hint { margin: -4px 0 10px; font-size: 0.875rem; color: var(--ink-soft); }

.cf-opts { display: grid; gap: 8px; }
@media (min-width: 560px) { .cf-opts--4 { grid-template-columns: 1fr 1fr; } }
.cf-opt { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 44px; border: 1px solid var(--hair-strong); background: #fbfaf7; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.cf-opt[hidden] { display: none; }
.cf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cf-opt::before { content: ""; position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 50%; background: #fff; }
.cf-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cf-opt:has(input:checked)::before { border-color: var(--ink); background: radial-gradient(circle, var(--brass) 0 4.5px, #fff 5px); }
.cf-opt:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: 2px; }
.cf-opt__t { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.cf-opt__d { font-size: 0.875rem; line-height: 1.45; color: var(--ink-soft); }
.cf-opt__d:empty { display: none; }
.cf-opts--chips { display: flex; flex-wrap: wrap; }
.cf-opts--chips .cf-opt { padding: 9px 14px 9px 38px; }
.cf-opts--chips .cf-opt::before { left: 12px; top: 11px; width: 16px; height: 16px; }

.cf-dims { display: grid; gap: 18px; padding: 16px; border: 1px solid var(--hair-strong); background: #fbfaf7; }
.cf-dim label { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 6px; }
.cf-dim__row { display: flex; align-items: center; gap: 14px; }
.cf-dim input[type="range"] { flex: 1; min-width: 0; accent-color: var(--brass-ink); height: 28px; cursor: pointer; }
.cf-num { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.cf-num input { width: 76px; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 0; font: inherit; font-variant-numeric: tabular-nums; text-align: right; background: #fff; }
.cf-area { margin: 0; padding-top: 12px; border-top: 1px solid var(--hair); color: var(--ink-soft); }
.cf-area strong { font-family: var(--font-display); color: var(--ink); font-size: 1.125rem; font-variant-numeric: tabular-nums; }

.cf-sum { display: grid; margin: 0 0 var(--space-md); border-top: 1.5px solid var(--ink); }
.cf-sum > div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 0.9375rem; }
.cf-sum dt { color: var(--color-grey-on-cream); }
.cf-sum dd { margin: 0; font-weight: 500; }

.cf-fields { display: grid; gap: 12px; }
@media (min-width: 560px) { .cf-fields { grid-template-columns: 1fr 1fr; } .cf-field--wide { grid-column: 1 / -1; } }
.cf-field label { display: block; font-weight: 500; font-size: 0.9375rem; margin-bottom: 4px; }
.cf-field input, .cf-field textarea { width: 100%; padding: 11px 12px; border: 1.5px solid var(--hair-strong); border-radius: 0; background: #fff; font: inherit; color: var(--ink); }
.cf-field input:focus, .cf-field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px rgba(192, 145, 60, 0.35); }
.cf-field [aria-invalid="true"] { border-color: #b42318; }
.cf-error { margin: 12px 0 0; padding: 10px 14px; background: #fdecea; color: #8a1c12; font-weight: 500; }
.cf-privacy { margin-top: 12px; font-size: 0.8125rem; color: var(--ink-soft); }

.cf-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: var(--space-sm); border-top: 1px solid var(--hair); }
.cf-nav .btn-primary { margin-left: auto; }
.cf-nav [hidden] { display: none; }
.cf-nav[hidden] { display: none; } /* de balk zelf; zonder deze regel wint display:flex van hidden */

.cf-done { padding: 20px; background: #fbfaf7; border: 1.5px solid var(--ink); }
.cf-done:focus { outline: none; }
.cf-done h2 { font-size: var(--fs-28); margin-bottom: 8px; }
.cf-done p { color: var(--ink-soft); margin-bottom: 12px; }
.cf-pre { white-space: pre-wrap; font: 0.8125rem/1.5 ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--hair); padding: 12px; margin: 0 0 14px; }

/* ---------- Prijs ---------- */
.cf-price { padding: 18px 20px; background: var(--color-anthracite); color: var(--color-white); }
.cf-price__t { font-family: var(--font-display); font-weight: 600; color: var(--brass); font-size: 0.875rem; margin: 0; }
.cf-price__v { margin: 4px 0 2px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); font-variant-numeric: tabular-nums; }
.cf-price__s { margin: 0; font-size: 0.8125rem; color: #b9b8b2; }
.cf-price__d { margin-top: 12px; border-top: 1px solid rgba(250, 249, 246, 0.18); padding-top: 10px; font-size: 0.875rem; color: #dcdbd5; }
.cf-price__d summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--color-white); }
.cf-price__d ul { list-style: none; margin: 10px 0; padding: 0; }
.cf-price__d li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(250, 249, 246, 0.1); font-variant-numeric: tabular-nums; }
.cf-price__d p { margin: 8px 0 0; color: #a7a6a0; font-size: 0.8125rem; line-height: 1.5; }
@media (max-width: 1023px) {
  /* Op mobiel: prijs als balk onderaan het scherm */
  .cf-price { position: sticky; bottom: 0; z-index: 5; padding: 12px 16px; }
  .cf-price__v { font-size: 1.375rem; }
  .cf-sheet { padding: 10px; }
}

.cf-after .pf-next { border-color: var(--hair-strong); }
.cf-after .pf-next li { color: var(--ink-soft); }
.cf-after .pf-next li + li { border-top-color: var(--hair); }
.cf-after .pf-next span { color: var(--brass-ink); }

/* ---------- Mobiel: tekening compact bovenaan vast ---------- */
.cf-note-m { display: none; }
@media (max-width: 1023px) {
  .cf-sheet { position: sticky; top: var(--cf-top, var(--header-h)); z-index: 4; padding: 8px 10px; box-shadow: 0 10px 18px -14px rgba(0,0,0,0.35); }
  .cf-sheet__tools { margin-bottom: 2px; }
  .cf-sheet__t { font-size: 0.8125rem; }
  .cf-draw { max-height: 30vh; width: auto; max-width: 100%; margin: 0 auto; }
  .cf-note { display: none; }
  .cf-note-m { display: block; margin: 0; padding: 10px 12px; background: #fbfaf7; border: 1px solid var(--hair); font-size: 0.875rem; line-height: 1.5; color: var(--ink-soft); }
}
@media (max-width: 600px) {
  .cf-draw .lb { font-size: 15px; }
  .cf-draw .lb.dimt { font-size: 17px; }
  .cf-draw .lb.strong { font-size: 16px; }
}
@media (max-width: 1023px) {
  .cf-price { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 16px; }
  .cf-price__v { margin: 0; font-size: 1.25rem; }
  .cf-price__s, .cf-price__d { display: none; }
}

@media (max-width: 1023px) {
  /* Bij de aanvraag: tekening niet vastzetten, zodat de velden ruimte hebben */
  .cf-grid.is-aanvraag .cf-sheet { position: static; box-shadow: none; }
  .cf-grid.is-aanvraag .cf-price { position: static; }
}
