/* Hallmark · component: app-ui · theme: custom "ochtendlicht" · states: default·hover·focus·active·disabled·loading·error·success */
@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-style: normal; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--text-lg); font-weight: 700; }
h3 { font-size: var(--text-md); font-weight: 700; }
p { max-width: 65ch; }
a { color: var(--accent-ink); }
button { font: inherit; color: inherit; }

.wrap { max-width: 640px; margin: 0 auto; padding: var(--space-md); }

/* ---- kop ---- */
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); padding: var(--space-lg) 0 var(--space-md); }
.topbar .datum { color: var(--ink-soft); font-size: var(--text-sm); font-weight: 600; }
.logo { display: flex; align-items: center; gap: var(--space-xs); font-weight: 800; letter-spacing: -0.01em; }
.logo svg { width: 26px; height: 26px; flex: none; }

/* ---- kaarten ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-md);
}
.card + .card { margin-top: 0; }
.card.tint-accent { background: var(--accent-soft); border-color: transparent; }
.card.tint-sage { background: var(--sage-soft); border-color: transparent; }
.card.tint-sky { background: var(--sky-soft); border-color: transparent; }
.card.tint-amber { background: var(--amber-soft); border-color: transparent; }
.card h2 { margin-bottom: var(--space-sm); }
.kicker { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: var(--space-2xs); }

/* ---- sliders ---- */
.veld { margin-bottom: var(--space-lg); }
.veld:last-child { margin-bottom: 0; }
.veld-kop { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-xs); }
.veld-kop label { font-weight: 600; }
.veld-waarde { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-ink); min-width: 2ch; text-align: right; }
.veld-hint { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-2xs); }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; background: transparent; touch-action: pan-y;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 10px; border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 0%), var(--paper-3) var(--pct, 0%));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; margin-top: -9px;
  border-radius: 50%; background: var(--card);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px oklch(30% 0.05 40 / 0.25);
  transition: transform var(--dur-fast) var(--ease-out);
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type=range]::-moz-range-track { height: 10px; border-radius: var(--radius-pill); background: var(--paper-3); }
input[type=range]::-moz-range-progress { height: 10px; border-radius: var(--radius-pill); background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 3px solid var(--accent); }
input[type=range]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--radius-input); }

/* ---- segmenten (1–5) & chips ---- */
.seg { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.seg button, .chips button {
  flex: 1 1 auto; min-height: 44px; padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--line); border-radius: var(--radius-input);
  background: var(--card); cursor: pointer; font-weight: 600; font-size: var(--text-sm);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.seg button:hover, .chips button:hover { background: var(--paper-2); }
.seg button:active, .chips button:active { transform: scale(0.97); }
.seg button:focus-visible, .chips button:focus-visible, .knop:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg button[aria-pressed=true], .chips button[aria-pressed=true] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink);
}
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.chips button { flex: 0 1 auto; }
.chips button.suppl-off { opacity: 0.55; text-decoration: line-through; }

/* ---- invoer ---- */
input[type=text], input[type=password], input[type=number], textarea {
  width: 100%; padding: var(--space-sm); border: 1px solid var(--line);
  border-radius: var(--radius-input); background: var(--card); color: var(--ink);
  font: inherit;
}
textarea { min-height: 72px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

/* ---- knoppen ---- */
.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 52px; padding: var(--space-sm) var(--space-lg); width: 100%;
  border: none; border-radius: var(--radius-card); cursor: pointer;
  background: var(--accent); color: oklch(98% 0.01 85); font-weight: 700; font-size: var(--text-md);
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.knop:hover { filter: brightness(1.06); }
.knop:active { transform: scale(0.98); }
.knop:disabled { opacity: 0.5; cursor: default; }
.knop[data-state=loading] { opacity: 0.7; pointer-events: none; }
.knop[data-state=success] { background: var(--sage); }
.knop[data-state=error] { background: var(--danger); }
.knop.stil { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.knop.klein { width: auto; min-height: 40px; padding: var(--space-xs) var(--space-md); font-size: var(--text-sm); border-radius: var(--radius-input); }

/* ---- advies ---- */
.advies-tekst { margin-bottom: var(--space-sm); }
.actie {
  display: flex; gap: var(--space-sm); align-items: flex-start;
  background: var(--card); border-radius: var(--radius-input);
  padding: var(--space-sm) var(--space-md); margin-top: var(--space-xs);
  border: 1px solid var(--line);
}
.actie .bol { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: var(--text-sm); display: grid; place-items: center; margin-top: 1px; }

/* ---- oura strip ---- */
.oura-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.oura-cel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-input); padding: var(--space-sm); text-align: center; }
.oura-cel .cijfer { font-size: var(--text-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.oura-cel .label { font-size: var(--text-xs); color: var(--ink-faint); font-weight: 600; }

/* ---- grafieken ---- */
.grafiek { width: 100%; overflow-x: auto; }
.grafiek svg { display: block; width: 100%; height: auto; }
.legenda { display: flex; flex-wrap: wrap; gap: var(--space-sm); font-size: var(--text-xs); color: var(--ink-soft); margin-top: var(--space-xs); }
.legenda .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* ---- logboek ---- */
.log-rij { display: flex; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.log-rij:last-child { border-bottom: none; }
.log-rij .datum { font-weight: 700; white-space: nowrap; }
.log-scores { color: var(--ink-soft); }
.badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 700; background: var(--paper-2); }
.badge.hoog { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- tabbar ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: var(--space-xs) var(--space-xs) calc(var(--space-xs) + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; max-width: 110px; min-height: 52px; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-faint); font-size: var(--text-xs); font-weight: 600; border-radius: var(--radius-input);
  transition: color var(--dur-fast) var(--ease-out);
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-current=page] { color: var(--accent-ink); }
.tabbar button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ---- login ---- */
.login-scherm { position: fixed; inset: 0; z-index: 20; background: var(--paper); display: grid; place-items: center; padding: var(--space-lg); }
.login-scherm .card { width: 100%; max-width: 380px; }
.fout { color: var(--danger); font-size: var(--text-sm); font-weight: 600; margin-top: var(--space-xs); }
.ok { color: var(--sage); font-size: var(--text-sm); font-weight: 600; margin-top: var(--space-xs); }

/* ---- schema ---- */
.tijdlijn { list-style: none; padding: 0; }
.tijdlijn li { display: flex; gap: var(--space-md); padding: var(--space-sm) 0; border-bottom: 1px solid var(--line); }
.tijdlijn li:last-child { border-bottom: none; }
.tijdlijn .tijd { flex: none; width: 64px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

.verborgen { display: none !important; }
.subtiel { color: var(--ink-soft); font-size: var(--text-sm); }
.ruimte-boven { margin-top: var(--space-md); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (min-width: 768px) {
  .wrap { padding: var(--space-lg); }
}
