:root {
  --navy: #1e3a5f;
  --navy-deep: #152d4a;
  --navy-mid: #254e7e;
  --navy-tint: #eef2f8;
  --amber: #C9933A;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --text: #111827;
  --text-soft: #4b5563;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(26, 39, 68, 0.08);
  --shadow-lg: 0 8px 40px rgba(26, 39, 68, 0.14);
  --transition: 160ms ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100vh;
  color: var(--text);
  background: var(--gray-50);
}

/* ── Layout ── */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--navy);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 156px;
  height: 36px;
  flex-shrink: 0;
  background: url('logo.png') left center / contain no-repeat;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.2px;
}

.topbar-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 1px;
}

.topbar-save-status {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.save-dot.saving {
  background: #f59e0b;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
}

.form-card {
  width: 100%;
  max-width: 680px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ── Progress ── */

.progress-header {
  background: var(--navy);
  padding: 28px 32px 24px;
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}

.step-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.progress-track {
  display: flex;
  gap: 6px;
  align-items: center;
}

.progress-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  transition: background var(--transition);
  position: relative;
  overflow: hidden;
}

.progress-segment.done {
  background: rgba(255,255,255,0.7);
}

.progress-segment.active {
  background: rgba(255,255,255,0.15);
}

.progress-segment.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  transform-origin: left;
  animation: none;
}

.progress-fill {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  transform-origin: left;
}

.progress-dots {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.progress-dot.done {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}

.progress-dot.active {
  background: transparent;
  border-color: rgba(255,255,255,0.9);
  color: var(--white);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}

.progress-dot-label {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Form body ── */

.form-body {
  padding: 32px;
}

.form-step {
  display: none;
  animation: fadeSlide 240ms ease;
}

.form-step.active {
  display: block;
}

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

.form-group {
  margin-bottom: 24px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: 0.1px;
}

label .required {
  color: var(--amber);
  margin-left: 3px;
}

label .hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-soft);
  margin-left: 4px;
}

input[type="text"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(30,58,95,0.1);
}

::placeholder {
  color: #9CA3AF;
  opacity: 1;
}

input[type="text"].error,
textarea.error,
select.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

textarea.tall {
  min-height: 140px;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

/* ── Radio + Checkbox groups ── */

.radio-group,
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.radio-option,
.checkbox-option {
  position: relative;
}

.radio-option input,
.checkbox-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-option label,
.checkbox-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  gap: 6px;
  min-height: 52px;
  margin: 0;
}

.radio-option input:checked + label,
.checkbox-option input:checked + label {
  border-color: var(--navy);
  background: var(--navy-tint);
  color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

/* Type-knoppen: volle navy achtergrond bij actief */
#projecttype-group .radio-option input:checked + label {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(30,58,95,0.25);
}

#projecttype-group .radio-option input:checked + label svg {
  stroke: var(--white);
}

.radio-option label:hover,
.checkbox-option label:hover {
  border-color: var(--navy-mid);
  color: var(--navy);
}

.radio-option label .option-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: var(--navy);
  transition: stroke var(--transition);
}

#projecttype-group .radio-option label {
  flex-direction: column;
  gap: 8px;
  min-height: 72px;
  padding: 14px 10px;
}

#projecttype-group .radio-option label .option-icon {
  width: 24px;
  height: 24px;
}

/* ── Pages checklist ── */

.pages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.page-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.page-item:hover {
  border-color: var(--navy-mid);
  background: var(--white);
}

.page-item.checked {
  border-color: var(--navy);
  background: var(--navy-tint);
}

.page-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-400);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--white);
}

.page-item.checked .page-checkbox {
  background: var(--navy);
  border-color: var(--navy);
}

.page-checkbox svg {
  display: none;
}

.page-item.checked .page-checkbox svg {
  display: block;
}

.page-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.page-extra-input {
  margin-top: 8px;
}

/* ── Color swatches ── */

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.color-swatch:hover,
.color-swatch.active {
  border-color: var(--navy);
  transform: scale(1.15);
}

.color-swatch.active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Navigation ── */

.form-nav {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: -0.1px;
  min-height: 52px;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--gray-400);
  color: var(--text);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

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

.btn-amber {
  background: var(--navy);
  color: var(--white);
}

.btn-amber:hover {
  background: var(--navy-mid);
}

.btn-outline-amber {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-outline-amber:hover {
  background: var(--navy-tint);
}

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

.btn-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ── Export step ── */

.export-summary {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  color: var(--white);
}

.export-summary-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

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

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-item .key {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-item .val {
  font-size: 14px;
  color: var(--white);
  font-weight: 600;
}

.summary-item .val.empty {
  color: rgba(255,255,255,0.3);
  font-style: italic;
  font-weight: 400;
}

.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.export-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-align: center;
  min-height: 110px;
}

.export-btn:active {
  transform: scale(0.97);
}

.export-btn svg {
  width: 28px;
  height: 28px;
}

.export-btn-md {
  background: var(--navy);
  color: var(--white);
}

.export-btn-md:hover {
  background: var(--navy-mid);
  box-shadow: var(--shadow);
}

.export-btn-json {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
}

.export-btn-json:hover {
  background: var(--navy-tint);
  box-shadow: var(--shadow);
}

.export-btn-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.1px;
}

.export-btn-sub {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 500;
  margin-top: -4px;
}

.reset-btn {
  width: 100%;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.reset-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

/* ── Error message ── */

.field-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
  font-weight: 600;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 999;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast svg {
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .main { padding: 16px 8px 32px; }
  .progress-header { padding: 20px 20px 18px; }
  .form-body { padding: 20px; }
  .form-nav { padding: 16px 20px; }
  .radio-group { grid-template-columns: 1fr 1fr; }
  .radio-group.cols-3 { grid-template-columns: 1fr 1fr; }
  .export-buttons { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .progress-dot-label { display: none; }
}

@media (min-width: 768px) {
  .main { padding: 40px 24px 64px; }
  .form-card { max-width: 720px; }
}
