/* ==========================================================================
   Meetinstrument Planagenda · Huisstijl 't Leerlab
   Roze #EE4D9B · Geel #FFD809 · Helvetica + Caveat (handgeschreven accent)
   ========================================================================== */

@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/quickscan/fonts/caveat-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/quickscan/fonts/caveat-700.woff2') format('woff2');
}

:root {
  /* Merkkleuren (uit de guidelines) */
  --pink: #ee4d9b;
  --pink-deep: #d63384;
  --pink-tint: #fde4f1;
  --yellow: #ffd809;
  --yellow-deep: #eac400;
  --yellow-tint: #fff5c2;
  --orange: #f7902d;
  --purple: #af91f1;
  --blue: #97ccef;
  --green: #74c15d;

  --bg: #fff7fb;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #5a5560;
  --ink-faint: #918c98;
  --line: #efe6ec;
  --line-strong: #1a1a1a;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 10px 30px rgba(214, 51, 132, 0.07);
  --shadow-lift: 0 3px 8px rgba(26, 26, 26, 0.08), 0 20px 48px rgba(214, 51, 132, 0.16);
  --font: "Helvetica Neue", Helvetica, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Segoe Script", "Comic Sans MS", cursive;
  --maxw: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(238, 77, 155, 0.07) 1px, transparent 0);
  background-size: 24px 24px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 96px; }

/* --- Koptekst / merk ---------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand .logo { width: 48px; height: 48px; flex: none; }
.brand .logo svg, .brand .logo img { width: 48px; height: 48px; display: block; }
button.logo { border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; transition: transform 0.12s ease; }
button.logo:hover { transform: scale(1.06); }
button.logo:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.brand .name { font-weight: 800; letter-spacing: -0.01em; font-size: 16px; }
.brand .name span { display: block; font-weight: 500; color: var(--pink); font-size: 12px; letter-spacing: 0.02em; }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 800; color: var(--ink); }
.crumbs .sep { color: var(--ink-faint); font-weight: 600; }
.crumbs .crumb-current { color: var(--pink-deep); }
.crumb-link {
  border: none; background: none; padding: 0; margin: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 2px;
}
.crumb-link:hover { color: var(--pink); }

/* --- Kaarten ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  margin-bottom: 18px;
}
.question-card { min-height: 380px; display: flex; flex-direction: column; }
#screen { flex: 1; }

.hero { border-color: var(--ink); box-shadow: 0 6px 0 var(--pink); }
#step-start .hero { box-shadow: 0 6px 0 var(--module-accent, var(--pink)); }
#step-start .eyebrow { background: var(--module-accent, var(--pink)); color: var(--ink); }
.hero h1 {
  font-size: clamp(30px, 7vw, 44px); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0 0 10px; font-weight: 800; text-transform: uppercase;
}
.hero .lead { color: var(--ink-soft); font-size: 16.5px; margin: 0; }
.hero .hand {
  font-family: var(--font-hand); font-weight: 700; color: var(--pink);
  font-size: 26px; display: block; margin-top: 12px; transform: rotate(-2deg);
}

.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: #fff; background: var(--pink);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}

/* --- Rolkeuze ----------------------------------------------------------- */
.choice-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .choice-grid { grid-template-columns: 1fr; } }

.role-card {
  text-align: left; border: 2.5px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 22px; cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  font-family: inherit; color: inherit; display: flex; flex-direction: column; gap: 10px;
}
.role-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow-lift); }
.role-card:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.role-card.selected { border-color: var(--ink); background: var(--pink-tint); box-shadow: 0 4px 0 var(--pink); }
.role-card .ricon {
  width: 50px; height: 50px; border: 2.5px solid var(--ink); border-radius: 14px;
  display: grid; place-items: center; background: var(--yellow);
}

/* Gekleurde module-/onderdeelkaarten (elk hun eigen accentkleur) */
.role-card.card-colored { border-top: 5px solid var(--card-accent, var(--yellow)); }
.role-card.card-colored .ricon { background: var(--card-accent, var(--yellow)); }
.role-card.card-colored:hover { border-color: var(--card-accent, var(--ink)); box-shadow: 0 3px 8px rgba(26,26,26,0.08), 0 18px 40px rgba(26,26,26,0.12); }
.role-card .ricon svg { width: 28px; height: 28px; }
.role-card h3 { margin: 4px 0 0; font-size: 19px; font-weight: 800; }
.role-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* --- Segmented control (meetmoment) ------------------------------------ */
.segment { display: flex; gap: 8px; flex-wrap: wrap; }
.segment button {
  flex: 1 1 auto; min-width: 92px; border: 2.5px solid var(--line);
  background: var(--surface); border-radius: var(--radius-sm); padding: 13px 10px;
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
  cursor: pointer; transition: all 0.12s ease;
}
.segment button:hover:not(:disabled) { border-color: var(--ink); }
.segment button.selected { background: var(--pink); color: #fff; border-color: var(--ink); box-shadow: 0 3px 0 var(--pink-deep); }
.segment button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Formuliervelden ---------------------------------------------------- */
label.field { display: block; margin-bottom: 16px; }
label.field .lab { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
label.field .hint { display: block; margin-top: 3px; font-weight: 400; color: var(--ink-faint); font-size: 12.5px; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; border: 2.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-tint);
}
textarea { min-height: 120px; resize: vertical; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

/* In twee kolommen de invoervakken onderaan uitlijnen, ook als het ene label
   over meer regels loopt dan het andere. */
.cb-grid .field, .row-2 .field { display: flex; flex-direction: column; margin-bottom: 0; }
.cb-grid .field .lab, .row-2 .field .lab { flex: 1; }

/* --- Code-builder ------------------------------------------------------- */
.codebuilder { background: var(--pink-tint); border: 2.5px dashed var(--pink); border-radius: var(--radius); padding: 20px; }
.codebuilder .cb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .codebuilder .cb-grid { grid-template-columns: 1fr; } }
.codebuilder input { background: #fff; }
.code-preview { margin-top: 18px; display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; }
.code-preview .lbl-hand { font-family: var(--font-hand); font-weight: 700; font-size: 22px; color: var(--pink-deep); }
.code-preview .boxes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.code-preview .cbox {
  width: 42px; height: 54px; border: 2.5px solid var(--ink); border-radius: 10px;
  display: grid; place-items: center; font-size: 25px; font-weight: 800; background: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}
.code-preview .cbox.filled { background: var(--yellow); transform: translateY(-2px); }

/* --- Vragen ------------------------------------------------------------- */
.section-head { margin: 30px 0 6px; }
.section-head h2 { font-size: 21px; margin: 0; letter-spacing: -0.01em; font-weight: 800; }
.section-head .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; }

.qitem { padding: 4px 0; }
.qtext { font-weight: 700; margin: 0 0 14px; display: flex; gap: 12px; align-items: flex-start; }
.qnum {
  flex: none; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px;
  background: var(--module-accent, var(--pink)); color: #fff; font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
}

/* Likert-schaal */
.scale { display: flex; gap: 8px; }
.scale.n5 .opt, .scale.n4 .opt { flex: 1 1 0; }
.opt {
  position: relative; border: 2.5px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); padding: 14px 6px 10px; text-align: center; cursor: pointer;
  transition: all 0.1s ease; min-height: 68px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.opt:hover { border-color: var(--ink); background: var(--yellow-tint); transform: translateY(-2px); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .num { font-size: 20px; font-weight: 800; line-height: 1; }
.opt .lbl { font-size: 10.5px; color: var(--ink-faint); line-height: 1.15; }
.opt.checked { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--yellow-deep); transform: translateY(-2px); }
.opt.checked .lbl { color: var(--ink); }
.opt.checked::after {
  content: '✓'; position: absolute; top: 4px; right: 6px;
  font-size: 12px; font-weight: 800; color: var(--ink);
}
.opt:focus-within { outline: 3px solid var(--pink-tint); outline-offset: 1px; }

/* Keuze & multichoice */
.choicelist { display: grid; gap: 10px; }
.choice-opt {
  display: flex; align-items: center; gap: 12px; border: 2.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer;
  transition: all 0.1s ease; font-size: 15.5px; font-weight: 500;
}
.choice-opt:hover { border-color: var(--ink); background: var(--pink-tint); }
.choice-opt.checked { background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--yellow-deep); font-weight: 700; }
.choice-opt.checked::after { content: '✓'; margin-left: auto; font-weight: 800; }
.choice-opt input { accent-color: var(--pink); width: 20px; height: 20px; }

/* 0-10 schaal */
.scale10 { display: flex; gap: 5px; flex-wrap: wrap; }
.scale10 .opt { min-width: 42px; min-height: 48px; flex: 1 1 42px; padding: 8px 2px; }
.scale10 .opt .num { font-size: 16px; }

/* --- Voortgang ---------------------------------------------------------- */
.progress-wrap { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 0 12px; margin: -8px 0 10px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-track-wrap { position: relative; flex: 1; height: 34px; display: flex; align-items: center; }
.pb-logo {
  position: absolute; top: 50%; width: 34px; height: 34px;
  left: calc((100% - 34px) * var(--p, 0));
  transform: translateY(-50%);
  transition: left 0.45s cubic-bezier(.34,1.2,.4,1);
  pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(214,51,132,0.25));
}
.pb-logo img { width: 34px; height: 34px; display: block; }
.progress-track { flex: 1; height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(26,26,26,0.06); }
.progress-bar { height: 100%; width: 0%; background: var(--module-accent, var(--pink)); border-radius: 999px; transition: width 0.4s cubic-bezier(.34,1.2,.4,1); }
.progress-label { font-size: 13px; color: var(--ink-soft); margin-top: 8px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.progress-label .cheer { font-family: var(--font-hand); font-weight: 700; color: var(--pink); font-size: 18px; }

.close-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--line);
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; transition: all 0.12s ease;
}
.close-btn:hover { border-color: var(--ink); background: var(--pink-tint); transform: scale(1.05); }

/* Geruststelling boven de vraag */
.reassure {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  color: var(--ink); background: var(--yellow-tint); border: 1.5px solid var(--yellow-deep);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
}

/* --- Knoppen ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2.5px solid var(--ink); background: var(--pink); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 800; padding: 14px 26px;
  border-radius: 999px; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  text-decoration: none; box-shadow: 0 4px 0 var(--pink-deep);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--pink-deep); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--pink-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--pink-deep); }
.btn.accent { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 var(--yellow-deep); }
.btn.accent:hover { box-shadow: 0 6px 0 var(--yellow-deep); }
.btn.accent:active { box-shadow: 0 2px 0 var(--yellow-deep); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--ink); box-shadow: none; transform: translateY(-1px); }
.btn.block { width: 100%; }
.btn.lg { font-size: 17px; padding: 16px 30px; }

.actions { display: flex; gap: 12px; margin-top: 28px; align-items: center; }
.actions .spacer { flex: 1; }

/* --- Meldingen ---------------------------------------------------------- */
.alert { border-radius: var(--radius-sm); padding: 12px 15px; font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.alert.err { background: #fdecea; color: #c0392b; border: 2px solid #f3c5bf; }
.alert.info { background: var(--yellow-tint); color: var(--ink); border: 2px solid var(--yellow-deep); }

/* --- Klaar-scherm ------------------------------------------------------- */
.done { text-align: center; padding: 40px 24px; }
.done .smiley { width: 90px; height: 90px; margin: 0 auto 18px; animation: smiley-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.done .smiley .eye { fill: #1a1a1a; }
/* Rechteroog knipoogt af en toe. transform-box zorgt dat het om zijn eigen midden squasht. */
.done .smiley .eye-right { transform-box: fill-box; transform-origin: center; animation: wink 3.4s ease-in-out 0.6s infinite; }
@keyframes wink {
  0%, 84%, 100% { transform: scaleY(1); }
  90%, 94% { transform: scaleY(0.3); }
}
@keyframes smiley-pop {
  0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .done .smiley, .done .smiley .eye-right { animation: none; }
}
.done h1 { font-family: var(--font-hand); font-weight: 700; font-size: 46px; margin: 0 0 6px; color: var(--pink); transform: rotate(-2deg); }
.done p { color: var(--ink-soft); margin: 0 auto 8px; max-width: 42ch; font-size: 16px; }
.done .code-reminder { font-weight: 800; color: var(--ink); background: var(--yellow-tint); display: inline-block; padding: 8px 16px; border-radius: 999px; margin-top: 8px; }
.done-tip { display: flex; gap: 14px; align-items: flex-start; text-align: left; max-width: 44ch; margin: 22px auto 0; padding: 16px 18px; background: var(--yellow-tint); border: 2px solid var(--yellow); border-radius: var(--radius-sm); }
.done-tip-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.done-tip > div > strong { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 3px; }
.done-tip p strong { color: var(--ink); }
.done-tip p { color: var(--ink-soft); font-size: 14.5px; margin: 0; max-width: none; }

/* --- Footer ------------------------------------------------------------- */
.foot { text-align: center; color: var(--ink-faint); font-size: 12.5px; margin-top: 30px; }
.foot a { color: var(--pink); font-weight: 600; }

/* --- Preview (beheerder) ------------------------------------------------ */
.preview-banner {
  background: #efe9ff; border: 2px solid var(--purple); color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px 15px; font-size: 13.5px; margin-bottom: 16px;
}
.tag-preview {
  display: inline-block; font-size: 10px; font-weight: 800; background: var(--purple);
  color: #fff; padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle;
}

/* --- Helpers ------------------------------------------------------------ */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* --- Admin -------------------------------------------------------------- */
.admin-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-bar .spacer { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 18px; background: var(--surface); }
.stat .n { font-size: 30px; font-weight: 800; color: var(--pink); }
.stat .k { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters .field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.filters select { padding: 9px 12px; font-size: 14px; }

.table-scroll { overflow-x: auto; border: 2px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--pink-tint); font-weight: 800; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td.code { font-weight: 800; font-family: ui-monospace, monospace; }
.link-btn { border: none; background: none; cursor: pointer; font-size: 13px; padding: 4px; font-weight: 600; color: var(--ink, #111); }
.link-btn:hover { text-decoration: underline; }
.del-btn { color: #c0392b; }
.edit-btn, .save-btn { color: #d81f8c; }
.cell-input { font: inherit; padding: 4px 6px; border: 1.5px solid #d81f8c; border-radius: 6px; }
tr.editing td { background: #fff6fb; }
