:root {
  --accent: #3b3bf7;
  --accent-light: #5c5cff;
  --accent-dark: #2a2ad4;
  --accent-pale: #eef0ff;
  --text: #0b0c1f;
  --text-secondary: #4f5168;
  --text-tertiary: #75778f;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-hover: #f9faff;
  --border: #e1e3f0;
  --border-strong: #c8cbe0;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(11, 12, 31, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 12, 31, 0.08);
  --shadow-lg: 0 18px 48px rgba(11, 12, 31, 0.12);
  --max-width: 760px;
  --transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  padding: 20px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.brand svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--accent);
}

.header-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.main {
  flex: 1;
  padding: 8px 0 48px;
}

.wizard-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 20px 24px;
  overflow: hidden;
}

.wizard-intro {
  text-align: center;
  margin-bottom: 28px;
}

.wizard-intro h1 {
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.wizard-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

/* Progress */
.progress {
  margin-bottom: 32px;
}

.progress-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  position: relative;
}

.progress-track::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-tertiary);
  border: 2px solid var(--border);
  transition: var(--transition);
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: var(--transition);
}

.progress-step.active .step-badge,
.progress-step.complete .step-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.progress-step.complete .step-badge {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.progress-step.active .step-label,
.progress-step.complete .step-label {
  color: var(--text);
}

/* Steps */
.quote-form {
  position: relative;
}

.steps-panels {
  position: relative;
  min-height: 360px;
}

.step-panel {
  display: none;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 260ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.step-panel.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.step-panel.prev {
  transform: translateX(-18px);
}

.step-title {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.step-hint {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* Choice cards */
.radio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.radio-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.choice-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.choice-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.choice-card:focus-within {
  outline: 3px solid var(--accent-pale);
  outline-offset: 2px;
}

.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-pale);
  box-shadow: var(--shadow-sm);
}

.choice-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--accent);
}

.choice-icon svg {
  width: 40px;
  height: 40px;
}

.choice-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.choice-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.choice-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.choice-price {
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 2px;
}

.choice-price strong {
  color: var(--text);
  font-weight: 700;
}

.choice-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.choice-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  background: #fff;
  padding: 4px 8px;
  border-radius: 20px;
}

.choice-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.choice-check::after {
  content: "";
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
}

.choice-card:has(input:checked) .choice-check {
  background: var(--accent);
  border-color: var(--accent);
}

.choice-card:has(input:checked) .choice-check::after {
  width: 6px;
  height: 6px;
}

/* Options */
.option-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.option-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.option-row input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.option-row:focus-within {
  outline: 3px solid var(--accent-pale);
  outline-offset: 2px;
}

.option-row:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-pale);
}

.option-box {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex-shrink: 0;
  color: transparent;
}

.option-box svg {
  width: 14px;
  height: 14px;
}

.option-row:has(input:checked) .option-box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.option-name {
  font-weight: 700;
  font-size: 15px;
}

.option-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.option-price {
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 14px;
  flex-shrink: 0;
}

/* Form fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.label-optional {
  font-weight: 400;
  color: var(--text-tertiary);
}

.field input,
.field textarea {
  font: inherit;
  padding: 13px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
  width: 100%;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--border-strong);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-pale);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-tertiary);
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field.field-error input,
.field.field-error textarea {
  border-color: #d32f2f;
}

/* Errors */
.error-msg {
  display: none;
  color: #d32f2f;
  font-size: 14px;
  font-weight: 500;
  margin: 10px 0 0;
  align-items: center;
  gap: 6px;
}

.error-msg::before {
  content: "⚠";
  font-size: 16px;
}

.error-msg.visible {
  display: flex;
}

/* Wizard nav */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
  text-decoration: none;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

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

.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--primary:focus-visible {
  outline: 3px solid var(--accent-pale);
  outline-offset: 2px;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn--ghost:focus-visible {
  outline: 3px solid var(--accent-pale);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.nav-back {
  min-width: 96px;
}

.nav-next {
  min-width: 140px;
  margin-left: auto;
}

/* Summary */
.step-panel--summary {
  text-align: center;
}

.estimate-card {
  background: var(--accent-pale);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  text-align: left;
  border: 1px solid #dfe2ff;
}

.estimate-breakdown {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d9dcf7;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 15px;
}

.breakdown-item strong {
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.breakdown-item .item-note {
  color: var(--text-tertiary);
  font-size: 13px;
}

.breakdown-item .item-price {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.breakdown-item.subtotal {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #d9dcf7;
  font-weight: 600;
}

.breakdown-item.timeline {
  color: var(--accent-dark);
}

.estimate-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.total-value {
  font-size: clamp(36px, 9vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -0.03em;
}

.total-note {
  font-size: 13px;
  color: var(--text-tertiary);
}

.summary-contact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
  text-align: left;
  font-size: 14px;
}

.summary-contact p {
  margin: 0 0 4px;
  color: var(--text-secondary);
}

.summary-contact strong {
  color: var(--text);
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.success-toast {
  display: none;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: #e7f9ed;
  color: #166534;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
}

.success-toast.visible {
  display: block;
  animation: toast-in 320ms ease;
}

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

/* Footer */
.site-footer {
  padding: 28px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet */
@media (min-width: 768px) {
  .wizard-card {
    padding: 40px 44px 36px;
  }

  .radio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field--full {
    grid-column: 1 / -1;
  }

  .summary-actions {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .wizard-nav {
    margin-top: 34px;
  }
}

/* Desktop */
@media (min-width: 1280px) {
  .main {
    padding-top: 24px;
  }

  .wizard-card {
    padding: 48px 52px 44px;
  }

  .progress-track::before {
    top: 15px;
  }

  .step-badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .step-label {
    font-size: 13px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
