/* Räum Designs Bifold Door Builder — 2026 refresh */

:root {
  --navy: #131522;
  --navy-2: #252a3d;
  --sage: #81aa8f;
  --sage-dark: #44735a;   /* AA contrast on white for text and links */
  --sage-tint: #eef4f0;
  --ink: #1d2130;
  --muted: #5c6270;
  --line: #dfe3dc;
  --bg: #f4f5f2;
  --card: #ffffff;
  --danger: #b42318;
  --danger-tint: #fef3f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 21, 34, .06), 0 4px 16px rgba(19, 21, 34, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy) url('https://www.raumdesigns.co.uk/wp-content/themes/raum/images/hero/raum-bifold-doors.jpg') center / cover fixed;
  color: var(--ink);
  font: 16px/1.5 var(--font);
}

img { max-width: 100%; -webkit-user-drag: none; }

a { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--navy); }

h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 700; letter-spacing: -.01em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* ---------- Dark shell over the photo (as in the original design) ---------- */

.shell {
  max-width: 1100px;
  margin: 16px auto;
  padding: 12px;
  background: var(--navy);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.site-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 10px 12px 18px;
  color: #fff;
}
.site-header__logo img { display: block; height: 58px; width: auto; }
.site-header__contact { text-align: right; line-height: 1.15; }
.site-header__label { display: block; font-size: .85rem; color: #a9adbb; letter-spacing: .02em; }
.site-header__phone { color: var(--sage); font-size: 2rem; font-weight: 300; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.site-header__phone:hover { color: #fff; }

/* "Stage 1 2 3" indicator */
.stages { text-align: center; }
.stages__title { display: block; color: #a9adbb; font-size: 1.15rem; font-weight: 300; letter-spacing: .04em; margin-bottom: 4px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 14px; }
.steps__item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; }
.steps__num {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff; background: #fff; color: var(--navy); font-size: 1.1rem; font-weight: 600;
}
.steps__label { font-size: .72rem; color: #a9adbb; white-space: nowrap; }
.steps__item--current .steps__num { background: var(--sage); border-color: var(--sage); color: var(--navy); box-shadow: 0 0 0 4px rgba(129, 170, 143, .3); }
.steps__item--current .steps__label { color: #fff; font-weight: 600; }
.steps__item--done .steps__num { background: transparent; border-color: var(--sage); color: var(--sage); }
.steps__item--done .steps__label { color: var(--sage); }

.page { padding: 0; }

.stack > * + * { margin-top: 12px; }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 22px 24px;
}
.card p { margin: 10px 0 0; }
.card__foot { margin-top: 14px !important; font-size: .95rem; }

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

.howto { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: howto; }
.howto li { counter-increment: howto; display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.howto li::before {
  content: counter(howto); flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--sage-tint); color: var(--sage-dark); font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.card__title { font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.card__hint { margin: 6px 0 18px !important; color: var(--muted); font-size: .95rem; }
.card__title + .option-group, .card__title + .swatches, .card__title + .summary { margin-top: 16px; }

.empty-state {
  margin-top: 16px; padding: 28px 20px; border: 2px dashed var(--line); border-radius: 12px;
  text-align: center; color: var(--muted);
}

/* ---------- Form fields ---------- */

.field { display: block; }
.field__label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.field__optional { font-weight: 400; color: var(--muted); }
.field__help { display: block; margin-top: 6px; font-size: .85rem; color: var(--muted); }

.field input[type=text], .field input[type=email], .field input[type=tel], .field select {
  width: 100%; height: 46px; padding: 0 14px;
  font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #c4cac1; border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(129, 170, 143, .35); }
.field input::placeholder { color: #9aa0a8; }

.field__input--unit { position: relative; display: block; }
.field__input--unit input { padding-right: 48px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.field__unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.field input.is-invalid { border-color: var(--danger); background: var(--danger-tint); }

.size-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 20px; }
.size-message { min-height: 1.5em; margin: 12px 0 0; color: var(--danger); font-size: .9rem; font-weight: 600; }

.other-field { margin-top: 14px; max-width: 360px; }

.checkbox { display: flex; align-items: center; gap: 10px; font-size: .95rem; cursor: pointer; align-self: end; min-height: 46px; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--navy); }

.details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }

/* Spry validation states */
.field__error { display: none; margin-top: 6px; color: var(--danger); font-size: .85rem; font-weight: 600; }
.textfieldRequiredState .textfieldRequiredMsg,
.textfieldInvalidFormatState .textfieldInvalidFormatMsg,
.textfieldMinCharsState .textfieldMinCharsMsg,
.textfieldMaxCharsState .textfieldMaxCharsMsg { display: block; }
.field .textfieldRequiredState input, .field .textfieldInvalidFormatState input,
.field .textfieldMinCharsState input, .field .textfieldMaxCharsState input,
.field input.textfieldRequiredState, .field input.textfieldInvalidFormatState,
.field input.textfieldMinCharsState, .field input.textfieldMaxCharsState {
  border-color: var(--danger); background-color: var(--danger-tint);
}
.field .textfieldValidState input, .field input.textfieldValidState { background-color: #fff; }
.field .textfieldFocusState input, .field input.textfieldFocusState { background-color: #fff; }

.form-error {
  display: none; padding: 12px 16px; border-radius: 10px;
  background: var(--danger-tint); color: var(--danger); font-weight: 600; border: 1px solid #fecdca;
}
.config-error { margin-top: 16px; }

/* ---------- Buttons ---------- */

.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.actions--split { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-2); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: #c4cac1; }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); }

.link-subtle { font-size: .9rem; font-weight: 600; }

/* ---------- Stage 1: layout cards ---------- */

.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.config-card { cursor: pointer; position: relative; }
.config-card__body {
  display: flex; flex-direction: column; height: 100%;
  padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.config-card img { display: block; width: 100%; height: auto; aspect-ratio: 219 / 114; object-fit: contain; margin-bottom: 10px; mix-blend-mode: multiply; }
.config-card__name { font-weight: 700; }
.config-card__desc { font-size: .88rem; color: var(--muted); }
.config-card:hover .config-card__body { border-color: #b9c4bb; }
.config-card input:checked + .config-card__body { border-color: var(--sage-dark); background: var(--sage-tint); box-shadow: 0 0 0 3px rgba(129, 170, 143, .3); }
.config-card input:checked + .config-card__body::after {
  content: "\2713"; position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--sage-dark); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700;
}
.config-card input:focus-visible + .config-card__body { outline: 3px solid var(--sage); outline-offset: 2px; }

/* ---------- Stage 2: builder layout ---------- */

.builder { display: grid; gap: 12px; }

.options-layout {
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "frame options" "furn options" "details details" "error error" "actions actions";
  align-items: start;
}
.area-frame { grid-area: frame; }
.area-furn { grid-area: furn; }
.area-options { grid-area: options; align-self: stretch; }
.area-details { grid-area: details; }
.options-layout > #error_zone { grid-area: error; }
.options-layout > .actions { grid-area: actions; }
.options-layout--finish { grid-template-areas: none; }
.options-layout.options-layout--finish > * { grid-area: auto; }
.options-layout.options-layout--finish > .area-full { grid-column: 1 / -1; }

.options-layout .actions { margin-top: 0; padding: 4px 0 0; }
.options-layout .btn--ghost { color: #fff; border-color: #4a5068; }
.options-layout .btn--ghost:hover { border-color: #fff; color: #fff; }
.options-layout .btn--primary { background: var(--sage); color: var(--navy); }
.options-layout .btn--primary:hover { background: #95bba2; color: var(--navy); }
.stack .btn--primary { background: var(--navy); color: #fff; }

.preview-card { background: var(--card); border-radius: 12px; overflow: hidden; }
#preview {
  background: radial-gradient(ellipse at 50% 30%, #9cbfa7 0%, var(--sage) 70%);
  padding: 24px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
#bifold { position: relative; width: 100%; height: clamp(200px, 30vw, 330px); }
#bifold img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(19, 21, 34, .18)); }
#internal-furniture { z-index: 1; }
#frame { z-index: 2; }
#external-furniture { z-index: 3; }

.preview-card__summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); }
.preview-card__summary strong { display: block; }
.preview-card__summary span { color: var(--muted); font-size: .92rem; }
.preview-card__note { margin: 0; padding: 0 20px 16px; color: var(--muted); font-size: .85rem; }
.preview-card__summary + .preview-card__note { padding-top: 0; }
#preview + .preview-card__note { padding-top: 14px; }

.option-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.option-group + .option-group { margin-top: 20px; }
.option-group legend { padding: 0; margin-bottom: 10px; font-size: .9rem; font-weight: 600; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.option-grid .option-group + .option-group { margin-top: 0; }

/* Text choice pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { cursor: pointer; }
.pill span {
  display: inline-block; padding: 8px 14px; min-height: 40px; line-height: 22px;
  border: 1px solid #c4cac1; border-radius: 999px; background: #fff; font-size: .92rem;
  transition: background .15s, color .15s, border-color .15s;
}
.pill:hover span { border-color: var(--navy); }
.pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--sage); outline-offset: 2px; }

/* Colour swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.swatch { cursor: pointer; width: 72px; text-align: center; }
.swatch__chip {
  display: block; width: 52px; height: 52px; margin: 0 auto 6px;
  border-radius: 12px; overflow: hidden; border: 1px solid #c4cac1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
  transition: box-shadow .15s, transform .15s;
}
.swatch__chip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.swatch__name { display: block; font-size: .82rem; line-height: 1.25; color: var(--muted); }
.swatch:hover .swatch__chip { transform: translateY(-1px); }
.swatch input:checked + .swatch__chip { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sage-dark); }
.swatch input:checked + .swatch__chip + .swatch__name { color: var(--ink); font-weight: 600; }
.swatch input:focus-visible + .swatch__chip { outline: 3px solid var(--sage); outline-offset: 4px; }

/* ---------- Stage 3: confirmation ---------- */

.confirmation { display: flex; gap: 18px; align-items: flex-start; }
.confirmation__icon {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--sage); color: var(--navy); font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.confirmation p { margin: 8px 0 0; color: var(--muted); }
.confirmation h1 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); }
.confirmation__ref { font-size: 1.05rem; }
.confirmation__ref strong { color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.summary { margin: 16px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.summary div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary dt { font-size: .82rem; color: var(--muted); }
.summary dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Footer, help dialog ---------- */

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  padding: 14px 12px 4px; color: #6f7487; font-size: .85rem;
}
.site-footer a { color: #a9adbb; }
.site-footer a:hover { color: #fff; }

#lightbox { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(19, 21, 34, .6); }
#lightbox-panel {
  display: none; position: fixed; z-index: 101;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
#lightbox-panel h2 { font-size: 1.3rem; margin-bottom: 12px; padding-right: 40px; }
#lightbox-panel h3 { font-size: 1rem; margin: 18px 0 4px; }
#lightbox-panel p { margin: 0 0 8px; color: var(--muted); }
.lightbox-close {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: var(--bg); font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.lightbox-close:hover { background: var(--line); }

.js-warning { position: fixed; inset: auto 0 0 0; padding: 16px; background: var(--danger); color: #fff; text-align: center; font-weight: 600; z-index: 200; }

.printShow { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .options-layout { grid-template-columns: 1fr; grid-template-areas: "frame" "furn" "options" "details" "error" "actions"; }
  .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-header { grid-template-columns: auto 1fr; }
  .site-header__contact { grid-column: 2; grid-row: 1; }
  .stages { grid-column: 1 / -1; grid-row: 2; }
  /* Keep the preview in view while scrolling the options */
  .builder:not(.builder--finish) .builder__preview { position: sticky; top: 0; z-index: 5; }
  .builder:not(.builder--finish) .preview-card { box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
  .builder:not(.builder--finish) #preview { padding: 12px 16px; }
  .builder:not(.builder--finish) #bifold { height: 24vh; }
  .builder:not(.builder--finish) .preview-card__note { display: none; }
  .builder:not(.builder--finish) .preview-card__summary { padding: 10px 16px; }
}

@media (max-width: 640px) {
  body { background: var(--navy); }
  .shell { margin: 0; border-radius: 0; padding: 8px; box-shadow: none; }
  .site-header { padding: 8px 6px 14px; gap: 12px; }
  .site-header__logo img { height: 38px; }
  .site-header__label { display: none; }
  .site-header__phone { font-size: 1.25rem; font-weight: 400; }
  .stages__title { display: none; }
  .steps { gap: 6px; }
  .steps__item { width: auto; flex: 1; }
  .steps__num { width: 32px; height: 32px; font-size: .95rem; }
  .card { padding: 18px; }
  .row--2, .size-fields, .details-grid, .option-grid, .summary, .options-layout--finish { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .config-card__body { padding: 10px; }
  .actions, .actions--split { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .confirmation { flex-direction: column; gap: 12px; }
}

/* ---------- Print (finish page) ---------- */

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .shell { background: #fff; box-shadow: none; padding: 0; margin: 0; max-width: none; }
  .card { border: 1px solid var(--line); }
  .site-header, .steps, .site-footer, .printHide, #lightbox, #lightbox-panel { display: none !important; }
  .printShow { display: block !important; }
  h1.printShow { display: block !important; }
  .page { padding: 0; max-width: none; }
  .card, .preview-card { box-shadow: none; break-inside: avoid; }
  .builder__preview { position: static; }
  .confirmation__icon { display: none; }
}
