:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --border: #d1d5db;
  --danger: #b91c1c;
  --success-bg: #ecfdf3;
  --success-text: #166534;
  --shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1rem;
}

.header h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  letter-spacing: -0.02em;
}

.header p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1rem;
}

.layout { display: grid; gap: 1rem; }

.card {
  background: var(--panel);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.wizard { padding: 1rem; }
.summary { padding: 1rem; }
.summary h2 { margin: 0; font-size: 1.2rem; }
.summary-head { margin-bottom: .5rem; }

.progress-line {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin: .65rem 0 .9rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width .28s ease;
}

.stepper {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .25rem;
  margin-bottom: 1rem;
}

.step-chip {
  flex: 0 0 auto;
  min-width: 120px;
  font-size: .78rem;
  text-align: center;
  padding: .45rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #fff;
  scroll-snap-align: center;
  transition: all .2s ease;
}

.step-chip.active {
  background: var(--primary-soft);
  color: #1e40af;
  border-color: #93c5fd;
  font-weight: 600;
}

.step-chip.complete {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.step-content {
  animation: fadeSlide .26s ease;
}

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

label { display: block; font-weight: 600; margin-bottom: .45rem; }

input[type="number"],
select {
  width: 100%;
  font-size: 1rem;
  padding: .68rem .78rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}

.control { margin-bottom: 1rem; }

.option-grid {
  display: grid;
  gap: .65rem;
}

.radio-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .86rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .65rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.radio-card:focus-within,
.radio-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px #dbeafe;
  transform: translateY(-1px);
}

.radio-card input { accent-color: var(--primary); }
.muted { color: var(--muted); font-size: .92rem; }
.row { display: grid; gap: .9rem; }
.error { color: var(--danger); font-size: .85rem; margin-top: .35rem; }

.toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-bottom: .8rem;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1.2rem;
}

button {
  border: 0;
  border-radius: 10px;
  padding: .74rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}

button:hover:not([disabled]) { transform: translateY(-1px); }

.btn-secondary { background: #e5e7eb; color: #111827; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not([disabled]) { background: var(--primary-dark); }
button[disabled] { opacity: .55; cursor: not-allowed; }

.summary dl { margin: 0; }
.summary dt { font-size: .8rem; color: var(--muted); margin-top: .75rem; }
.summary dd { margin: .2rem 0 0; font-weight: 600; }

.success {
  display: none;
  margin-top: 1rem;
  padding: .8rem;
  border-radius: 10px;
  border: 1px solid #86efac;
  background: var(--success-bg);
  color: var(--success-text);
}

.success.show { display: block; }

pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: .75rem;
  overflow: auto;
  font-size: .82rem;
}

.mobile-summary { margin-top: 1rem; }
.desktop-summary { display: none; }

@media (min-width: 700px) {
  .wizard { padding: 1.2rem; }
  .summary { padding: 1.15rem; }
  .row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
  .container { padding: 1.6rem; }
  .layout { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; gap: 1.2rem; }
  .desktop-summary {
    display: block;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
  .mobile-summary { display: none; }
  .stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
  }

  .step-chip {
    min-width: 0;
    font-size: .74rem;
    padding: .45rem .3rem;
  }
}
