.full {
  width: 100%;
}

/* filled buttons */

a.filled {
  display: inline-block;
  text-decoration: none;
}

a.filled,
button.filled {
  background: hsl(var(--primary-background-main));
  border: none;
  border-radius: 0.5rem;
  color: hsl(var(--primary-background-contrast));
  cursor: pointer;
  padding: 0.5rem 2rem;
  transition: 225ms background;
}

a.filled.secondary,
button.filled.secondary {
  background: var(--background-500);
  color: hsl(var(--foreground));
}

a.filled.error,
button.filled.error {
  background: hsl(var(--error-background-main));
  color: hsl(var(--error-background-contrast));
}

a.filled:disabled,
button.filled:disabled {
  background: var(--background-500);
  color: hsl(var(--foreground) / 50%);
  cursor: not-allowed;
}

a.filled > svg,
button.filled > svg {
  margin-right: 1ch;
}

/* anchors */

a.link {
  background: none;
  border: none;
  color: hsl(var(--primary-main));
  font-size: 1rem;
  padding: 0;
  text-decoration: none;
}

a.link svg {
  margin-right: 1ch;
}

/* text buttons */

a.text,
button.text {
  background: none;
  border: none;
  border-radius: 0.5rem;
  color: hsl(var(--primary-main));
  cursor: pointer;
  padding: 0.5rem 2rem;
  transition: 225ms background;
}

a.text {
  padding: 0;
  text-decoration: none;
}

button.text:disabled {
  color: hsl(var(--foreground) / 50%);
  cursor: not-allowed;
}

/* round buttons */

a.round-button,
button.round-button {
  align-items: center;
  background: none;
  border: none;
  border-radius: 100%;
  color: hsl(var(--foreground) / 85%);
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  padding: 1rem;
  text-align: center;
  transition: 225ms;
  transition-property: background;
}

a.round-button.small,
button.round-button.small {
  padding: 0.7rem;
}

a.round-button svg,
button.round-button svg {
  height: 1rem !important;
  width: 1rem !important;
}

/* outlined inputs */

input.outlined {
  background: var(--background-100);
  border: thin solid var(--background-500);
  border-radius: 0.5rem;
  color: hsl(var(--foreground));
  margin: 0;
  padding: 1rem;
}

input.outlined:disabled {
  color: hsl(var(--foreground) / 75%);
  cursor: not-allowed;
}

input.outlined:focus {
  background: var(--background-300);
}

input.outlined[type="text"] + .helper-text {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* labeled inputs */

label > input.full.outlined:not([type="checkbox"]),
label > input.full.outlined:not([type="radio"]) {
  margin-top: 0.5rem;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* checkbox inputs */

input[type="checkbox"] {
  appearance: none;
  background: var(--background-100);
  border: thin solid var(--background-500);
  border-radius: 0.5rem;
  color: currentColor;
  cursor: pointer;
  display: grid;
  font: inherit;
  height: 1.15em;
  margin: 0 1rem 0 0;
  place-content: center;
  width: 1.15em;
}

input[type="checkbox"]::before {
  box-shadow: inset 1em 1em hsl(0deg 0% 90%);
  border-radius: 0.25rem;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  content: "";
  height: 0.95em;
  transform: scale(0);
  transform-origin: bottom left;
  width: 0.95em;
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* radio inputs */

input[type="radio"] {
  appearance: none;
  background-color: var(--background-50);
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.15em;
  height: 1.15em;
  border: 0.15rem solid hsl(var(--secondary-main) / 50%);
  border-radius: 50%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

input[type="radio"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  border-radius: 50%;
  transform: scale(0);
  transition: 225ms transform ease-in-out;
  box-shadow: inset 1em 1em hsl(var(--primary-main));
}

input[type="radio"]:checked::before {
  transform: scale(1);
}

/* time inputs */

input[type="time"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-text {
  margin: 0;
  padding: 0;
}

input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  color-scheme: var(--color-scheme);
}

/* banner */

.banner {
  align-items: center;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 1rem 1.25rem;
}

@media (max-device-width: 800px) {
  .banner {
    margin: 1rem;
  }
}

.banner.info {
  background: hsl(var(--primary-background-main) / 25%);
  border: thin solid hsl(var(--primary-background-light));
}

.banner.error {
  background: hsl(var(--error-background-main) / 25%);
  border: thin solid hsl(var(--error-background-light));
}

.banner .contents {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.5rem;
}

.banner .title {
  font-weight: 600;
}

.banner p {
  color: hsl(var(--secondary-light));
}

.banner button {
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-block;
  margin: 0;
  padding: 0.5rem 1rem;
  transition: 225ms background;
  width: auto;
}

.banner.info button {
  background: hsl(var(--primary-background-main) / 15%);
  border: thin solid hsl(var(--primary-background-light) / 50%);
  color: hsl(var(--primary-background-contrast));
}

.banner.error button {
  background: hsl(var(--error-background-main) / 15%);
  border: thin solid hsl(var(--error-background-light) / 50%);
  color: hsl(var(--error-background-contrast));
}

@media (hover: hover) {
  a.link:hover {
    background: none;
    color: hsl(var(--primary-light));
  }

  a.filled:not(:disabled):hover,
  button.filled:not(:disabled):hover {
    background: hsl(var(--primary-background-light));
  }

  a.text:not(:disabled):hover,
  button.text:not(:disabled):hover {
    background: none;
    color: hsl(var(--primary-light));
  }

  a.filled.secondary:hover,
  button.filled.secondary:hover {
    background: var(--background-600);
    color: hsl(var(--foreground));
  }

  a.filled.error:hover,
  button.filled.error:hover {
    background: hsl(var(--error-background-light));
  }

  button.round-button:hover {
    background: hsl(var(--foreground) / 10%) !important;
  }

  input.outlined:hover {
    background: var(--background-200);
  }

  .banner.info button:hover {
    background: hsl(var(--primary-background-main) / 35%);
  }

  .banner.error button:hover {
    background: hsl(var(--error-background-main) / 35%);
  }
}
