:root {
  --ink: #211d19;
  --ink-soft: #4d463d;
  --paper: #e9ddc9;
  --panel: #faf7f1;
  --line: #e2d9c9;
  --accent: #8a6b4e;
  --accent-dark: #6c5138;
  --accent-soft: #ece1d0;
  --muted: #8b8171;
  --danger: #a8453d;
  --radius: 12px;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

.topbar {
  padding: 26px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.topbar-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; max-width: 1200px; margin: 0 auto; }
.brand { display: flex; flex-direction: column; gap: 4px; }
.brand h1 { margin: 0; line-height: 0; }
.brand-lockup { height: 34px; width: auto; display: block; }
.subtitle { margin: 2px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.account-box { display: flex; align-items: center; gap: 12px; padding-top: 6px; flex-shrink: 0; }
.account-name { font-size: 13px; color: var(--ink-soft); }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-dark); }

@media (max-width: 640px) {
  .topbar { padding: 18px 16px; }
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .account-box {
    flex-shrink: 1;
    flex-wrap: wrap;
    row-gap: 6px;
    padding-top: 0;
    width: 100%;
  }
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px 56px;
  max-width: 1000px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 4px rgba(34, 29, 24, 0.06), 0 12px 32px rgba(34, 29, 24, 0.08);
}

.step { margin-bottom: 24px; }
.step h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 500;
}
.optional-tag { text-transform: none; font-weight: 400; letter-spacing: 0; font-size: 12px; color: #9a927e; font-family: var(--font-sans); }

/* Viewfinder motif — signature element echoing the app's name (Herkader = reframe) */
.viewfinder { position: relative; }
.viewfinder::before,
.viewfinder::after,
.viewfinder .vf-tr,
.viewfinder .vf-bl {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
}
.viewfinder::before { top: 8px; left: 8px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-radius: 3px 0 0 0; }
.viewfinder::after { bottom: 8px; right: 8px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); border-radius: 0 0 3px 0; }

.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition: border-color .15s, background .15s;
  min-height: 96px;
}
.upload-box:hover, .upload-box.dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.upload-box.has-image { padding: 10px; border-style: solid; }
.upload-box.has-image img { max-width: 100%; max-height: 170px; border-radius: 6px; display: block; margin: 0 auto; }

.reference-hint { font-size: 11.5px; color: var(--muted); margin: -6px 0 12px; }
#referenceClearBtn { display: block; margin-top: 10px; }

.treatment-group {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
}
.treatment-group + .treatment-group { margin-top: 12px; }
.treatment-group-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 4px 11px;
  border-radius: 999px;
  margin: 0 0 12px;
}
.treatment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.treatment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.treatment-card input { position: absolute; opacity: 0; }
.card-icon { width: 19px; height: 19px; color: var(--accent); margin-bottom: 2px; }
.treatment-card .title { font-size: 13.5px; font-weight: 600; }
.treatment-card .desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.credit-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 999px;
  display: inline-block;
  width: fit-content;
  margin: 1px 0 2px;
}
.treatment-card:hover { border-color: #d3b98a; }
.treatment-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.treatment-card:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.field-row { display: flex; gap: 16px; margin-bottom: 18px; }
.field { flex: 1; }
.field label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.radio-row { display: flex; gap: 12px; font-size: 13.5px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); margin: 0; }
.radio-row input[type="radio"] { accent-color: var(--accent); }
.res-px { font-size: 11px; color: var(--muted); }

.select-field { margin-bottom: 12px; }
.select-field label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 5px; }
.select-field select, .text-input, .select-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13.5px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  transition: border-color .15s;
}
.select-field select:focus, .text-input:focus, .select-field textarea:focus, .fileInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select-field textarea { resize: vertical; }

.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.checkbox-row input { margin-top: 2px; accent-color: var(--accent); }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checkbox-row-inline { margin: 0; }

.primary-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff9ef;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.primary-btn:not(:disabled):hover { background: var(--accent-dark); }
.primary-btn:not(:disabled):active { transform: scale(0.99); }
.primary-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; }

.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}
.empty-state, .loading-state { text-align: center; color: var(--muted); font-size: 14px; }
.empty-state p { font-family: var(--font-display); font-size: 17px; color: var(--ink-soft); }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }

.preview-only { width: 100%; }
.preview-only img { width: 100%; border-radius: 8px; display: block; }

.result-state { width: 100%; }
.compare-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
}
.compare-wrap img { width: 100%; display: block; }
.compare-overlay {
  position: absolute;
  top: 0; left: 0; height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid var(--accent);
}
.compare-overlay img { width: var(--img-w, 100%); max-width: none; height: 100%; object-fit: cover; }
#compareSlider {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  width: 80%;
  accent-color: var(--accent);
  z-index: 3;
}
.compare-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 3px 0;
}

.result-actions { display: flex; gap: 10px; margin-top: 14px; }
.secondary-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.secondary-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.secondary-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* -----------------------------------------------------------------------
   Login- en registratiepagina
----------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
}

/* Linker (of bovenste, op mobiel) paneel: gebrande introductie */
.auth-hero {
  position: relative;
  flex: 1 1 42%;
  min-width: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.auth-hero-icon {
  position: absolute;
  top: -8%;
  right: -12%;
  width: 60%;
  max-width: 420px;
  opacity: 0.1;
  pointer-events: none;
}
.auth-hero-icon img { width: 100%; height: auto; display: block; }
.auth-hero-content { position: relative; max-width: 380px; }
.auth-back-link {
  display: inline-block;
  font-size: 12.5px;
  color: var(--paper);
  opacity: 0.65;
  text-decoration: none;
  margin-bottom: 18px;
}
.auth-back-link:hover { opacity: 0.9; text-decoration: underline; }
.auth-hero-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--panel);
}
.auth-hero-tag {
  font-size: 15px;
  line-height: 1.55;
  color: var(--paper);
  opacity: 0.8;
  margin: 0 0 32px;
}
.auth-hero-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-hero-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--paper); opacity: 0.85; }
.auth-hero-points svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent-soft); }

/* Rechter (of onderste) paneel: het formulier */
.auth-formside {
  flex: 1 1 58%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--paper);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 2px 4px rgba(34, 29, 24, 0.06), 0 12px 32px rgba(34, 29, 24, 0.08);
}
.auth-card-wide { max-width: 480px; }
.auth-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  text-align: center;
  margin: 0 0 24px;
  color: var(--ink);
}
.auth-card form .select-field:last-of-type { margin-bottom: 16px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 20px 0 0; }
.auth-switch a { color: var(--accent); font-weight: 500; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .auth-shell { flex-direction: column; }
  .auth-hero { flex: none; padding: 32px 24px; }
  .auth-hero-content { max-width: none; }
  .auth-hero-word { font-size: 24px; margin-bottom: 8px; }
  .auth-hero-tag { margin-bottom: 0; }
  .auth-hero-points { display: none; }
  .auth-hero-icon { width: 45%; }
  .auth-formside { padding: 28px 20px 40px; }
}
.account-type-toggle { margin: 4px 0 16px; }
.bedrijfs-velden {
  border-left: 2px solid var(--accent-soft);
  padding-left: 14px;
  margin: 0 0 16px;
}
.field-hint { font-size: 11.5px; color: var(--muted); margin: -10px 0 16px; }

/* -----------------------------------------------------------------------
   Account- en beheerpagina
----------------------------------------------------------------------- */
.page-single {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 32px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-wide {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 32px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; margin-bottom: 4px; }
.page-nav a { color: var(--ink-soft); text-decoration: none; }
.page-nav a:hover, .page-nav a.active { color: var(--accent-dark); font-weight: 600; }
.panel h2.panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 18px;
  color: var(--ink);
}
.success-msg { color: #4d6b3f; font-size: 13px; margin-top: 10px; }
.price-hint { font-size: 12.5px; color: var(--muted); margin: -12px 0 18px; }

.credits-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.credits-badge {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--accent-dark);
}
.credits-badge span { font-family: var(--font-sans); font-size: 13px; font-weight: 400; color: var(--muted); display: block; margin-top: 2px; }
.package-row { display: flex; gap: 10px; flex-wrap: wrap; }
.package-btn {
  border: 1.5px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.package-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.package-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.request-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.status-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.status-open { background: var(--accent-soft); color: var(--accent-dark); }
.status-toegekend { background: #e2ebdc; color: #4d6b3f; }
.status-afgewezen { background: #f2ded9; color: var(--danger); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.data-table th { color: var(--ink-soft); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.3px; }
.data-table td.num { font-family: var(--font-mono); }
.admin-tag { font-family: var(--font-mono); font-size: 10.5px; background: var(--ink); color: var(--panel); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.table-wrap { overflow-x: auto; }

/* -----------------------------------------------------------------------
   Publieke landingspagina (/)
----------------------------------------------------------------------- */
.home-nav { padding: 20px 32px; }
.home-nav-inner { display: flex; align-items: center; justify-content: center; max-width: 1100px; margin: 0 auto; }
.home-nav-brand img { height: 30px; width: auto; display: block; }

.home-hero { padding: 48px 32px 56px; text-align: center; }
.home-hero-inner { max-width: 680px; margin: 0 auto; }
.home-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--ink);
}
.home-hero-sub { font-size: 16px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.home-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-hero-ctas .primary-btn, .home-hero-ctas .secondary-btn { text-decoration: none; display: inline-flex; align-items: center; padding: 12px 26px; }
.home-final-ctas { margin-top: 28px; }
.home-hero-ctas .btn-subtle {
  width: auto;
  flex: none;
  padding: 10px 22px !important;
  font-size: 13px !important;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--accent-dark);
}
.home-hero-ctas .btn-subtle:hover {
  border-color: var(--accent);
  background: #e3d4b8;
}

.home-section { max-width: 1000px; margin: 0 auto; padding: 56px 32px; }
.home-section-alt { background: var(--panel); border-radius: 24px; max-width: 1064px; }
.home-section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  margin: 0 0 10px;
  text-align: center;
}
.home-section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 28px);
  text-align: center;
  margin: 0 0 36px;
  color: var(--ink);
}

.home-feature-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .home-feature-groups { grid-template-columns: 1fr; } }
.home-feature-group { padding: 18px 18px 16px; }
.home-feature-list { display: flex; flex-direction: column; gap: 16px; }
.home-feature { display: flex; align-items: flex-start; gap: 12px; }
.home-feature .card-icon { flex: none; width: 22px; height: 22px; color: var(--accent-dark); margin-top: 2px; }
.home-feature-title { font-size: 14px; font-weight: 600; margin: 0 0 2px; color: var(--ink); }
.home-feature-desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.4; }

.home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 760px) { .home-steps { grid-template-columns: 1fr 1fr; } }
.home-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.home-step-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-step-title { font-size: 14px; font-weight: 600; margin: 0 0 2px; color: var(--ink); }
.home-step-desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.4; }

.home-examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 860px) { .home-examples { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.home-example { margin: 0; }
.home-example-images { display: grid; grid-template-columns: 1fr; gap: 6px; border-radius: 10px; overflow: hidden; }
.home-example-img { position: relative; aspect-ratio: 3 / 2; background: var(--accent-soft); }
.home-example-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-example-img span {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(20, 17, 14, 0.6);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
}
.home-example figcaption { margin-top: 10px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); }

.home-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
@media (max-width: 640px) { .home-contact-grid { grid-template-columns: 1fr; gap: 20px; } }
.home-contact-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 0 0 6px;
}
.home-contact-value { font-size: 14px; color: var(--ink); margin: 0; line-height: 1.5; }
.home-contact-value a { color: var(--accent-dark); text-decoration: none; }
.home-contact-value a:hover { text-decoration: underline; }
.home-contact-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 32px 0 0; }

.home-contact-grid-single { grid-template-columns: 1fr; max-width: 280px; }

.home-final-cta { text-align: center; padding-bottom: 72px; }
.home-final-cta .home-hero-sub { max-width: 480px; margin-left: auto; margin-right: auto; }

.home-footer { text-align: center; font-size: 12.5px; color: var(--muted); padding: 32px 20px 48px; }
.home-footer a { color: var(--accent-dark); }

@media (max-width: 640px) {
  .home-nav { padding: 16px 20px; }
  .home-hero { padding: 36px 20px 48px; }
  .home-section { padding: 40px 20px; }
}
