/* Reusable components. Markup is produced by js/ui/components.js.
 * Only semantic tokens – everything works in the light and the dark theme,
 * also inside a [data-theme] "island" (used on the style guide). */

[data-theme] { color: var(--text); }

/* Brand mark: the variant follows the (nearest) theme */
.logo-v-light { display: var(--logo-show-light); }
.logo-v-dark { display: var(--logo-show-dark); }

/* ---------- Buttons (pill, min 52px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 12px 28px;
  border: 1.5px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); padding-left: 14px; padding-right: 14px; }
.btn-ghost:hover { background: var(--surface-soft); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-small { min-height: var(--tap-min); padding: 8px 20px; font-size: var(--fs-small); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Cards: white surface, soft shadow, 20px radius, no thin borders ---------- */
.card { position: relative; background: var(--surface); color: var(--text); border-radius: var(--radius-card); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-soft { background: var(--surface-soft); box-shadow: none; }

/* CTA card for the two main routes – identical size and colour, only the icon differs */
.cta-card {
  display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cta-card:hover { color: var(--text); box-shadow: var(--shadow-hover); }
@media (prefers-reduced-motion: no-preference) { .cta-card:hover { transform: translateY(-2px); } }
.cta-card .cta-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.cta-card .cta-icon svg { width: 30px; height: 30px; }
.cta-card h3 { font-size: 1.2rem; margin: 0; }
.cta-card p { color: var(--muted); margin: 0; }
.cta-card .cta-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 700; color: var(--accent); }
.cta-card .cta-go svg { width: 20px; height: 20px; transition: transform var(--dur) var(--ease); }
.cta-card:hover .cta-go svg { transform: translateX(4px); }
.cta-pair { display: grid; gap: 16px; }
@media (min-width: 768px) { .cta-pair { grid-template-columns: 1fr 1fr; gap: 20px; } }
.cta-meta { margin: 16px 0 0; color: var(--muted); font-size: var(--fs-small); }

/* Third, deliberately smaller entry: "Meld iemand anders aan" */
.third-entry {
  display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 14px 18px;
  border-radius: var(--radius-control); background: var(--surface); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);   /* a clear block on the cream background (was --surface-soft, almost invisible) */
}
.third-entry:hover { color: var(--text); background: var(--accent-soft); }
.third-entry > svg { width: 28px; height: 28px; flex-shrink: 0; color: var(--accent); }
.third-entry strong { color: var(--accent); white-space: nowrap; }
.third-entry strong svg { display: inline; width: 18px; height: 18px; vertical-align: -3px; margin-left: 4px; }

/* ---------- Badges (status, mainly back office) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--radius-pill);
  font-size: var(--fs-small); font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: var(--surface-soft); color: var(--text);
}
.badge svg { width: 16px; height: 16px; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-demo { background: var(--warn-bg); color: var(--warn); border: 1.5px dashed var(--warn); }

/* ---------- [INVULLEN] placeholder ---------- */
.placeholder {
  display: inline; padding: 1px 6px; border-radius: 6px; white-space: normal;
  background: repeating-linear-gradient(-45deg, var(--ph-bg-1), var(--ph-bg-1) 6px, var(--ph-bg-2) 6px, var(--ph-bg-2) 12px);
  color: var(--ph-text); border: 1px dashed var(--ph-border); font-weight: 700; font-size: .92em;
}

/* ---------- Notices ---------- */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--text); }
.notice > svg { width: 24px; height: 24px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { background: var(--ok-bg); } .notice-ok > svg { color: var(--ok); }
.notice-warn { background: var(--warn-bg); } .notice-warn > svg { color: var(--warn); }
.notice-danger { background: var(--danger-bg); } .notice-danger > svg { color: var(--danger); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 26px; }
.field-label, .field legend { display: block; font-weight: 700; font-size: 1rem; margin-bottom: 8px; color: var(--text); padding: 0; }
.optional { font-weight: 400; color: var(--muted); }
.field-hint { color: var(--muted); font-size: var(--fs-small); margin: -2px 0 10px; }
.input, .select, .textarea {
  width: 100%; min-height: 56px; padding: 12px 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--field-border); border-radius: var(--radius-control);
  font-size: 1rem; transition: border-color var(--dur) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
.textarea { min-height: 130px; resize: vertical; }
.input-short { max-width: 14em; }
.field-error { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; color: var(--danger); font-weight: 700; font-size: var(--fs-small); }
.field-error svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
fieldset.field { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }

.check-row { display: flex; gap: 14px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.check-row input { width: 26px; height: 26px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }

/* ---------- Choice tiles (large radio/checkbox with icon) ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: 1fr; }
.tiles-4 { grid-template-columns: repeat(2, 1fr); }   /* short labels: two per row, also on phones */
@media (min-width: 480px) { .tiles-2, .tiles-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tiles-3 { grid-template-columns: repeat(3, 1fr); } .tiles-4 { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile-body {
  display: flex; gap: 14px; align-items: center; min-height: 68px; height: 100%; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 16px;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.tile-body > svg { width: 28px; height: 28px; flex-shrink: 0; color: var(--accent); }
.tile-text { flex: 1; min-width: 0; }
.tile-title { display: block; font-weight: 700; }
.tile-desc { display: block; color: var(--muted); font-size: var(--fs-small); }
.tile-mark { width: 24px; height: 24px; flex-shrink: 0; border: 1.5px solid var(--field-border); border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.tile input[type="checkbox"] + .tile-body .tile-mark { border-radius: 7px; }
.tile-mark svg { width: 17px; height: 17px; color: var(--on-accent); opacity: 0; }
.tile:hover .tile-body { border-color: var(--text); }
.tile input:checked + .tile-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tile input:checked + .tile-body .tile-mark { background: var(--accent); border-color: var(--accent); }
.tile input:checked + .tile-body .tile-mark svg { opacity: 1; }
.tile input:focus-visible + .tile-body { outline: 3px solid var(--focus); outline-offset: 3px; }
.tile input:disabled + .tile-body { opacity: .55; cursor: not-allowed; border-style: dashed; }
.tile:has(input:disabled) { cursor: not-allowed; }
.max-note { margin: 10px 0 0; color: var(--muted); font-size: var(--fs-small); min-height: 1.6em; }
.max-note.is-full { color: var(--text); font-weight: 700; }

/* ---------- Chips (compact multi-select, e.g. interests) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-min); padding: 8px 18px;
  border: 1px solid var(--field-border); border-radius: var(--radius-pill); background: var(--surface);
}
.chip span svg { width: 18px; height: 18px; display: none; }
.chip:hover span { border-color: var(--text); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip input:checked + span svg { display: block; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.chip input:disabled + span { opacity: .45; border-style: dashed; cursor: not-allowed; }

/* ---------- Photo field ---------- */
.photo-field { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.photo-preview {
  width: 120px; height: 120px; flex-shrink: 0; overflow: hidden; border-radius: 50%;
  background: var(--surface-soft); display: grid; place-items: center; color: var(--muted);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview svg { width: 36px; height: 36px; }
.photo-actions { display: grid; gap: 10px; }
.photo-actions input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- Stepper ("Stap 2 van 4") ---------- */
.stepper { margin-bottom: 28px; }
.stepper-text { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-small); color: var(--muted); margin-bottom: 10px; }
.stepper-text strong { color: var(--text); }
.stepper-bar { display: flex; gap: 6px; }
.stepper-bar span { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.stepper-bar span.done, .stepper-bar span.current { background: var(--accent); }

/* ---------- Status bar (5 consumer steps) ---------- */
.statusbar { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.statusbar li { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 0 0 20px; color: var(--muted); }
.statusbar li:last-child { padding-bottom: 0; }
.statusbar li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.statusbar li:last-child::before { display: none; }
.statusbar .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--field-border); background: var(--surface); }
.statusbar .dot svg { width: 18px; height: 18px; }
.statusbar .label { padding-top: 3px; }
.statusbar li.done { color: var(--text); }
.statusbar li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.statusbar li.done::before { background: var(--accent); }
.statusbar li.current { color: var(--text); font-weight: 700; }
.statusbar li.current .dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.statusbar li.current .dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
@media (min-width: 768px) {
  .statusbar-h { grid-template-columns: repeat(5, 1fr); }
  .statusbar-h li { flex-direction: column; align-items: center; text-align: center; padding: 0 6px; }
  .statusbar-h li::before { left: calc(50% + 18px); right: calc(-50% + 18px); top: 15px; bottom: auto; width: auto; height: 2px; }
}

/* ---------- Accordion (native <details>) ---------- */
.accordion { display: grid; gap: 10px; }
.accordion details { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 14px 20px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 1rem; border-radius: 16px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); transition: transform var(--dur) var(--ease); }
.accordion details[open] summary svg { transform: rotate(180deg); }
.accordion .accordion-body { padding: 0 20px 20px; max-width: 46em; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { font-weight: 700; color: var(--muted); white-space: nowrap; }
.table th button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 0; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 36px; }
.table th button svg { width: 16px; height: 16px; }
.table th[aria-sort] button { color: var(--text); }
.table tbody tr.row-link { cursor: pointer; }
.table tbody tr.row-link:hover { background: var(--surface-soft); }
.table td a { font-weight: 700; }

/* ---------- Dialog ---------- */
dialog.dialog { width: min(580px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog.dialog::backdrop { background: rgba(19, 26, 22, .5); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 0; }
.dialog-head h2 { font-size: 1.35rem; margin: 0; }
.dialog-body { padding: 16px 24px; }
.dialog-foot { padding: 0 24px 24px; }

/* ---------- Segmented switches (text size, theme) ---------- */
.seg-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg-label { font-weight: 700; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-soft); }
.seg button {
  min-width: 48px; min-height: 44px; padding: 0 14px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius-pill); color: var(--text); font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button svg { width: 18px; height: 18px; }
.seg button:hover { background: var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ---------- Avatar ---------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; object-fit: cover; }
.avatar-sm { width: 40px; height: 40px; font-size: .95rem; }
/* Large round profile photo (the name "arch" is historical: photos are round) */
.avatar-arch { width: 96px; height: 96px; border-radius: 50%; font-size: 1.8rem; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 20px; }
.empty > svg { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--muted); }
.empty h3 { margin-bottom: 6px; }
