/* Lab — gedeeld ontwerpsysteem
   Inter • aurora-mesh • frosted glass • pastel accenten • licht/donker */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Leckerli+One&display=swap');

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- LICHT (standaard) ----------
   Pastel-perzik accent. Wil je een andere tint? Pas de --accent-regels aan. */
:root, [data-theme="light"] {
  /* zachte pastel aurora */
  --au-lavender: #dcd6ff;
  --au-sky:      #cce6ff;
  --au-mint:     #d2f4ea;
  --au-peach:    #ffe2cf;
  --au-rose:     #ffd9e6;

  --bg: #f5f6fb;
  --bg-deep: #eceef7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: #f1f3f9;
  --text: #1b2030;
  --text-soft: #515869;
  --muted: #8b91a3;
  --border: rgba(24, 28, 48, 0.08);
  --border-strong: rgba(24, 28, 48, 0.14);

  --accent: #b3a1f0;          /* pastel lila */
  --accent-soft: #c5b8f5;     /* hover (lichter) */
  --accent-strong: #7c5cd6;   /* tekst/iconen in accentkleur op licht */
  --accent-ink: #2a1b50;      /* donkere tekst op de pastelknop */
  --accent-glow: rgba(160, 132, 240, 0.40);

  --shadow: 0 20px 54px -26px rgba(40, 44, 80, 0.30);
  --shadow-soft: 0 10px 30px -18px rgba(40, 44, 80, 0.22);
  --aurora-opacity: 0.55;
  --aurora-blur: 80px;
}

/* ---------- DONKER NAVY (via toggle) ---------- */
[data-theme="dark"] {
  --au-lavender: #3b3f9e;
  --au-sky:      #1e63d6;
  --au-mint:     #1b6fa8;
  --au-peach:    #f3a06a;
  --au-rose:     #2a2f86;

  --bg: #0a1124;
  --bg-deep: #060b1a;
  --surface: rgba(20, 30, 56, 0.55);
  --surface-solid: #121a31;
  --surface-2: rgba(30, 43, 74, 0.42);
  --text: #eef1fb;
  --text-soft: #c2c9de;
  --muted: #8a93ad;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --accent: #bcabf6;          /* zachtere lila op navy */
  --accent-soft: #cdc0f9;
  --accent-strong: #bcabf6;
  --accent-ink: #1d1340;
  --accent-glow: rgba(188, 171, 246, 0.42);

  --shadow: 0 26px 64px -26px rgba(0, 0, 0, 0.8);
  --shadow-soft: 0 12px 40px -20px rgba(0, 0, 0, 0.65);
  --aurora-opacity: 0.5;
  --aurora-blur: 95px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- Aurora-mesh (de signatuur) ---------- */
.aurora {
  position: fixed; inset: -20vmax; z-index: -1;
  overflow: hidden; pointer-events: none;
  background: var(--bg-deep);
}
.aurora span {
  position: absolute; border-radius: 50%;
  filter: blur(var(--aurora-blur));
  opacity: var(--aurora-opacity);
  mix-blend-mode: normal;
}
.aurora .a1 { width: 46vmax; height: 46vmax; left: -8vmax; top: -6vmax;
  background: radial-gradient(circle at 30% 30%, var(--au-lavender), transparent 70%);
  animation: drift1 26s var(--ease) infinite alternate; }
.aurora .a2 { width: 42vmax; height: 42vmax; right: -6vmax; top: 4vmax;
  background: radial-gradient(circle at 60% 40%, var(--au-sky), transparent 70%);
  animation: drift2 32s var(--ease) infinite alternate; }
.aurora .a3 { width: 50vmax; height: 50vmax; left: 14vmax; bottom: -16vmax;
  background: radial-gradient(circle at 50% 50%, var(--au-mint), transparent 70%);
  animation: drift3 30s var(--ease) infinite alternate; }
.aurora .a4 { width: 38vmax; height: 38vmax; right: 6vmax; bottom: -10vmax;
  background: radial-gradient(circle at 40% 60%, var(--au-rose), transparent 70%);
  animation: drift4 36s var(--ease) infinite alternate; }
.aurora .a5 { width: 30vmax; height: 30vmax; left: 40%; top: 30%;
  background: radial-gradient(circle at 50% 50%, var(--au-peach), transparent 70%);
  animation: drift2 28s var(--ease) infinite alternate; }

@keyframes drift1 { to { transform: translate(10vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-9vmax, 10vmax) scale(1.1); } }
@keyframes drift3 { to { transform: translate(8vmax, -10vmax) scale(1.18); } }
@keyframes drift4 { to { transform: translate(-7vmax, -8vmax) scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none !important; }
}

/* ---------- Glass ---------- */
.glass {
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Typografie ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { line-height: 1.6; color: var(--text-soft); }
.eyebrow { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
a { color: var(--accent-strong); text-decoration: none; }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center;
  font-family: 'Leckerli One', 'Inter', cursive;
  font-weight: 400; letter-spacing: 0;
  font-size: 25px; line-height: 1;
}
.wordmark .v { display: none; }
.wordmark .v svg { width: 33px; height: auto; display: block; }

/* SVG-iconen */
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
.btn .ic { vertical-align: -0.16em; margin-right: 6px; }
.btn .ic:only-child { margin-right: 0; }

/* ---------- Knoppen ---------- */
.btn {
  font-family: var(--font); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 20px; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
  display: inline-flex; align-items: center; gap: 8px; line-height: 1;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 8px 26px -8px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-soft); box-shadow: 0 14px 34px -8px var(--accent-glow); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.99); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-danger { background: transparent; color: #ff6b81; border-color: rgba(255, 107, 129, .38); }
.btn-danger:hover { background: rgba(255, 107, 129, .12); }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Inputs ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-soft); margin-bottom: 7px; }
input, textarea, select {
  width: 100%; font-family: var(--font); font-size: 14.5px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { resize: vertical; min-height: 80px; }

/* ---------- Chat (galerij ↔ klant) ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; width: fit-content; padding: 11px 15px; border-radius: 18px; font-size: 15px; line-height: 1.5; }
.bubble-in { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble-out { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; align-self: flex-end; }
.bubble-author { font-size: 12px; font-weight: 700; opacity: .65; margin-bottom: 3px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-when { font-size: 10.5px; opacity: .5; margin-top: 4px; text-align: right; }
.chat-bar { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.chat-bar textarea { flex: 1; min-height: 46px; max-height: 130px; height: 46px; resize: none; }
.chat-send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: filter .15s, transform .08s; }
.chat-send:hover { filter: brightness(1.04); }
.chat-send:active { transform: scale(.93); }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-empty { font-size: 14px; color: var(--muted); }

/* Eigen, ronde checkbox (vervangt de native bolletjes). */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; min-width: 22px; flex: none; padding: 0;
  border-radius: 50%; border: 2px solid var(--border-strong);
  background: var(--surface-2); cursor: pointer;
  display: inline-grid; place-items: center;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
input[type="checkbox"]::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2.4px solid var(--accent-ink); border-bottom: 2.4px solid var(--accent-ink);
  transform: translateY(-1px) rotate(-45deg); opacity: 0; transition: opacity .12s;
}
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { opacity: 1; }
input[type="checkbox"]:hover { border-color: var(--accent-soft); }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field { margin-bottom: 16px; }
/* iOS Safari zoomt in bij focus op invoervelden kleiner dan 16px. */
@media (max-width: 860px) {
  input, textarea, select { font-size: 16px; }
  /* iOS geeft date-velden een eigen (te grote) intrinsieke maat; gelijktrekken met de rest. */
  input[type="date"] {
    -webkit-appearance: none; appearance: none;
    min-width: 0; max-width: 100%;
    height: 48px; line-height: 1.2;
  }
  input[type="date"]::-webkit-date-and-time-value { text-align: left; }
  input[type="date"]::-webkit-calendar-picker-indicator { margin: 0 0 0 auto; opacity: .55; }
}

/* ---------- Code-ticket (signatuur) ---------- */
.code-chip {
  font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: 2px;
  color: var(--accent-strong); background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 14px; display: inline-flex; align-items: center; gap: 10px;
}

/* ---------- Theme-toggle ---------- */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--text);
}
.theme-toggle:hover { border-color: var(--border-strong); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-solid); color: var(--text); padding: 13px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 14px; animation: rise .3s var(--ease); max-width: 90vw;
}
.toast.err { border-color: rgba(224, 85, 107, .4); }
.toast.ok { border-color: rgba(80, 200, 160, .4); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Spinner ---------- */
.spin { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Utilities ---------- */
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
