/*
  Global base styles: fonts, element defaults, form controls and a few layout helpers.
  Component-specific styles live next to the component (*.razor.css). Only tokens here.
*/

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/source-sans-3-latin-600-normal.woff2') format('woff2');
}

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

html {
  -webkit-text-size-adjust: 100%;
}

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

/* The app wrapper from MainLayout. It carries the theme class (.theme-pharmacy), so its ground and
   text colour follow the theme; body keeps the default look for anything outside it. A flex column,
   so the main area fills what the header (one or two rows) leaves and the footer stays at the bottom. */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  line-height: 1.2;
  letter-spacing: var(--tracking-heading);
}

h1 {
  letter-spacing: var(--tracking-display);
}

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

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

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

code {
  font-size: 0.92em;
  background: var(--color-surface-muted);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Small uppercase label above titles ("eyebrow") */
.tr-eyebrow {
  margin: 0;
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary-strong);
}

/* Forms: inputs are rendered by Blazor (InputText etc.), so their styling is global. */
.tr-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.tr-input {
  width: 100%;
  min-width: 0;
  height: var(--input-height);
  padding: 0 15px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-md);
}

/* Multi-line text: grows with the rows attribute, the user can make it taller. */
textarea.tr-input {
  height: auto;
  padding: var(--space-3) 15px;
  line-height: 1.5;
  resize: vertical;
}

.tr-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.tr-input.invalid {
  border-color: var(--color-danger);
}

.tr-field__error {
  font-size: var(--text-xs);
  color: var(--color-danger-text);
}

.tr-checkbox {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-sm);
}

.tr-checkbox input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-primary);
}

/* Layout helpers */
.tr-container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.tr-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.tr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

/* Small muted remark with an optional icon, e.g. "Alleen verantwoordelijken zien dit." */
.tr-note {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* A group of inputs without the browser's fieldset frame */
.tr-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Several TrChoice options side by side, stacking on narrow screens */
.tr-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.tr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .tr-container {
    padding: 0 var(--space-4);
  }
}

/* FocusOnNavigate moves focus to the h1 for screen readers; no visible ring needed there. */
[tabindex="-1"]:focus {
  outline: none;
}

/* Printing (the result sheet of a care test, ADR 0022): only the page content, without the app
   around it. Mark anything else that must not print with .no-print. */
@media print {
  .app-header,
  .app-footer,
  .skip-link,
  #blazor-error-ui,
  .consent,
  .no-print {
    display: none !important;
  }

  body {
    background: none;
  }
}
