/*
  CD Now — Apple-stijl (iOS 26/27, Liquid Glass)
  Design tokens + basiscomponenten. Framework-onafhankelijk: gebruik de
  variabelen direct, of neem de klassen over in je eigen componenten.
  Maten komen 1-op-1 uit de artboards in ../design/*.dc.html.
*/

:root {
  /* ---- Kleur ---- */
  --cd-bg: #F2F2F7;                         /* grouped background */
  --cd-cell: #FFFFFF;                       /* lijstblokken, kaarten */
  --cd-label: #000000;
  --cd-label-2: #6C6C70;                    /* secundaire tekst, 5.2:1 op wit */
  --cd-separator: rgba(60, 60, 67, 0.29);   /* 0.5px scheidingslijnen */
  --cd-fill: rgba(118, 118, 128, 0.12);     /* grijze capsules, stepper */
  --cd-fill-selected: rgba(118, 118, 128, 0.14); /* actieve tab */
  --cd-chevron: #BDBDC2;
  --cd-glyph-gray: #8E8E93;                 /* verwijder-knopje, lege selectiecirkel */
  --cd-tint: #5856D6;                       /* accent (Apple indigo) */
  --cd-tint-hover: #3634A3;
  --cd-tint-fill: rgba(88, 86, 214, 0.12);
  --cd-destructive: #D70015;
  --cd-status-green: #34C759;
  --cd-saved-green: #248A3D;

  /* Oordeel: tekst (fg), cirkel (fill), band achter de kop (band) */
  --cd-kopen-fg: #1F7A35;   --cd-kopen-fill: #248A3D;   --cd-kopen-band: #E3F7E8;
  --cd-twijfel-fg: #A04800; --cd-twijfel-fill: #B25000; --cd-twijfel-band: #FFEED6;
  --cd-laten-fg: #C20012;   --cd-laten-fill: #D70015;   --cd-laten-band: #FFE7E6;

  /* ---- Typografie (SF Pro op Apple-apparaten, Inter als terugval) ---- */
  --cd-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", Inter, system-ui, sans-serif;

  /* ---- Vorm & ruimte ---- */
  --cd-radius-group: 26px;      /* lijstblokken, kaarten, zoeker */
  --cd-radius-tile: 14px;       /* tegels binnen een kaart (concentrisch) */
  --cd-radius-art: 12px;        /* hoes 84px; 10px bij 48px */
  --cd-radius-icon-tile: 8px;   /* 30px icoontegels in Instellingen */
  --cd-margin: 16px;            /* schermmarge */
  --cd-cell-x: 17px;            /* tekstinsprong in een cel */
  --cd-row-h: 52px;
  --cd-gap: 20px;               /* tussen blokken (Scannen) */
  --cd-gap-section: 28px;       /* tussen secties met kop */
  --cd-nav-row: 44px;
  --cd-tabbar-h: 62px;
  --cd-tabbar-inset: 21px;

  /* ---- Schaduw & glas ---- */
  --cd-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.07);
  --cd-glass-bg: rgba(255, 255, 255, 0.76);
  --cd-glass-blur: blur(24px) saturate(180%);
  --cd-glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06),
                     inset 0 0 0 0.5px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  --cd-prominent-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---- Basis ---- */
body {
  margin: 0;
  background: var(--cd-bg);
  color: var(--cd-label);
  font-family: var(--cd-font);
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input, select, button { font: inherit; letter-spacing: inherit; color: inherit; }
input::placeholder { color: var(--cd-label-2); opacity: 1; }
a { color: var(--cd-tint); }
.cd-num { font-variant-numeric: tabular-nums; }

/* ---- Tekststijlen (px / regelhoogte / gewicht) ---- */
.cd-large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.011em; margin: 0; padding: 3px 0 9px; }
.cd-title1      { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: 0.007em; }
.cd-title2      { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: 0.011em; }
.cd-title3      { font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: 0.011em; }
.cd-headline    { font-weight: 600; }
.cd-subhead     { font-size: 15px; line-height: 20px; letter-spacing: -0.016em; }
.cd-footnote    { font-size: 13px; line-height: 18px; letter-spacing: -0.006em; }
.cd-secondary   { color: var(--cd-label-2); }

/* ---- Schermopbouw ---- */
.cd-screen { min-height: 100dvh; padding-bottom: calc(var(--cd-tabbar-h) + var(--cd-tabbar-inset) + 24px); }
.cd-header { display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) var(--cd-margin) 0; }
.cd-nav-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; height: var(--cd-nav-row); }
.cd-main { display: flex; flex-direction: column; gap: var(--cd-gap); padding: 6px var(--cd-margin) 0; }

/* ---- Gegroepeerde lijst ---- */
.cd-section { display: flex; flex-direction: column; gap: 8px; }
.cd-section-header { margin: 0; padding: 0 var(--cd-cell-x); font-size: 17px; line-height: 22px; font-weight: 600; color: var(--cd-label-2); }
.cd-group { display: flex; flex-direction: column; background: var(--cd-cell); border-radius: var(--cd-radius-group); overflow: hidden; }
.cd-row { display: flex; align-items: center; gap: 12px; min-height: var(--cd-row-h); padding: 8px var(--cd-cell-x); box-sizing: border-box; }
.cd-row > .cd-row-label { flex: 1 1 auto; min-width: 0; }
.cd-sep { height: 0.5px; margin-left: var(--cd-cell-x); background: var(--cd-separator); }
button.cd-row { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.cd-chevron { width: 13px; height: 13px; color: var(--cd-chevron); flex: none; }

/* Waarde-capsule (bewerkbaar getal in een rij) */
.cd-value { display: flex; align-items: center; gap: 4px; flex: none; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--cd-fill); }
.cd-value input { width: 42px; height: 36px; padding: 0; border: 0; background: transparent; text-align: right; font-variant-numeric: tabular-nums; }

/* Keuzemenu in een rij */
.cd-picker { display: flex; align-items: center; gap: 4px; flex: none; color: var(--cd-label-2); }
.cd-picker select { height: 44px; padding: 0; border: 0; background: transparent; color: inherit; text-align: right; text-align-last: right; -webkit-appearance: none; appearance: none; cursor: pointer; }

/* ---- Knoppen (min. 44px hoog) ---- */
.cd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border: 0; border-radius: 999px; font-weight: 600; text-decoration: none; cursor: pointer; }
.cd-btn--prominent { background: var(--cd-tint); color: #FFFFFF; box-shadow: var(--cd-prominent-shadow); }
.cd-btn--tinted    { height: 44px; padding: 0 18px; background: var(--cd-tint-fill); color: var(--cd-tint); }
.cd-btn--gray      { background: var(--cd-fill); color: var(--cd-label); }
.cd-btn--destructive { height: 44px; padding: 0 16px; background: var(--cd-destructive); color: #FFFFFF; }
.cd-btn--plain     { height: 44px; padding: 0 13px; background: transparent; color: var(--cd-tint); font-weight: 400; }
/* Glasknop in de navigatierij (bv. Wijzig) */
.cd-btn--glass { height: 44px; padding: 0 18px; background: rgba(255, 255, 255, 0.8); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); color: var(--cd-label); font-weight: 500; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 0 0 0.5px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.95); }

/* Stepper (vraagprijs, stappen van € 0,50) */
.cd-stepper { display: flex; align-items: center; height: 44px; border-radius: 22px; background: var(--cd-fill); }
.cd-stepper button { display: flex; align-items: center; justify-content: center; width: 50px; height: 44px; padding: 0; border: 0; background: transparent; }
.cd-stepper button:first-child { border-radius: 22px 0 0 22px; }
.cd-stepper button:last-child { border-radius: 0 22px 22px 0; }
.cd-stepper .cd-stepper-divider { width: 1px; height: 18px; background: var(--cd-separator); }

/* ---- Kaart & tegels ---- */
.cd-card { display: flex; flex-direction: column; background: var(--cd-cell); border-radius: var(--cd-radius-group); overflow: hidden; box-shadow: var(--cd-shadow-card); }
.cd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 12px 0; }
.cd-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--cd-radius-tile); background: var(--cd-bg); }

/* ---- Oordeel ---- */
.cd-verdict { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.cd-verdict-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 20px; color: #FFFFFF; }
.cd-verdict-word { flex: 1 1 auto; font-size: 24px; line-height: 29px; font-weight: 700; letter-spacing: 0.009em; }
.cd-verdict--kopen   { background: var(--cd-kopen-band);   color: var(--cd-kopen-fg); }
.cd-verdict--kopen   .cd-verdict-icon { background: var(--cd-kopen-fill); }
.cd-verdict--twijfel { background: var(--cd-twijfel-band); color: var(--cd-twijfel-fg); }
.cd-verdict--twijfel .cd-verdict-icon { background: var(--cd-twijfel-fill); }
.cd-verdict--laten   { background: var(--cd-laten-band);   color: var(--cd-laten-fg); }
.cd-verdict--laten   .cd-verdict-icon { background: var(--cd-laten-fill); }
.cd-fg-kopen { color: var(--cd-kopen-fg); } .cd-fg-twijfel { color: var(--cd-twijfel-fg); } .cd-fg-laten { color: var(--cd-laten-fg); }

/* ---- Camera-zoeker ---- */
.cd-viewfinder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; height: 250px; border-radius: var(--cd-radius-group); overflow: hidden; background: #0C0C0E; }
.cd-viewfinder .cd-btn--prominent { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.18), 0 8px 24px rgba(88, 86, 214, 0.45); }

/* ---- Zwevende tabbalk (Liquid Glass) ---- */
.cd-tabbar {
  position: fixed; left: var(--cd-tabbar-inset); right: var(--cd-tabbar-inset);
  bottom: max(var(--cd-tabbar-inset), calc(env(safe-area-inset-bottom, 0px) - 13px));
  display: flex; gap: 2px; height: var(--cd-tabbar-h); padding: 4px; box-sizing: border-box;
  border-radius: 31px; background: var(--cd-glass-bg);
  -webkit-backdrop-filter: var(--cd-glass-blur); backdrop-filter: var(--cd-glass-blur);
  box-shadow: var(--cd-glass-shadow); z-index: 10;
}
.cd-tab { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 27px; color: var(--cd-label); text-decoration: none; }
.cd-tab svg { width: 26px; height: 26px; }
.cd-tab span { font-size: 11px; line-height: 13px; font-weight: 600; letter-spacing: 0.006em; }
.cd-tab[aria-current="page"] { background: var(--cd-fill-selected); color: var(--cd-tint); }

/* ---- Icoontegel (Instellingen › Status) ---- */
.cd-icon-tile { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: var(--cd-radius-icon-tile); color: #FFFFFF; }

/* ---- Toegankelijk verbergen ---- */
.cd-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
