/* ==========================================================================
   Variables
   Huisstijl (kleuren, lettertype, spacing) op één plek aanpasbaar.
   ========================================================================== */

:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  /* Accent of the employee feedback form (scale, progress bar, submit button)
     and the login form; same blue as the rest of the app. */
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-edge: #1e40af;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-background: #ffffff;
  --color-surface: #f9fafb;
  --color-border: #e5e7eb;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-danger-dark: #b91c1c;
  --color-warning: #d97706;
  --color-warning-dark: #b45309;

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;
  --line-height-base: 1.5;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2.5rem;
  --spacing-xxl: 4rem;

  /* Layout */
  --max-width-content: 960px;
  --border-radius: 0.375rem;
}

/* ==========================================================================
   Base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-background);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-top: 0;
}

a {
  color: var(--color-primary);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-md) var(--spacing-lg);
}

.site-header__logo {
  height: 8rem;
  width: auto;
}

main {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* ==========================================================================
   Components
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  /* Soft lift so blocks read as separate objects against the page
     background, without adding a new accent color (see option C,
     2026-10-02). */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.button {
  display: inline-block;
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 600;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--border-radius);
  background: var(--color-primary);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--color-primary-dark);
}

.button--accent {
  background: var(--color-accent);
  color: #ffffff;
}

.button--accent:hover {
  background: var(--color-accent-hover);
}

.button--danger {
  background: var(--color-danger);
}

.button--danger:hover {
  background: var(--color-danger-dark);
}

.button--warning {
  background: var(--color-warning);
}

.button--warning:hover {
  background: var(--color-warning-dark);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

/* Extra room below a form's button row, so the next section's heading
   doesn't sit right against the save button. */
.form-spaced {
  margin-bottom: var(--spacing-xl);
}

/* Top row: the export checkboxes, side by side, spanning both columns.
   Second row: the main PDF-report button, full width (export-grid__full).
   Bottom row (below the rule): the CSV button on the left, the open-
   answers PDF button on the right. justify-self: stretch makes both
   bottom-row buttons as wide as their own cell. Mockup approved 2026-10-09
   (https://claude.ai/artifact/6JesG1vpwBqFFT1gpbfrTR, "Voorstel B") after a
   second checkbox (Agenda en aantekeningen meenemen) broke the previous
   2-column auto-flow: it pushed the PDF button into its own lopsided row. */
.export-grid {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: var(--spacing-lg);
  row-gap: var(--spacing-sm);
  align-items: center;
}

.export-grid__choices {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
}

.export-grid__full {
  grid-column: 1 / -1;
}

.export-grid > .button {
  justify-self: stretch;
  text-align: center;
}

.export-grid > .export-grid__left {
  justify-self: start;
}

.export-grid__rule {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--color-border);
}

@media (max-width: 480px) {
  .export-grid {
    grid-template-columns: 1fr;
  }

  .export-grid > .export-grid__left {
    justify-self: stretch;
  }
}

.field {
  display: block;
  margin-bottom: var(--spacing-md);
}

/* .field's own `display: block` otherwise overrides the `hidden` attribute's
   `display: none` (equal CSS specificity, author stylesheet wins) - needed
   for the "nieuw bedrijf"-field in "Ronde aanmaken", toggled via dashboard.js. */
.field[hidden] {
  display: none;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: inherit;
  font-size: var(--font-size-base);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

/* The browser default is "resize: both" - dragging a textarea wider than
   its 100% width above sets an explicit pixel width that overflows the
   container, stretching the whole row (score buttons included) along with
   it. Still resizable in height, just not width. */
.field textarea {
  resize: vertical;
}

/* Focus ring in the accent colour, only on the login and employee forms
   (/dashboard keeps the browser default). */
#login-form .field input:focus,
#feedback-form .field textarea:focus {
  outline: none;
  border-color: var(--color-accent-edge);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45);
}

.field__hint {
  margin: var(--spacing-xs) 0 0;
  font-size: var(--font-size-sm);
}

/* A group of related inputs (e.g. radio buttons) under one legend. */
.field-group {
  border: 0;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.field-group legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: var(--spacing-xs);
}

/* A radio button/checkbox with its text on one line; overrides the
   full-width, bold defaults of .field inputs and labels. */
.field .choice {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 400;
  margin-bottom: var(--spacing-xs);
}

.field .choice input {
  width: auto;
}

.login-card {
  max-width: 360px;
  margin: var(--spacing-xl) auto;
}

.message-card {
  max-width: 480px;
  margin: var(--spacing-xl) auto;
  text-align: center;
}

.form-error {
  color: var(--color-danger);
  font-size: var(--font-size-sm);
  min-height: 1.25em;
}

.text-muted {
  color: var(--color-text-muted);
}

.reverse-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.link-button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: inherit;
  font-size: var(--font-size-base);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-button:active {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.inline-form .field {
  margin-bottom: 0;
  flex-grow: 1;
}

.rounds-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rounds-list li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.tokens-table {
  width: 100%;
  border-collapse: collapse;
}

.tokens-table th,
.tokens-table td {
  text-align: left;
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

/* Matches the MT dataset color in the category radar chart, so the same
   link stays recognizable in both places. */
.token-type--self {
  color: var(--color-warning);
  font-weight: 600;
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
}

.card + .card {
  margin-top: var(--spacing-xxl);
}

.results-top3 {
  display: flex;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-lg);
}

.results-top3 > div {
  flex: 1 1 240px;
}

.results-top3 ol {
  padding-left: var(--spacing-lg);
}

.chart-container {
  max-width: 600px;
  margin-bottom: var(--spacing-lg);
}

.open-answers-item {
  margin: var(--spacing-md) 0;
}

.collapsible summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--spacing-xs) 0;
}

.collapsible[open] summary {
  margin-bottom: var(--spacing-sm);
}

.open-answers-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--spacing-xs) 0;
}

/* A question's custom toelichting-label (Question.open_label), shown inside
   <summary> so it's visible without expanding the collapsed row. */
.open-answers-sub {
  display: block;
  font-weight: 400;
  font-size: var(--font-size-sm);
}

.open-answers-item[open] summary {
  margin-bottom: var(--spacing-sm);
}

.open-answers-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.open-answers-list li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
  /* Keep line breaks people typed in their answer. */
  white-space: pre-wrap;
}

/* ==========================================================================
   Feedback form (employee side)
   ========================================================================== */

.feedback-intro {
  max-width: 720px;
  margin-bottom: var(--spacing-lg);
}

/* The intro is free text typed by the admin; keep its line breaks. */
.feedback-intro p {
  white-space: pre-line;
}

#feedback-form {
  max-width: 720px;
}

.feedback-progress {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-xs) var(--spacing-md);
  padding: var(--spacing-sm) 0;
  margin-bottom: var(--spacing-md);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

/* flex-basis lets the text wrap under the bar on a narrow screen instead of
   pushing past the edge. */
.feedback-progress progress {
  flex: 1 1 8rem;
  min-width: 0;
  height: 0.75rem;
  accent-color: var(--color-accent);
  background: var(--color-border);
  border: none;
  border-radius: var(--border-radius);
}

/* accent-color only themes the filled part; Chromium needs this pseudo-element
   for the track background, otherwise it follows OS dark/light mode instead
   of the page's own colors. */
.feedback-progress progress::-webkit-progress-bar {
  background: var(--color-border);
  border-radius: inherit;
}

/* accent-color's automatic fill theming turned out unreliable once the host
   element got a custom background/border-radius; style the fill explicitly
   per engine instead of relying on it. */
.feedback-progress progress::-webkit-progress-value {
  background: var(--color-accent);
  border-radius: inherit;
}

.feedback-progress progress::-moz-progress-bar {
  background: var(--color-accent);
  border-radius: inherit;
}

.feedback-progress span {
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.feedback-category {
  margin-bottom: var(--spacing-lg);
}

.question {
  border: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg);
}

.question:last-child {
  margin-bottom: 0;
}

.question legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: var(--spacing-sm);
}

.question--unanswered legend {
  color: var(--color-danger);
}

.scale {
  display: flex;
  gap: var(--spacing-sm);
}

.scale__option {
  position: relative;
  flex: 1;
  cursor: pointer;
}

/* The radio stays in the layout (opacity, not display:none) so it remains
   keyboard-focusable; the visible pill is the sibling span. */
.scale__option input {
  position: absolute;
  opacity: 0;
}

.scale__option span {
  display: block;
  padding: var(--spacing-sm) 0;
  text-align: center;
  font-weight: 600;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.scale__option:hover span {
  border-color: var(--color-accent-hover);
}

.scale__option input:checked + span {
  background: var(--color-accent);
  border-color: var(--color-accent-edge);
  box-shadow: inset 0 0 0 1px var(--color-accent-edge);
  color: #ffffff;
}

.scale__option input:focus-visible + span {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.scale__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-xs);
  font-size: var(--font-size-sm);
}

.question__open {
  margin: var(--spacing-md) 0 0;
}

/* Highlights the specific textarea that's still missing, not just the
   question title, when a required toelichting is left empty at submit. */
.question__open textarea.question__open-textarea--missing {
  border-color: var(--color-danger);
  background: rgba(220, 38, 38, 0.06);
}

.question__open-hint {
  margin: var(--spacing-xs) 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-danger);
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none;
  }

  body {
    color: #000;
  }

  .chart-container,
  .results-top3 > div {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }
}
