/* Ospa blue as Bootstrap 6 primary theme color: buttons (btn-solid/outline theme-primary), alerts,
   badges, bg-primary, focus rings all read these tokens. Derived shades via color-mix(), light/dark
   aware via light-dark() like Bootstrap's own tokens. (Outside any @layer, so it wins over Bootstrap.) */
:root,
:host {
  --ospa-blue: #1976d2;
  --bs-primary-base: var(--ospa-blue);
  --bs-primary-bg: var(--ospa-blue);
  --bs-primary-contrast: #fff;
  --bs-primary-fg: light-dark(#1565c0, color-mix(in oklch, var(--ospa-blue) 65%, #fff));
  --bs-primary-fg-emphasis: light-dark(#0d47a1, color-mix(in oklch, var(--ospa-blue) 35%, #fff));
  --bs-primary-bg-subtle: light-dark(color-mix(in oklch, var(--ospa-blue) 12%, #fff), color-mix(in oklch, var(--ospa-blue) 30%, #000));
  --bs-primary-bg-muted: light-dark(color-mix(in oklch, var(--ospa-blue) 25%, #fff), color-mix(in oklch, var(--ospa-blue) 45%, #000));
  --bs-primary-border: light-dark(color-mix(in oklch, var(--ospa-blue) 45%, #fff), #1565c0);
  --bs-primary-focus-ring: color-mix(in oklch, var(--ospa-blue) 50%, transparent);
  /* WCAG AA contrast (4.5:1) in light mode, Bootstrap 6 alpha defaults miss it: white on red-500
     (delete button, 4.41) and yellow-700 text in warning alerts (3.7) */
  --bs-danger-bg: light-dark(var(--bs-red-600), var(--bs-red-500));
  --bs-warning-fg: light-dark(var(--bs-yellow-800), var(--bs-yellow-400));
}

/* square icon-only copy button, icon centered (see _partials/_copy_button.html.twig) */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
}

/* :not(.d-none): Bootstrap 6 utilities live in @layer utilities without !important, so an unlayered
   display rule here would beat .d-none (both icons visible) */
.btn-copy svg:not(.d-none) {
  display: block;
}

.logo-white {
    filter: brightness(0) invert(1);
}
/* form collections (e.g. "Kinder"): the last remaining entry can't be removed (at least one child
   is required with "Kinder: Ja"), see templates/employee_data/_children_theme.html.twig */
[data-collection-entry]:only-child [data-collection-remove] {
  display: none;
}

/* The real file input is .visually-hidden (position: absolute). Anchor it inside its picker, otherwise
   it sits at the top of the page and focusing it after a validation error (focusFirstInvalid() in
   app.js) scrolls there instead of to the field. See templates/form/theme.html.twig (file_row). */
.file-picker {
  position: relative;
}

/* long file names / "Keine Dateien ausgewählt" on phones: end in "…" instead of being cut off */
.file-picker [data-file-name] {
  display: block; /* Bootstrap 6 .form-control is flex, where text-overflow has no effect */
  line-height: inherit;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* keyboard focus on the (visually hidden) file input: show the focus ring on the visible picker */
.file-picker:has(input[type=file]:focus-visible) .input-group {
  border-radius: var(--bs-border-radius, 0.375rem);
  box-shadow: 0 0 0 0.25rem var(--bs-primary-focus-ring);
}

/* Bootstrap 6 .form-field is a grid: in a .row its column is stretched to the height of the tallest
   neighbour (e.g. a field with help text), and the grid would distribute that extra height over its
   rows (taller label row, taller input). Keep the rows at their natural height instead. */
.row > .form-field {
  align-content: start;
}

/* Admin navigation in the blue navbar (templates/_partials/_header.html.twig): pill links with icon,
   the current section highlighted (white, bold, light background), always in one row (the navbar has
   no toggler; on small screens only the icons are shown). */
.app-nav {
  flex-direction: row;
  gap: 0.25rem;
}

.app-nav .nav-link {
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 0;
  border-radius: 999px;
  color: color-mix(in oklch, #fff 80%, transparent);
  font-weight: 500;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus-visible {
  color: #fff;
  background-color: color-mix(in oklch, #fff 12%, transparent);
}

.app-nav .nav-link.active {
  color: #fff;
  background-color: color-mix(in oklch, #fff 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, #fff 25%, transparent);
  font-weight: 600;
}

.app-nav-divider {
  align-self: center;
  height: 1.75rem;
  background-color: #fff;
  opacity: 0.3;
}

/* initials of the signed-in admin */
.app-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: color-mix(in oklch, #fff 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, #fff 35%, transparent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* "Abmelden" on the blue bar: white outline like the nav links (theme-secondary looked disabled there) */
.app-logout {
  color: #fff;
  border: var(--bs-border-width) solid color-mix(in oklch, #fff 55%, transparent);
  background-color: transparent;
}

.app-logout:hover,
.app-logout:focus-visible {
  color: #fff;
  border-color: #fff;
  background-color: color-mix(in oklch, #fff 15%, transparent);
}

.app-user-name {
  max-width: 14rem;
  opacity: 0.85;
}
