/* Defaults
   ========================================================================== */

:root {
  --border-color-dark: #b4b4b5;
  --border-color-light: #eeeeee;
  --border-radius: 0.25rem;
  --border-width: 0.0625rem;

  --color-primary: #1f69c7;
  --color-primary-hover: #1551a0;
  --color-error: #ff3333;

  --font-size-s: 0.875rem;
  --font-size-m: 1rem;
  --font-size-l: 1.25rem;
  --font-size-xl: 2rem;

  --gap-s: 0.5rem;
  --gap-m: 1rem;
  --gap-l: 1.5rem;
  --gap-xl: 2rem;
}

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

body {
  font-family: system-ui;
  margin: 0;
}

/* Typography
   ========================================================================== */

.h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: 1.125;
  margin: 0;
}
.h1--center {
  text-align: center;
}

.h2 {
  font-size: var(--font-size-l);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}
.h2--center {
  text-align: center;
}

.p {
  margin: 0;
}

.note {
  color: #747476;
  font-size: var(--font-size-s);
  margin: 0;
}
.note--error {
  color: var(--color-error);
}

/* Icon
   ========================================================================== */

.icon {
  height: 1.5rem;
  width: 1.5rem;
}
.icon--big {
  height: 10rem;
  width: 10rem;
}

/* Just for owl image on the main page */
.owl {
  max-height: 40rem;
  max-width: 40rem;
}

/* Link
   ========================================================================== */

.link {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  text-decoration: none;
}
.link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Button
   ========================================================================== */

.button {
  background-color: #f8f8f8;
  border: var(--border-width) solid var(--border-color-dark);
  border-radius: var(--border-radius);
  color: #000000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-s);
  font-size: var(--font-size-m);
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}
.button:hover {
  background-color: #e2e2e2;
}
.button:active {
  scale: 0.98;
}
.button--ghost {
  background-color: transparent;
  border: var(--border-width) solid transparent;
}
.button--primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}
.button--primary:hover {
  background-color: var(--color-primary-hover);
}
.button--danger {
  background-color: #ff627d;
  border-color: #ff627d;
}
.button--danger:hover {
  background-color: #eb5971;
}

/* Loader
   ========================================================================== */

.loader {
  animation:
    rotation 1s linear infinite,
    appear 0.3s forwards;
  border: 0.3125rem solid #000000;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  height: 3rem;
  width: 3rem;
  opacity: 0;
}
@keyframes appear {
  to {
    opacity: 1;
  }
}
@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.loader--big {
  height: 10rem;
  width: 10rem;
}

/* Input
   ========================================================================== */

.input {
  background-color: #fbfcfc;
  border: var(--border-width) solid var(--border-color-light);
  border-radius: var(--border-radius);
  font-size: var(--font-size-m);
  padding: 0.5rem 0.75rem;
  width: 100%;
  transition: background-color 0.2s ease;
}
.input:focus {
  background-color: #ffffff;
}
.input--code {
  text-transform: uppercase;
}

/* Checkbox
   ========================================================================== */
.checkbox {
  cursor: pointer;
  height: 1.5rem;
  margin: 0;
  width: 1.5rem;
}

/* Label
   ========================================================================== */

.label {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}
.label--row {
  flex-direction: row;
  align-items: center;
}
.label__text {
}
.label__text--required::after {
  color: var(--color-error);
  content: " *";
}

/* Input Group
   ========================================================================== */

.inputGroup {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  margin: 0;
}
.inputGroup--hidden {
  display: none;
}
.inputGroup__errorText {
  color: var(--color-error);
  font-size: var(--font-size-s);
}

/* Form
   ========================================================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
}
.form--tight {
}
@media (min-width: 480px) {
  .form--tight {
    gap: var(--gap-s);
  }
}
.form--narrow {
  max-width: 28rem;
}
.form__fieldset {
  border: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
  margin: 0;
  padding: 0;
}
.form__fieldset--row {
  flex-direction: column;
}
@media (min-width: 480px) {
  .form__fieldset--row {
    flex-direction: row;
  }
}
.form__errorText {
  color: var(--color-error);
  font-size: var(--font-size-s);
  margin: 0;
}
.form__submitButton {
  align-self: flex-start;
}
.form__submitButton--full {
  align-self: stretch;
}

/* Containers
   ========================================================================== */

.scrollX {
  overflow-x: auto;
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}
.section--row {
  flex-direction: row;
  align-items: center;
  gap: var(--gap-s);
}
.section--center {
  align-items: center;
}

/* Table
   ========================================================================== */

.table {
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}
.table__table {
  border-collapse: collapse;
  width: 100%;
}
.table__row {
}
.table__row--warning {
  background-color: #f5cd66;
}
.table__row.htmx-swapping {
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.table__header {
  border-bottom: var(--border-width) solid var(--border-color-dark);
  padding: 0.75rem;
  text-align: left;
}
.table__data {
  border-bottom: var(--border-width) solid var(--border-color-light);
  padding: 0.75rem;
}
.table__data--right {
  text-align: right;
}
.table__data--center {
  text-align: center;
}
.table__data--top {
  vertical-align: top;
}
.table__data--fixedWidth {
  min-width: 7rem;
  width: 10rem;
}

/* Modal
   ========================================================================== */

.modal[open] {
  border: none;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  max-width: min(90vw, 28rem);
  padding: 1.5rem;
}
.modal__text {
  margin: 0;
}

/* Details
   ========================================================================== */

.details {
}
.details__summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  list-style: none;
}
.details__text {
  display: inline-block;
  font-size: var(--font-size-s);
  margin: 0;
  margin-top: var(--gap-s);
}

/* Actions Menu
   ========================================================================== */

.actionsMenu {
  display: flex;
  gap: var(--gap-s);
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.actionsMenu--right {
  justify-content: flex-end;
}

/* Page Header
   ========================================================================== */
.pageHeader {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
}
.pageHeader--withAction {
  flex-direction: column;
  gap: var(--gap-m);
}
@media (min-width: 480px) {
  .pageHeader--withAction {
    flex-direction: row;
  }
}

/* Topbar
   ========================================================================== */

.topbar {
  background-color: #ffffff;
  border-bottom: var(--border-width) solid var(--border-color-light);
  display: flex;
  align-items: center;
  padding: 1rem;
}
.topbar__hamburgerButton {
}
@media (min-width: 1024px) {
  .topbar__hamburgerButton {
    display: none;
  }
}
.topbar__logoutButton {
  margin-left: auto;
}

/* Sidebar
   ========================================================================== */

.sidebar {
  background-color: #343a40;
  padding: 1rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
@media (min-width: 1024px) {
  .sidebar {
    box-shadow:
      0 0.875rem 1.75rem #00000040,
      0 0.625rem 0.625rem #00000038;
    transform: translateX(0);
  }
}
.sidebar--open {
  box-shadow:
    0 0.875rem 1.75rem #00000040,
    0 0.625rem 0.625rem #00000038;
  transform: translateX(0);
}
.sidebar__menu {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.sidebar__link {
  border-left: 0.25rem solid transparent;
  border-radius: var(--border-radius);
  color: #ffffff;
  display: block;
  padding: 0.75rem;
  text-decoration: none;
  width: 100%;
  transition: background-color 0.2s ease;
}
.sidebar__link:hover {
  background-color: #484e53;
}
.sidebar__link--active {
  border-left: 0.25rem solid var(--color-primary);
}

/* Overlay
   ========================================================================== */

.overlay {
  background: #00000066;
  display: none;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
}
.overlay--open {
  display: block;
}

/* Layouts
   ========================================================================== */

/* Auth */

.authLayout {
  background-color: #ffffff;
}
.authLayout__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xl);
  min-height: 100vh;
  padding: 1rem;
}
.authLayout__form {
  width: 100%;
}

/* Dashboard */

.dashboardLayout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 5rem 1fr;
  grid-template-areas:
    "topbar"
    "content";
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .dashboardLayout {
    grid-template-columns: 16rem 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar content";
  }
}
.dashboardLayout__sidebar {
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 16rem;
  z-index: 2;
}
@media (min-width: 1024px) {
  .dashboardLayout__sidebar {
    grid-area: sidebar;
    position: sticky;
    z-index: auto;
  }
}
.dashboardLayout__topbar {
  grid-area: topbar;
}
.dashboardLayout__overlay {
  z-index: 1;
}
.dashboardLayout__content {
  grid-area: content;
  background-color: #f4f6f9;
  display: flex;
  flex-direction: column;
  gap: var(--gap-xl);
  min-width: 0;
  overflow: auto;
  padding: 1rem;
}
