/* Huisstijl van de Vraagbaak-demosite, afgeleid van clubpellikaan.nl (gemeten waarden uit de UI-SPEC).
   Eén stylesheet voor alle pagina's; alles wordt van de eigen herkomst geladen (CSP: geen inline stijl). */

:root {
  /* Kleur: gemeten op clubpellikaan.nl, tenzij anders vermeld */
  --kleur-wit: #FFFFFF;
  --kleur-zwart: #000000;
  --kleur-geel: #F5A200;          /* primair accent */
  --kleur-geel-hover: #FFD686;
  --kleur-geel-licht: #FDE8BF;
  --kleur-grijs: #E9E6E4;         /* kop, randen */
  --kleur-grijs-licht: #F6F5F4;   /* kaarten, antwoordballon */
  --kleur-grijs-donker: #5D5D5D;  /* hover zwarte knop, hulptekst */
  --kleur-google-rand: #747775;   /* Google-knop (merkrichtlijn, niet van Pellikaan) */
  --kleur-google-tekst: #1F1F1F;  /* idem */

  /* Betekenis */
  --vlak-hoofd: var(--kleur-wit);
  --vlak-zacht: var(--kleur-grijs-licht);
  --vlak-kop: var(--kleur-grijs);
  --vlak-donker: var(--kleur-zwart);
  --tekst: var(--kleur-zwart);
  --tekst-zacht: var(--kleur-grijs-donker);
  --lijn: var(--kleur-grijs);
  --lijn-sterk: var(--kleur-grijs-donker);
  --fokus-lijn: #000000;          /* wordt #FFFFFF op zwarte vlakken */
  --fokus-vulling: #FFFFFF;       /* wordt #000000 op zwarte vlakken */

  /* Typografie */
  --font-tekst: "Poppins", sans-serif;
  --font-kop: Georgia, "Times New Roman", serif;
  --tekst-s: 0.875rem;  /* 14px */
  --tekst-m: 1rem;      /* 16px */
  --tekst-l: 1.5rem;    /* 24px */
  --tekst-xl: 2rem;     /* 32px */
  --gewicht-licht: 300;
  --gewicht-vet: 600;
  --letterafstand-label: 0.1em;

  /* Ruimte (veelvouden van 4) */
  --ruimte-xs: 4px;
  --ruimte-s: 8px;
  --ruimte-m: 16px;
  --ruimte-l: 24px;
  --ruimte-xl: 32px;
  --ruimte-2xl: 48px;
  --ruimte-3xl: 64px;

  /* Vorm en diepte */
  --radius: 4px;
  --schaduw-paneel: 0 8px 32px rgba(0, 0, 0, 0.25);
  --schaduw-knop: 0 4px 16px rgba(0, 0, 0, 0.25);
  --overgang: 300ms ease;         /* gemeten: duration-300 */

  /* Lagen */
  --laag-kop: 10;
  --laag-knop: 50;
  --laag-paneel: 100;
}

/* Zwarte vlakken (strook, voet, kop van het chatvenster): omgekeerde focusring */
.vlak-donker { --fokus-lijn: #FFFFFF; --fokus-vulling: #000000; }

/* Lettertypen: zelf gehost, SIL Open Font License (zie lettertypen/OFL-Poppins.txt) */
@font-face { font-family: "Poppins"; src: url("/lettertypen/Poppins-Light.woff2") format("woff2");    font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/lettertypen/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }

body {
  /* Zijpadding per breekpunt: 16 / 32 / 48px */
  --zij: var(--ruimte-m);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background: var(--vlak-hoofd);
  color: var(--tekst);
  font-family: var(--font-tekst);
  font-size: var(--tekst-m);
  font-weight: var(--gewicht-licht);
  line-height: 1.5;
}

main { flex: 1 0 auto; }

/* Standaard visueel-verborgen patroon: blijft voorleesbaar voor schermlezers (geen display: none) */
.alleen-lezers {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Gedeelde focusstijl: zichtbaar op geel, zwart en wit */
:focus-visible {
  outline: 3px solid var(--fokus-lijn);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--fokus-vulling);
}

/* Koppen */
h1 {
  margin: 0 0 var(--ruimte-l);
  font-family: var(--font-kop);
  font-size: var(--tekst-xl);
  font-weight: var(--gewicht-licht);
  line-height: 1.2;
}

h2 {
  margin: 0 0 var(--ruimte-m);
  font-size: var(--tekst-l);
  font-weight: var(--gewicht-licht);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: var(--letterafstand-label);
}

p { margin: 0 0 var(--ruimte-l); }

/* Links in lopende tekst: onderstreept, hover met lichtgeel vlak */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { background-color: var(--kleur-geel-hover); }

a, button {
  transition: background-color var(--overgang), color var(--overgang);
}

/* Labelstijl: 14px, 600, hoofdletters, letterafstand */
.strook,
.regel-pilot,
.knop,
.knop-tekst,
.voet-link {
  font-size: var(--tekst-s);
  font-weight: var(--gewicht-vet);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: var(--letterafstand-label);
}

/* Kop van de pagina: strook en logo-balk blijven samen bovenaan staan */
.paginakop {
  position: sticky;
  top: 0;
  z-index: var(--laag-kop);
}

.strook {
  min-height: 32px;
  margin: 0;
  padding: var(--ruimte-s) var(--ruimte-m);
  background: var(--vlak-donker);
  color: var(--kleur-wit);
  text-align: center;
}

.kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding-inline: max(var(--zij), calc((100% - 1280px) / 2));
  background: var(--vlak-kop);
}

.kop-logo {
  display: block;
  width: 126px;
  height: auto;
}

.kop-rechts form { margin: 0; }

/* Inhoud: gecentreerde kolom van de inlogkaart en de eindpagina's */
.kaart {
  width: 100%;
  max-width: calc(440px + 2 * var(--zij));
  margin-inline: auto;
  padding: var(--ruimte-3xl) var(--zij);
  text-align: center;
}

.kaart p:last-child,
.kaart .melding:last-child { margin-bottom: 0; }

.regel-pilot {
  margin-top: var(--ruimte-l);
  color: var(--tekst-zacht);
}

.melding {
  margin: 0 0 var(--ruimte-l);
  padding: var(--ruimte-m);
  border-left: 4px solid var(--kleur-geel);
  background: var(--kleur-geel-licht);
  text-align: left;
}

/* Knoppen */
.knop,
.knop-tekst,
.knop-google {
  font-family: inherit;
  cursor: pointer;
}

.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--ruimte-l);
  border: 0;
  border-radius: 0;
  text-decoration: none;
}

.knop--geel {
  background: var(--kleur-geel);
  color: var(--kleur-zwart);
}
.knop--geel:hover,
.knop--geel:active { background: var(--kleur-geel-hover); }
.knop--geel[aria-disabled="true"] {
  background: var(--kleur-grijs);
  color: var(--tekst-zacht);
  cursor: default;
}

.knop-tekst {
  min-height: 44px;
  padding: 0 var(--ruimte-s);
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--kleur-zwart);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.knop-tekst:hover,
.knop-tekst:active {
  background: var(--kleur-geel-hover);
  text-decoration: none;
}

.knop-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 280px;
  max-width: 100%;
  min-height: 48px;
  padding: 0 var(--ruimte-m);
  border: 1px solid var(--kleur-google-rand);
  border-radius: 0;
  background: var(--kleur-wit);
  color: var(--kleur-google-tekst);
  font-size: var(--tekst-s);
  font-weight: var(--gewicht-vet);
  line-height: 1.4;
  text-decoration: none;
}
.knop-google:hover { background: var(--kleur-grijs-licht); }
.knop-google:active { background: var(--kleur-grijs); }
.knop-google img { display: block; flex: none; }

/* Eindpagina's (geweigerd, inlogfout, niet gevonden, serverfout): de kaart met één gele knop */
.kaart--eind .knop { margin-top: var(--ruimte-l); }

/* Iconen: bestanden als masker, zodat ze de tekstkleur volgen en geen data:-adres nodig hebben */
.ikoon {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 24px;
  background-color: currentColor;
}
.ikoon--chat { -webkit-mask: url(/ikonen/chat.svg) center / contain no-repeat; mask: url(/ikonen/chat.svg) center / contain no-repeat; }
.ikoon--sluiten { -webkit-mask: url(/ikonen/sluiten.svg) center / contain no-repeat; mask: url(/ikonen/sluiten.svg) center / contain no-repeat; }
.ikoon--versturen { -webkit-mask: url(/ikonen/versturen.svg) center / contain no-repeat; mask: url(/ikonen/versturen.svg) center / contain no-repeat; }
.ikoon--waarschuwing { -webkit-mask: url(/ikonen/waarschuwing.svg) center / contain no-repeat; mask: url(/ikonen/waarschuwing.svg) center / contain no-repeat; }

/* Demopagina: kolom van maximaal 720px met ruimte onderaan voor de chatknop */
.demo {
  width: 100%;
  max-width: calc(720px + 2 * var(--zij));
  margin-inline: auto;
  padding: var(--ruimte-2xl) var(--zij) var(--ruimte-3xl);
}

.demo .melding { margin-bottom: var(--ruimte-l); }

.voorbeeldvragen {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-s);
  margin: 0 0 var(--ruimte-l);
  padding: 0;
  list-style: none;
}

.voorbeeldvraag {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: var(--ruimte-m) var(--ruimte-l);
  border: 1px solid var(--kleur-grijs);
  border-radius: var(--radius);
  background: var(--kleur-grijs-licht);
  color: var(--kleur-zwart);
  font-family: inherit;
  font-size: var(--tekst-m);
  font-weight: var(--gewicht-licht);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}
.voorbeeldvraag:hover,
.voorbeeldvraag:active {
  border-color: var(--kleur-geel);
  background: var(--kleur-geel-hover);
}
.voorbeeldvraag[aria-disabled="true"] {
  border-color: var(--kleur-grijs);
  background: var(--kleur-grijs);
  color: var(--tekst-zacht);
  cursor: default;
}

.hulpregel { margin: 0; }

/* Voet: zwart, met wit wordmerk, de pilotzin en de link naar de echte site */
.voet {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-l);
  flex: none;
  padding: var(--ruimte-2xl) max(var(--zij), calc((100% - 1280px) / 2));
  /* Onderaan de pagina ligt de chatknop (64px, 24px van de rand) over de voet: houd de tekst erboven */
  padding-bottom: calc(var(--ruimte-2xl) + 88px);
  background: var(--vlak-donker);
  color: var(--kleur-wit);
}

.voet p { margin: 0; }

.voet-logo {
  display: block;
  width: 126px;
  height: auto;
  margin-bottom: var(--ruimte-l);
}

.voet-link {
  color: var(--kleur-wit);
  text-decoration-color: var(--kleur-wit);
}
.voet-link:hover {
  background: none;
  text-decoration: none;
}

/* ---------- Chatvenster (UI-SPEC "Chatvenster"): knop, paneel, berichten en invoer ---------- */

/* Het attribuut hidden moet winnen van de display-regels hieronder */
.chat-knop[hidden],
.chat-paneel[hidden] { display: none; }

.chat-knop {
  position: fixed;
  right: var(--ruimte-m);
  bottom: calc(var(--ruimte-m) + env(safe-area-inset-bottom));
  z-index: var(--laag-knop);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--kleur-geel);
  color: var(--kleur-zwart);
  box-shadow: var(--schaduw-knop);
  cursor: pointer;
}
.chat-knop:hover,
.chat-knop:active { background: var(--kleur-geel-hover); }
.chat-knop .ikoon { width: 28px; height: 28px; }

/* Zwarte stip: er is een antwoord binnengekomen terwijl het venster dicht was */
.chat-knop--nieuw::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--kleur-wit);
  border-radius: 50%;
  background: var(--kleur-zwart);
}

/* Een geopend venster op een telefoon: de pagina erachter scrolt niet */
html.chat-open { overflow: hidden; }

/* Telefoon: schermvullend */
.chat-paneel {
  position: fixed;
  inset: 0;
  z-index: var(--laag-paneel);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: var(--kleur-wit);
}

.chat-kop {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--ruimte-s) 0 var(--ruimte-m);
  background: var(--vlak-donker);
  color: var(--kleur-wit);
}
.chat-kop h2 {
  margin: 0;
  font-size: var(--tekst-s);
  font-weight: var(--gewicht-vet);
  line-height: 1.4;
}

.chat-sluiten {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--kleur-wit);
  cursor: pointer;
}
.chat-sluiten:hover,
.chat-sluiten:active { background: var(--kleur-grijs-donker); }

.chat-gesprek {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--ruimte-m);
  min-height: 0;
  padding: var(--ruimte-m);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Berichten */
.ballon {
  max-width: 90%;
  min-width: 0;
  padding: 12px var(--ruimte-m);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ballon--gebruiker {
  align-self: flex-end;
  background: var(--kleur-zwart);
  color: var(--kleur-wit);
}
.ballon--antwoord,
.ballon--bezig {
  align-self: flex-start;
  border: 1px solid var(--kleur-grijs);
  background: var(--kleur-grijs-licht);
  color: var(--kleur-zwart);
}
.ballon--bezig {
  display: flex;
  align-items: center;
  gap: var(--ruimte-s);
  color: var(--tekst-zacht);
}
.ballon--fout {
  align-self: flex-start;
  padding: 12px var(--ruimte-m) 12px 12px;
  border-left: 4px solid var(--kleur-geel);
  background: var(--kleur-geel-licht);
  color: var(--kleur-zwart);
}
.ballon-rij {
  display: flex;
  align-items: flex-start;
  gap: var(--ruimte-s);
}
.ballon-rij .ikoon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.ballon--fout .knop-tekst { margin-top: var(--ruimte-xs); margin-left: -8px; }

.antwoord-link {
  color: var(--kleur-zwart);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.antwoord-link:hover { background-color: var(--kleur-geel-hover); }

/* Bezig-indicator: drie puntjes die om en om omhoog gaan (stilstaand bij prefers-reduced-motion) */
.bezig-puntjes {
  display: inline-flex;
  flex: none;
  gap: var(--ruimte-xs);
  align-items: center;
}
.bezig-puntje {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kleur-grijs-donker);
  animation: bezig-spring 1.2s ease-in-out infinite;
}
.bezig-puntje:nth-child(2) { animation-delay: 0.2s; }
.bezig-puntje:nth-child(3) { animation-delay: 0.4s; }
@keyframes bezig-spring {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Welkomstbericht: voorbeeldvragen als chips */
.chat-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ruimte-s);
  align-self: flex-start;
  max-width: 100%;
}
.chat-chips-kop {
  margin: 0;
  color: var(--tekst-zacht);
  font-size: var(--tekst-s);
  font-weight: var(--gewicht-vet);
  line-height: 1.4;
}
.chat-chip {
  max-width: 100%;
  min-height: 44px;
  padding: var(--ruimte-s) var(--ruimte-m);
  border: 1px solid var(--kleur-grijs);
  border-radius: var(--radius);
  background: var(--kleur-grijs-licht);
  color: var(--kleur-zwart);
  font-family: inherit;
  font-size: var(--tekst-m);
  font-weight: var(--gewicht-licht);
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.chat-chip:hover,
.chat-chip:active { background: var(--kleur-geel-hover); }
.chat-chip[aria-disabled="true"] {
  background: var(--kleur-grijs);
  color: var(--tekst-zacht);
  cursor: default;
}

/* Invoerbalk */
.chat-invoerbalk {
  display: grid;
  flex: none;
  grid-template-columns: 1fr 48px;
  align-items: end;
  gap: var(--ruimte-s);
  padding: var(--ruimte-m);
  padding-bottom: calc(var(--ruimte-m) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--lijn);
}
.chat-invoer {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  max-height: 144px;
  padding: 11px var(--ruimte-m);
  overflow-y: auto;
  border: 1px solid var(--lijn-sterk);
  border-radius: var(--radius);
  background: var(--kleur-wit);
  color: var(--kleur-zwart);
  font-family: inherit;
  font-size: var(--tekst-m);
  font-weight: var(--gewicht-licht);
  line-height: 24px;
  resize: none;
}
.chat-invoer:focus { border-color: var(--kleur-zwart); }

.chat-verstuur {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--kleur-geel);
  color: var(--kleur-zwart);
  cursor: pointer;
}
.chat-verstuur:hover,
.chat-verstuur:active { background: var(--kleur-geel-hover); }
.chat-verstuur[aria-disabled="true"] {
  background: var(--kleur-grijs);
  color: var(--tekst-zacht);
  cursor: default;
}

.chat-regel {
  display: flex;
  grid-column: 1 / -1;
  gap: var(--ruimte-s);
  justify-content: space-between;
  min-height: 20px;
  color: var(--tekst-zacht);
  font-size: var(--tekst-s);
  font-weight: var(--gewicht-vet);
  line-height: 1.4;
}
.chat-teller { color: var(--tekst); }
.chat-hint { display: none; margin-left: auto; }

/* Tablet: zijpadding 32px */
@media (min-width: 640px) {
  body { --zij: var(--ruimte-xl); }
}

/* Desktop: zijpadding 48px, groter logo, voet in twee kolommen */
@media (min-width: 1024px) {
  body { --zij: var(--ruimte-2xl); }

  .kop-logo { width: 164px; }

  .voet {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding-block: var(--ruimte-3xl);
    /* De link rechts mag niet onder de chatknop liggen */
    padding-right: max(calc(var(--zij) + 64px), calc((100% - 1280px) / 2));
  }
}

/* Tablet: het venster is een paneel rechtsonder van 400px, de knop staat 24px van de rand */
@media (min-width: 640px) {
  .chat-knop {
    right: var(--ruimte-l);
    bottom: calc(var(--ruimte-l) + env(safe-area-inset-bottom));
  }

  .chat-paneel {
    inset: auto;
    right: var(--ruimte-l);
    bottom: var(--ruimte-l);
    width: 400px;
    height: min(600px, calc(100dvh - 48px));
    min-height: 480px;
    border: 1px solid var(--lijn);
    border-radius: var(--radius);
    box-shadow: var(--schaduw-paneel);
  }

  .ballon { max-width: 85%; }
  .chat-hint { display: inline; }
}

/* Desktop: het paneel is 440px breed */
@media (min-width: 1024px) {
  .chat-paneel {
    width: 440px;
    height: min(680px, calc(100dvh - 48px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none;
    transition: none;
  }
  a, button {
    transition: none;
  }
  /* De klasse wint van de * -regel hierboven, dus de puntjes krijgen hun eigen regel */
  .bezig-puntje { animation: none; }
}
