/*
  Base styles: element defaults, the container and buttons. Component styles live next to their
  component (*.razor.css). Values come from css/tokens.css.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-after-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

p {
  margin: 0 0 var(--space-after-paragraph);
}

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

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

img,
svg {
  vertical-align: middle;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--button-padding);
  font-family: var(--font-heading);
  font-size: var(--button-font-size);
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  background: var(--color-primary);
  border: var(--border-width) solid var(--color-primary);
  border-radius: var(--radius);
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}

.button:hover,
.button:focus-visible {
  color: var(--color-white);
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.button:active {
  transform: scale(0.97);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--ghost {
  color: var(--color-dark);
  background: transparent;
  border-color: var(--color-gray-300);
}

.button--ghost:hover,
.button--ghost:focus-visible {
  color: var(--color-primary);
  background: transparent;
  border-color: var(--color-primary);
}

/*
  The licence plate as on profile.nl: a frame with the blue country band (NL or B symbol) and the
  plate itself. Dutch: black on yellow. Belgian: red on white in a red frame, and longer. The same
  look for the input in step 1 (.plate__input) and the plate in the summary (.plate--small).
*/
.plate {
  display: inline-flex;
  align-items: stretch;
  height: var(--plate-height);
  font-family: var(--font-plate);
  font-size: var(--font-size-plate);
  font-weight: 700;
  border: var(--plate-border-width) solid var(--color-dark);
  border-radius: var(--radius-plate);
}

.plate__band {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--plate-band-width);
  padding: var(--plate-band-padding);
  background: var(--color-plate-band);
  border-radius: var(--radius-plate-inner) 0 0 var(--radius-plate-inner);
}

.plate__band img {
  width: 100%;
  height: auto;
}

.plate__input,
.plate__text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--plate-input-width);
  min-width: 0;
  padding: 0 var(--space-8);
  font: inherit;
  color: var(--color-dark);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-secondary);
  border: 0;
  border-radius: 0 var(--radius-plate-inner) var(--radius-plate-inner) 0;
}

/* As today, focus shows as a darker yellow (Belgian plate: the red frame), no ring around the plate. */
.plate__input:focus {
  background: var(--color-plate-focus);
  outline: none;
}

.plate__input::placeholder {
  font-weight: 400;
  color: var(--color-gray-600);
}

.plate--be {
  border-color: var(--color-primary);
}

.plate--be .plate__input,
.plate--be .plate__text {
  width: var(--plate-input-width-be);
  color: var(--color-primary);
  background: var(--color-white);
  box-shadow: inset 0 0 0 var(--border-width) var(--color-plate-be-border);
}

.plate--be .plate__input:focus {
  background: var(--color-white);
}

.plate--small {
  height: var(--plate-height-small);
  font-size: var(--font-size-plate-small);
  border: 0;
}

.plate--small .plate__band {
  width: var(--plate-band-width-small);
}

.plate--small .plate__text {
  width: auto;
  padding: 0 var(--space-5);
}

.plate--invalid {
  border-color: var(--color-primary);
}

/* "Wijzigen" with a pencil after the text, as profile.nl's edit-button: a button or a link. */
.edit-button {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: 0;
  font: inherit;
  color: var(--color-dark);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
}

.edit-button__icon {
  flex-shrink: 0;
}

.edit-button:disabled {
  cursor: default;
  opacity: var(--opacity-disabled);
}

/* Blazor moves focus to the page heading after navigation, for screen readers; no ring for that. */
[tabindex="-1"]:focus {
  box-shadow: none;
}

/* Form fields */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
  border: 0;
}

.field > label,
.field > legend {
  padding: 0;
  font-family: var(--font-heading);
  font-weight: 700;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"] {
  width: 100%;
  padding: var(--space-6) var(--space-7);
  font: inherit;
  color: var(--color-dark);
  background: var(--color-white);
  border: var(--border-width) solid var(--color-gray-300);
  border-radius: var(--radius);
}

.field input[type="text"]:focus-visible,
.field input[type="tel"]:focus-visible,
.field input[type="email"]:focus-visible {
  border-color: var(--color-primary);
}

.field input[aria-invalid="true"] {
  border-color: var(--color-primary);
}

.field__error,
.validation-message {
  margin: 0;
  color: var(--color-primary);
}

.field__hint {
  margin: 0;
  color: var(--color-gray-600);
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-9);
}

.choice {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  cursor: pointer;
}

.choice input {
  accent-color: var(--color-primary);
}

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

[hidden] { display: none !important; }

.field textarea {
  width: 100%;
  padding: var(--space-6) var(--space-7);
  font: inherit;
  color: var(--color-dark);
  resize: vertical;
  background: var(--color-white);
  border: var(--border-width) solid var(--color-gray-300);
  border-radius: var(--radius);
}

/* A choice among several, as a pill. */
.chip {
  padding: var(--space-3) var(--space-6);
  font: inherit;
  font-size: var(--font-size-small);
  color: var(--color-dark);
  cursor: pointer;
  background: var(--color-white);
  border: var(--border-width) solid var(--color-gray-300);
  border-radius: 999px;
}

.chip[aria-pressed="true"] {
  color: var(--color-white);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Yellow, as profile.nl's "Maak direct deze afspraak". */
.button--secondary {
  color: var(--color-dark);
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  color: var(--color-dark);
  background: var(--color-secondary-hover);
  border-color: var(--color-secondary-hover);
}

/* An icon after a button's text, such as the arrow of the next-step buttons (ArrowIcon). */
.button__icon {
  flex-shrink: 0;
  margin-inline-start: var(--space-4);
}

/* The reconnection notice (Components/Layout/ReconnectNotice.razor). blazor.web.js sets one of the
   components-reconnect-* classes on it; without one it stays hidden. */
.reconnect-notice {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-7);
  background: var(--color-overlay);
}

.reconnect-notice.components-reconnect-show,
.reconnect-notice.components-reconnect-failed,
.reconnect-notice.components-reconnect-rejected {
  display: flex;
}

.reconnect-notice__dialog {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 28rem;
  padding: var(--space-9);
  background: var(--color-white);
  border-radius: var(--radius);
}

.reconnect-notice__dialog p {
  margin: 0;
}

.reconnect-notice__show,
.reconnect-notice__failed,
.reconnect-notice__rejected,
.reconnect-notice__reload {
  display: none;
}

.components-reconnect-show .reconnect-notice__show,
.components-reconnect-failed .reconnect-notice__failed,
.components-reconnect-failed .reconnect-notice__reload,
.components-reconnect-rejected .reconnect-notice__rejected,
.components-reconnect-rejected .reconnect-notice__reload {
  display: block;
}
