@font-face {
  font-family: 'ProximaNovaLight';
  src: font-url('proximanova-light.otf');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'ProximaNovaRegular';
  src: font-url('proximanova-regular.otf');
  font-weight: 500;
  font-style: normal;
}

// Accordion dark mode — Bootstrap 5.2 sets --bs-accordion-* directly on .accordion
@mixin dark-accordion {
  --bs-accordion-active-bg: var(--secondary-bg);
  --bs-accordion-active-color: var(--text-default);
  --bs-accordion-bg: var(--primary-bg);
  --bs-accordion-border-color: var(--border-color);
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23d1d1d1'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-color: var(--text-default);
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23d1d1d1'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-color: var(--text-default);
}

body:not(.unauthenticated) {
  background-color: var(--primary-bg);
  display: grid;
  font-family: 'ProximaNovaLight', 'system-ui';
  min-height: 100vh;
  text-wrap: pretty;
  overflow-x: clip;
  overscroll-behavior: none;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.2s ease-in-out;

  &:focus-visible {
    box-shadow: $focus-shadow;
    outline: none !important;
  }

  &:hover {
    color: var(--text-link-hover);
  }
}

.actions {
  text-transform: capitalize;
  white-space: nowrap;
  font-size: 0.9rem;
}

.alert-danger {
  background-color: $red-100 !important;
  border: 1px solid $red-200;
  color: $red-600;
}

.alert-success {
  background-color: $green-100 !important;
  border: 1px solid $green-200;
  color: $green-800;
}

.alert-warning {
  background-color: $yellow-100 !important;
  border: 1px solid $yellow-300;
  color: $yellow-800;
}

b,
.form-label,
.inline-editable input[type='text'],
strong,
th {
  font-family: 'ProximaNovaRegular', 'system-ui';
}

.badge {
  font-size: 0.8rem;
}

.badge-outline-danger {
  border: 1px solid $red;
  color: $red;
}

.badge-outline-info {
  border: 1px solid var(--badge-info-color);
  color: var(--badge-info-color);
}

.badge-outline-lavender {
  border: 1px solid var(--badge-lavender-color);
  color: var(--badge-lavender-color);
}

.bg-info {
  background-color: $green-100 !important;
  color: $green-900;

  .content-textile {
    background-color: transparent;
  }
}

.bg-lavender {
  background-color: $lavender-light;
  color: darken($lavender-dark, 40%);
}

.bg-primary {
  background-color: $primary !important;
  color: $white;
}

.bg-success {
  color: $green-800;
}

.bg-warning {
  color: $yellow-800;
}

blockquote {
  border-left: 3px solid $primary;
  padding-left: 1rem;
}

.btn:focus,
.custom-file-input:focus ~ .custom-file-label {
  border-color: $dark;
  box-shadow: $focus-shadow;
  outline: none !important;
}

code {
  background-color: $brand-100;
  color: $primary;
  border-radius: $border-radius;
  padding: 0.15rem 0.5rem;
}

[data-theme='dark'] .accordion {
  @include dark-accordion;
}

.empty-state {
  &-actions {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-top: 3rem;
  }

  &-body-text {
    text-align: center;
  }

  &-docs-link {
    font-size: 0.8rem;
  }

  &-icon {
    border-radius: 50%;
    margin: 0 auto;
    width: max-content;

    img {
      height: auto;
      width: 11.5rem;
    }
  }

  &-title {
    margin: 3rem 0;
    text-align: center;
  }
}

fieldset.check_boxes {
  .form-check {
    margin-bottom: 0.5rem;
  }
}

.form-actions.sticky {
  background-color: var(--primary-bg);
  border-top: 1px solid var(--border-color);
  bottom: 0;
  padding: 1rem 0;
  position: sticky;
  width: 100%;

  @media (max-width: 991px) {
    margin-top: 2rem;
  }
}

.form-check-input {
  background-color: var(--primary-bg);
  border-color: var(--border-color);

  &:checked {
    background-color: $primary;
    border-color: $primary;
  }
}

.form-switch .form-check-input {
  background-image: var(--form-switch-bg);
}

.form-control,
.form-select {
  background-color: var(--primary-bg);
  border-color: var(--border-color);
  color: var(--text-default);

  &:disabled,
  &[readonly] {
    background-color: var(--secondary-bg-strong);
    color: var(--text-muted);
  }
}

.form-control {
  font-size: inherit;

  &:focus {
    background-color: var(--primary-bg);
    border-color: var(--border-color);
    box-shadow: $focus-shadow;
    color: var(--text-default);
  }
}

.form-select {
  background-image: var(--form-select-caret);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'ProximaNovaRegular', 'system-ui';

  & * {
    font-family: 'ProximaNovaLight', 'system-ui';
  }
}

.input-group-text {
  background-color: var(--secondary-bg);
  border-color: var(--border-color);
  color: var(--text-default);
}

mark {
  background-color: $yellow;
  padding-left: 0;
  padding-right: 0;
}

.nav-pills {
  .nav-item {
    margin-right: 0.5rem;

    &:last-child {
      margin-right: 0;
    }
  }

  .nav-link {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-link);
    transition: all 0s ease-in-out;

    &.active {
      background-color: $brand-200;
      border: 1px solid var(--border-color);
      color: $brand-700;
    }
  }
}

.nav-tabs {
  border-color: var(--border-color);
}

.nav-tabs + .tab-content {
  .card {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

.no-caret {
  &.dropdown-toggle::after {
    display: none;
  }
}

.popover-footer {
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

p:last-child {
  margin-bottom: 0;
}

pre {
  background-color: var(--secondary-bg);
  border: solid 2px var(--border-color-dark);
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;

  code {
    background: initial;
    color: var(--pre-code-color);
    padding: 0;
  }
}

.required-input {
  color: $red;
}

::selection,
::-moz-selection {
  background: $light;
  color: var(--text-default);
}

.table {
  --bs-table-striped-bg: var(--table-stripe-bg);
}

.text-break-spaces {
  white-space: break-spaces !important;
}

.text-danger,
.text-error {
  color: var(--text-error) !important;
}

.text-error-hover {
  color: var(--text-error) !important;

  &:hover {
    color: var(--text-error-hover) !important;
  }
}

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

.text-primary {
  color: $primary !important;
}

.text-success {
  color: var(--text-success) !important;
}
.text-warning {
  color: var(--text-warning) !important;
}

ul {
  list-style: none;
}

@media (min-width: 1200px) {
  h1,
  .h1 {
    font-size: 2rem;
  }

  h2,
  .h2 {
    font-size: 1.5rem;
  }

  h3,
  .h3 {
    font-size: 1.3rem;
  }

  h4,
  .h4 {
    font-size: 1.2rem;
  }

  h5,
  .h5 {
    font-size: 1.1rem;
  }

  h6,
  .h6 {
    font-size: 1rem;
  }
}

@media (max-width: 1199px) {
  h1,
  .h1 {
    font-size: 1.75rem;
  }

  h2,
  .h2 {
    font-size: 1.3rem;
  }

  h3,
  .h3 {
    font-size: 1.125rem;
  }

  h4,
  .h4 {
    font-size: 1.1rem;
  }

  h5,
  .h5 {
    font-size: 1.05rem;
  }

  h6,
  .h6 {
    font-size: 1rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .accordion {
    @include dark-accordion;
  }
}
