:root {
  --bg: #f7f4ef;
  --paper: #ffffff;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fff7ed;
  --wizard-bg-1: url("https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1600&q=80");
  --wizard-bg-2: url("https://images.unsplash.com/photo-1519641471654-76ce0107ad1b?auto=format&fit=crop&w=1600&q=80");
  --wizard-bg-3: url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1600&q=80");
  --wizard-bg-4: url("https://images.unsplash.com/photo-1618843479313-40f8afb4b4d0?auto=format&fit=crop&w=1600&q=80");
  --wizard-bg: var(--wizard-bg-1);
}

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

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

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--ink);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

.shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

/* Sidebar: variant C — top strip + bottom card (backups in public/backups/) */
.sidebar {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink);
  color: #fafaf9;
  overflow: hidden;
}

.sidebar-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 48%;
  pointer-events: none;
  user-select: none;
}

.sidebar--c::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 10, 9, 0.88) 0%, rgba(12, 10, 9, 0.45) 45%, rgba(12, 10, 9, 0.15) 100%),
    linear-gradient(
      180deg,
      rgba(12, 10, 9, 0.9) 0%,
      rgba(12, 10, 9, 0.45) 28%,
      rgba(12, 10, 9, 0.2) 50%,
      rgba(12, 10, 9, 0.35) 72%,
      rgba(12, 10, 9, 0.92) 100%
    );
  z-index: 1;
  pointer-events: none;
}

.sidebar-layout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar-top {
  flex-shrink: 0;
  padding: clamp(16px, 2.5vh, 28px) clamp(14px, 2.5vw, 24px) 0;
}

.sidebar-top__card {
  padding: clamp(16px, 2vw, 22px) clamp(16px, 2vw, 20px);
  border-radius: 16px;
  background: rgba(12, 10, 9, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 3px solid var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.sidebar-top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sidebar-top__reviews {
  flex-shrink: 0;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  background: rgba(180, 83, 9, 0.75);
  border: 1px solid rgba(253, 186, 116, 0.55);
  transition: background 0.2s, color 0.2s;
}

.sidebar-top__reviews:hover {
  background: var(--accent);
  color: #fff;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}

.sidebar-stats div {
  padding: 10px 8px;
  border-radius: 10px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-stats dt {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fdba74;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.sidebar-stats dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.sidebar-spacer {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(72px, 14vh, 180px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 clamp(14px, 2.5vw, 24px) clamp(8px, 2vh, 16px);
  pointer-events: none;
}

.sidebar-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  background: rgba(12, 10, 9, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(253, 186, 116, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.sidebar-hint__label {
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

.sidebar-hint__arrow {
  font-size: 1.15rem;
  color: #fbbf24;
  line-height: 1;
}

.sidebar-hint__text {
  color: #f5f5f4;
}

.sidebar-hint__text--mobile {
  display: none;
}

.sidebar-bottom {
  flex-shrink: 0;
  margin: 0 clamp(14px, 2.5vw, 24px) clamp(16px, 2.5vh, 24px);
  padding: clamp(16px, 2vw, 20px) clamp(14px, 2vw, 18px);
  border-radius: 18px;
  background: rgba(12, 10, 9, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.sidebar-bottom__eyebrow {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sidebar-badge {
  display: inline-block;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  background: rgba(180, 83, 9, 0.85);
  border: 1px solid rgba(253, 186, 116, 0.6);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.sidebar-title {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  max-width: 16ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(0, 0, 0, 0.5);
}

.sidebar-lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #f5f5f4;
  max-width: 32ch;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.sidebar-features {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.sidebar-features--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sidebar-feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 100%;
  padding: 12px 10px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-feature-card--accent {
  background: rgba(180, 83, 9, 0.12);
  border-color: rgba(253, 186, 116, 0.25);
}

.sidebar-feature-card__num {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(251, 191, 36, 0.75);
}

.sidebar-feature-card__text {
  flex: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.sidebar-features__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #d97706);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-action {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-action--primary {
  color: #fff;
  background: linear-gradient(145deg, #c2410c, #d97706);
  border: 1px solid rgba(253, 186, 116, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.sidebar-action--primary:hover {
  background: var(--accent-hover);
}

.sidebar-action--ghost {
  color: #e7e5e4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-action--ghost:hover {
  color: #fdba74;
  border-color: rgba(253, 186, 116, 0.35);
}

.wizard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(24px, 4vh, 40px) clamp(20px, 5vw, 72px);
  isolation: isolate;
  overflow: hidden;
}

.wizard-header,
.wizard-form,
.legal-footer {
  width: 100%;
  max-width: min(36rem, 100%);
}

.wizard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(
      108deg,
      rgba(247, 244, 239, 0.96) 0%,
      rgba(247, 244, 239, 0.88) 42%,
      rgba(247, 244, 239, 0.78) 100%
    ),
    var(--wizard-bg) center / cover no-repeat;
  transition: opacity 0.45s ease;
}

.wizard[data-step="1"] {
  --wizard-bg: var(--wizard-bg-1);
}

.wizard[data-step="2"] {
  --wizard-bg: var(--wizard-bg-2);
}

.wizard[data-step="3"] {
  --wizard-bg: var(--wizard-bg-3);
}

.wizard[data-step="4"] {
  --wizard-bg: var(--wizard-bg-4);
}

.wizard > * {
  position: relative;
  z-index: 1;
}

.wizard-header {
  margin-bottom: 28px;
}

.wizard-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.wizard-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s, transform 0.2s;
}

.wizard-dots span.active {
  background: var(--accent);
  transform: scale(1.15);
}

.wizard-dots span.done {
  background: #d6d3d1;
}

.wizard-step-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.wizard-form {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
}

.wizard-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.wizard-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-panel h2 {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}

.panel-hint {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.option-grid {
  display: grid;
  gap: 12px;
}

.option-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.option-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.option-card--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.option-card--compact {
  align-items: center;
  text-align: center;
  padding: 18px 10px;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.12);
}

.option-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.option-icon.fi {
  display: inline-block;
  width: 2.125rem;
  height: 1.5rem;
  font-size: 2.125rem;
  line-height: 1.5rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.18);
  outline: 1px solid rgba(28, 25, 23, 0.08);
  background-size: cover;
  background-position: center;
}

.option-card--wide .option-icon:not(.fi) {
  font-size: 1.35rem;
}

.option-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.option-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  cursor: pointer;
}

.pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill span {
  display: inline-block;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  font-weight: 500;
  font-size: 0.92rem;
  transition: border-color 0.2s, background 0.2s;
}

.pill:has(input:checked) span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.lead-fields {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-fields input[type="text"],
.lead-fields input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  color: var(--ink);
}

.lead-fields input:focus {
  outline: none;
  border-color: var(--accent);
}

.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}

.agree input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.status-message {
  min-height: 1.25em;
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--accent-hover);
  font-weight: 500;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 32px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  visibility: hidden;
}

.btn-ghost.visible {
  visibility: visible;
}

.legal-footer {
  margin: 20px 0 0;
  padding-top: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #44403c;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 900px) {
  body {
    background: var(--bg);
  }

  .shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    min-height: auto;
  }

  .wizard {
    order: -1;
  }

  .sidebar--c {
    order: 0;
    min-height: 0;
    max-height: none;
  }

  .sidebar--c::after {
    background:
      linear-gradient(
        180deg,
        rgba(12, 10, 9, 0.92) 0%,
        rgba(12, 10, 9, 0.55) 40%,
        rgba(12, 10, 9, 0.88) 100%
      );
  }

  .sidebar--c .sidebar-bg {
    object-position: center 38%;
  }

  .sidebar--c .sidebar-layout {
    min-height: 0;
  }

  .sidebar--c .sidebar-spacer {
    display: none;
  }

  .sidebar-hint__text--desktop {
    display: none;
  }

  .sidebar-hint__text--mobile {
    display: inline;
  }

  .sidebar-top {
    padding: 12px 14px 0;
  }

  .sidebar-top__card {
    padding: 14px 14px 12px;
    border-radius: 14px;
  }

  .sidebar--c .sidebar-title {
    max-width: none;
    font-size: clamp(1.2rem, 5.5vw, 1.55rem);
  }

  .sidebar--c .sidebar-lead {
    max-width: none;
    font-size: 0.84rem;
  }

  .sidebar--c .sidebar-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .sidebar-stats div {
    padding: 8px 4px;
  }

  .sidebar-stats dt {
    font-size: 0.62rem;
  }

  .sidebar-stats dd {
    font-size: 0.82rem;
  }

  .sidebar-bottom {
    margin: 0 14px 14px;
    padding: 14px 12px;
    border-radius: 14px;
  }

  .sidebar-bottom__eyebrow {
    margin-bottom: 10px;
    font-size: 0.68rem;
  }

  .sidebar--c .sidebar-features--grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sidebar--c .sidebar-feature-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .sidebar--c .sidebar-feature-card__num {
    font-size: 0.9rem;
    min-width: 1.4rem;
  }

  .sidebar-actions {
    gap: 8px;
  }

  .sidebar-action {
    padding: 13px 12px;
    font-size: 0.88rem;
  }

  .wizard {
    min-height: auto;
    justify-content: flex-start;
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      calc(96px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  .wizard-header {
    margin-bottom: 20px;
  }

  .wizard-panel h2 {
    font-size: clamp(1.28rem, 5.2vw, 1.65rem);
  }

  .panel-hint {
    margin-bottom: 18px;
    font-size: 0.9rem;
  }

  .option-grid {
    gap: 10px;
  }

  .option-card {
    min-height: 52px;
    padding: 14px 12px;
    -webkit-tap-highlight-color: transparent;
  }

  .option-grid--2 {
    grid-template-columns: 1fr;
  }

  .option-card--wide {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .option-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-card--compact {
    min-height: 48px;
    padding: 14px 8px;
  }

  .pill span {
    padding: 12px 16px;
    font-size: 0.88rem;
  }

  .lead-fields input[type="text"],
  .lead-fields input[type="tel"] {
    font-size: 16px;
  }

  .wizard-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    margin-top: 0;
    padding:
      10px
      max(16px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    background: rgba(247, 244, 239, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(28, 25, 23, 0.08);
  }

  .btn {
    min-height: 48px;
    touch-action: manipulation;
  }

  .btn-primary {
    flex: 1;
    margin-left: 0;
  }

  .btn-ghost.visible {
    flex: 0 0 auto;
    min-width: 5.5rem;
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-footer {
    margin-top: 16px;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 0.7rem;
    line-height: 1.45;
  }
}

@media (max-width: 480px) {
  .wizard {
    padding-bottom: calc(152px + env(safe-area-inset-bottom));
  }

  .sidebar-top__row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidebar-badge {
    font-size: 0.65rem;
    padding: 6px 10px;
  }

  .sidebar-top__reviews {
    font-size: 0.72rem;
    padding: 5px 11px;
  }

  .option-grid--3 {
    grid-template-columns: 1fr;
  }

  .option-card--wide {
    flex-direction: column;
    align-items: flex-start;
  }

  .pill-row {
    flex-direction: column;
  }

  .pill {
    width: 100%;
  }

  .pill span {
    display: block;
    width: 100%;
    text-align: center;
  }

  .wizard-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .btn-primary,
  .btn-ghost.visible {
    width: 100%;
    flex: none;
  }

  .legal-footer {
    font-size: 0.68rem;
  }
}
