
:root {
  --purple: #651e7c;
  --purple-dark: #4c145f;
  --purple-soft: #d8c3df;
  --gray-card: #b5b5b7;
  --gray-line: #bcbcc0;
  --gray-text: #666;
  --gray-bg: #efefef;
  --border: #d9c5e0;
  --danger: #c33b3b;
  --success: #1f7a46;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #ffffff;
  color: #2b2b2d;
}

.page-wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 22px 24px 56px;
}

.wizard-shell {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 0 0 28px;
}

.stepper-item { text-align: center; }
.stepper-line {
  height: 7px;
  background: var(--gray-line);
  transition: background 0.2s ease;
}

.stepper-label {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.35;
  color: #a0a0a5;
  transition: color 0.2s ease;
}

.stepper-item.is-active .stepper-line,
.stepper-item.is-complete .stepper-line { background: var(--purple); }
.stepper-item.is-active .stepper-label,
.stepper-item.is-complete .stepper-label { color: var(--purple); }

.step-panel {
  display: none;
  animation: fadeUp 0.22s ease;
}
.step-panel.is-active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-panel[data-step-panel="1"],
.step-panel[data-step-panel="3"] { background: #ffffff; }

.section-title {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 400;
  color: #2f2f33;
}
.section-hint {
  margin: 0 0 28px;
  color: var(--gray-text);
  line-height: 1.65;
  font-size: 14px;
}

.selection-grid {
  display: grid;
  gap: 34px;
  margin-bottom: 24px;
  align-items: start;
}
.selection-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-card {
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  position: relative;
  min-height: 0;
  cursor: pointer;
  transition: border-color 0.2s ease;
  text-align: left;
}
.option-card.is-selected {
  border-color: #b88ac8;
  padding: 8px;
}
.option-visual {
  height: 184px;
  background: var(--gray-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #fff;
  font-size: 24px;
  line-height: 1.35;
  position: relative;
  overflow: hidden;
  transition: background 0.22s ease;
}
.option-card.is-selected .option-visual { background: var(--purple); }

.option-copy {
  margin-top: 16px;
  text-align: center;
  display: none;
}
.option-copy-title {
  color: #2b2b2d;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.option-copy-text {
  color: var(--gray-text);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}
.option-card.is-selected .option-copy.has-content { display: block; }

.selected-corner-icon {
  width: 26px;
  height: 26px;
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  z-index: 4;
  pointer-events: none;
}
.option-card.is-selected > .option-visual .selected-corner-icon,
.product-card.is-selected .product-image > .selected-corner-icon,
.swatch-btn.is-selected > .selected-corner-icon { display: block; }

.installer-extra {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-top: 8px;
}
.installer-extra.is-visible { display: block; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}
.field { width: 100%; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #2f2f33;
}
.input,
.textarea {
  width: 100%;
  border: 1px solid #cfcfd3;
  background: #fff;
  padding: 12px 14px;
  font-size: 15px;
  color: #2b2b2d;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(101, 30, 124, 0.65);
  box-shadow: none;
}
.textarea {
  min-height: 140px;
  resize: vertical;
}
.error-text {
  display: none;
  margin-top: 7px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}
.field.has-error .input,
.field.has-error .textarea,
.validation-box.has-error { border-color: rgba(195, 59, 59, 0.6); }
.field.has-error .error-text,
.validation-box.has-error .error-text { display: block; }
.validation-box {
  display: none;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
}
.validation-box.has-error { display: block; }

.products-wrap {
  display: none;
  width: 100%;
  margin-top: 32px;
  padding: 30px;
  background: var(--gray-bg);
}
.products-wrap.is-visible { display: block; }

.product-list {
  display: grid;
  gap: 38px;
}
.product-card {
  border: 0;
  background: transparent;
  padding: 0;
}
.product-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 28px;
  align-items: start;
}
.product-visual-select {
  cursor: default;
  max-width: 380px;
  width: 100%;
}
.product-image {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 8 / 5;
  background: #fff;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.product-card.is-selected .product-image { border-color: #b88ac8; }
.product-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-body {
  display: grid;
  grid-template-columns: minmax(220px, 240px) 1fr;
  gap: 26px;
  align-items: start;
}
.product-name {
  margin: 4px 0 10px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 400;
}
.product-desc {
  margin: 10px 0 0;
  color: var(--gray-text);
  font-size: 14px;
  line-height: 1.75;
}
.product-specs {
  margin-top: 10px;
  color: #444;
  font-size: 14px;
  line-height: 1.75;
}
.swatches-box { background: transparent; min-height: 100%; }
.swatches-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.swatches-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: #8a8a90;
  line-height: 1.5;
}
.swatches-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 140px));
  gap: 14px 18px;
  align-items: start;
}
.swatch-btn {
  width: 140px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-align: center;
  position: relative;
  overflow: visible;
  justify-self: start;
}
.swatch-btn.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.swatch-tone {
  width: 140px;
  max-width: 140px;
  aspect-ratio: 2 / 1;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  margin-bottom: 8px;
  position: relative;
  border: 1px solid transparent;
  background: #fff;
}
.swatch-btn.is-selected .swatch-tone { border-color: rgba(101, 30, 124, 0.7); }
.swatch-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.swatch-name {
  font-size: 12px;
  line-height: 1.45;
  color: #36363a;
  font-weight: 400;
  padding: 0 4px 2px;
  min-height: 20px;
}
.swatch-btn .selected-corner-icon {
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
}

.summary-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.summary-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 400;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}
.summary-item {
  border: 1px solid #ece1f0;
  padding: 12px 14px;
  background: #fff;
}
.summary-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 6px;
}
.summary-value {
  color: #2b2b2d;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}
.consent-row input {
  margin-top: 4px;
  accent-color: var(--purple);
}
.actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}
.actions > div:empty { display: none; }
.actions-right {
  margin-left: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-width: 126px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  box-shadow: none;
}
.btn:disabled { cursor: not-allowed; opacity: 0.58; }
.btn-secondary { background: #808084; color: #fff; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.result-box {
  display: none;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid #d4eadb;
  background: #f1faf4;
  color: var(--success);
}
.result-box.is-visible { display: block; }
.result-title {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--success);
}
.payload-preview {
  background: rgba(255,255,255,0.96);
  border: 1px solid #e4efe7;
  padding: 14px;
  margin-top: 14px;
  color: #2c3c31;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.required-star { color: var(--purple); }

@media (max-width: 1199px) {
  .product-layout,
  .product-body {
    grid-template-columns: 1fr;
  }
  .product-visual-select { max-width: 380px; }
}
@media (max-width: 991px) {
  .selection-grid.grid-3,
  .summary-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  #regionGrid.selection-grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  #regionGrid .option-card.is-selected {
    padding: 5px;
  }
  #regionGrid .option-visual {
    height: 100px;
    font-size: 18px;
    padding: 12px 8px;
  }
  #regionGrid .option-copy {
    margin-top: 10px;
  }
  .page-wrap { padding: 20px 16px 40px; }
  .stepper { gap: 14px; }
  .stepper-label { font-size: 12px; }
  .option-visual { height: 150px; font-size: 22px; }
  .products-wrap {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    padding: 24px 16px 22px;
  }
}
@media (max-width: 640px) {
  .section-title { font-size: 17px; }
  .section-hint { font-size: 13px; }
  .stepper { gap: 8px; }
  .stepper-label { font-size: 11px; }
  .stepper-line { height: 6px; }
  .option-visual { height: 118px; font-size: 20px; }
  #regionGrid.selection-grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  #regionGrid .option-visual {
    height: 82px;
    font-size: 14px;
    line-height: 1.25;
    padding: 10px 6px;
  }
  #regionGrid .option-card.is-selected {
    padding: 4px;
  }
  #regionGrid .option-copy {
    margin-top: 8px;
  }
  .swatches-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatch-btn,
  .swatch-tone {
    width: 100%;
    max-width: none;
  }
  .actions { flex-direction: column; }
  .actions-right {
    width: 100%;
    margin-left: 0;
  }
  .btn { width: 100%; }
}
