:root {
  --gold: #b98c64;
  --gold-dark: #9a7352;
  --bg-0: #f5f2ed;
  --surface: #fff;
  --surface-muted: #faf8f5;
  --border: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: var(--gold-dark);
  --danger: #e11d48;
  --success: #059669;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
  line-height: 1.5;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.form-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.form-cover {
  padding: 2rem 2rem 1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.form-cover img {
  width: 100%;
  max-height: 140px;
}

.form-body {
  padding: 1.75rem 2rem 2rem;
}

.form-title {
  font-family:  Georgia, serif;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 36em;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Stepper */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stepper-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.stepper-num {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.stepper-item.active .stepper-num {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #fff;
}

.stepper-item.done .stepper-num {
  background: #fff;
  border-color: var(--gold);
  color: var(--gold);
}

.stepper-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.stepper-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stepper-connector {
  width: 2rem;
  height: 2px;
  background: var(--border);
  margin: 19px 0.35rem 0;
  flex-shrink: 0;
}

.stepper-connector.fill {
  background: var(--gold-dark);
  opacity: 1;
}

.step-panel {
  display: none;
}

.step-panel.is-active {
  display: block;
}

.section-header {
  margin: 1.75rem 0 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.section-header:first-child { margin-top: 0; }

.section-header h2 {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.section-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-field {
  margin-bottom: 1.35rem;
}

/* Stap 1: twee velden naast elkaar */
.form-row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
  margin-bottom: 1.35rem;
  align-items: start;
}

.form-row--2 .form-field {
  margin-bottom: 0;
}

.form-field.hidden {
  display: none !important;
}

label.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

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

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold-dark);
}

input.invalid,
textarea.invalid {
  border-color: var(--danger);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.sub-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin: 0;
  font: inherit;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.radio-item:hover {
  border-color: var(--gold-dark);
  background: var(--surface);
}

.radio-item:has(input:checked) {
  border-color: var(--gold-dark);
  background: var(--surface);
}

.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  accent-color: var(--gold-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.radio-item__text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.field-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.4rem;
  display: none;
}

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

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

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

.btn-primary:hover:not(:disabled) {
  background: #8a6248;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: rgba(15, 23, 42, 0.28);
}

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

.hidden {
  display: none !important;
}

/* PDF: loader + eindscherm + fout */
.pdf-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.pdf-loading-inner {
  text-align: center;
  padding: 2rem 2.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.pdf-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 3px solid rgba(154, 115, 82, 0.25);
  border-top-color: var(--gold-dark);
  border-radius: 50%;
  animation: pdf-spin 0.75s linear infinite;
}

@keyframes pdf-spin {
  to { transform: rotate(360deg); }
}

.pdf-loading-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.pdf-success-screen {
  padding: 0.5rem 0 0.5rem;
}

.pdf-success-card {
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, #ecfdf5 0%, var(--surface-muted) 100%);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--radius);
}

.pdf-success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-weight: 700;
}

.pdf-success-heading {
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.pdf-success-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}

.btn-download-large {
  display: inline-flex;
  width: 100%;
  max-width: 360px;
  padding: 1.1rem 1.75rem;
  font-size: 1.05rem;
  text-decoration: none;
  box-sizing: border-box;
}

.pdf-success-hint {
  margin-top: 1.25rem;
  margin-bottom: 0;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.5;
}

.pdf-success-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
}

.pdf-privacy-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--gold-dark);
  opacity: 0.9;
}

.pdf-privacy-icon svg {
  display: block;
}

.pdf-fetch-error {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  padding: 1rem;
}

.pdf-fetch-error-inner {
  max-width: 420px;
  width: 100%;
  padding: 1.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.pdf-error-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.pdf-error-list {
  text-align: left;
  margin: 0 0 1.25rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pdf-error-list li {
  margin-bottom: 0.35rem;
}

#pdf-error-close {
  width: 100%;
}

@media (max-width: 600px) {
  .stepper { flex-direction: column; align-items: stretch; }
  .stepper-connector {
    width: 2px;
    height: 1rem;
    margin: 0 auto;
  }
  .wizard-actions .btn { flex: 1; min-width: 120px; }
  .form-row--2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-row--2 .form-field {
    margin-bottom: 1.35rem;
  }
  .form-row--2 .form-field:last-child {
    margin-bottom: 0;
  }
}
