:root {
  --brand: #3182ce;
  --brand-dark: #2b6cb0;
  --brand-dark2: #245a94;
  --brand-darker: #2a4365;
  --brand-light: #63b3ed;
  --brand-lighter: #bee3f8;
  --brand-opacity: rgba(49, 130, 206, 0.2);
  --brand-disabled: #e2e8f0;

  --danger: #f56565;
  --danger-light: #fc8181;
  --danger-lighter: #fed7d7;
  --danger-toast: #fecaca;

  --success: #48bb78;
  --success-light: #81e6d9;
  --success-lighter: #c6f6d5;
  --success-toast: #d1fae5;

  --info-toast: #dbeafe;

  --text-primary: #2d3748;
  --text-secondary: #555555;
  --text-tertiary: #777777;
  --text-contrast: #ffffff;

  --background: #f4f7fe;
  --background-input: rgba(0, 0, 0, 0);
  --background-button-supporting: rgba(0, 0, 0, 0.08);

  --border-default: #dddddd;
  --border-2: #eeeeee;
  --border-3: #aaaaaa;
  --border-4: #dfdfdf;

  --surface-1: #ffffff;
  --surface-2: #edf0f3;
  --surface-3: #f8f8f8;
  --surface-4: #f0f0f0;

  --shadow-surface-1: rgba(0, 0, 0, 0.1);
  --shadow-surface-2: rgba(0, 0, 0, 0.2);

  --ai-gradient: #e2f4ec, #fcefff, #fff7df;
}

:root.dark {
  --brand: #63b3ed;
  --brand-dark: #3182ce;
  --brand-dark2: #9acdf4;
  --brand-darker: #2b6cb0;
  --brand-light: #90cdf4;
  --brand-lighter: #bee3f8;
  --brand-opacity: rgba(99, 179, 237, 0.2);
  --brand-disabled: #4a5568;

  --danger: #fc8181;
  --danger-light: #fc8181;
  --danger-lighter: #feb2b2;
  --danger-toast: #7f1d1d;

  --success: #68d391;
  --success-light: #48bb78;
  --success-lighter: #68d391;
  --success-toast: #14532d;

  --info-toast: #1e40af;

  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-tertiary: #808080;
  --text-contrast: #2d3748;

  --background: #121212;
  --background-input: #333333;
  --background-button-supporting: rgba(255, 255, 255, 0.15);

  --border-default: #555555;
  --border-2: #000000;
  --border-3: #222222;
  --border-4: #3a3a3a;

  --surface-1: #1e1e1e;
  --surface-2: #2a2d31;
  --surface-3: #262626;
  --surface-4: #323232;

  --shadow-surface-1: rgba(0, 0, 0, 0.5);
  --shadow-surface-2: rgba(0, 0, 0, 1);

  --ai-gradient: #2d3a34, #3a2f3d, #3f3b2d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background-color: var(--background);
}

.link {
  text-decoration: none;
  color: var(--text-tertiary);
}

.link:hover {
  text-decoration: underline;
}

button {
  display: flex;
  flex-direction: row;
  height: 40px;
  border-radius: 8px;
  font-size: 16px;
  gap: 8px;
  padding: 12px;
  border: none;
  outline: none;
  cursor: pointer;
  align-items: center;
  align-content: center;
  justify-content: center;
  color: var(--text-contrast);
  background-color: var(--brand-dark2);
}

button:hover {
  background-color: var(--brand-dark);
}

button:disabled {
  background-color: var(--brand-disabled);
  cursor: not-allowed;
}

button.secondary {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  align-items: center;
  background-color: var(--brand-light);
}

button.round-icon {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 20px;
  color: var(--text-primary);
  background: var(--surface-2);
}

button.round-icon.small {
  width: 32px;
  height: 32px;
  padding: 6px;
  border-radius: 16px;
  color: var(--text-primary);
  background: var(--surface-2);
}

button.round-icon.success {
  background: var(--success-light);
}

button.round-icon.danger {
  background: var(--danger-light);
}

button.round-icon:hover {
  background: var(--shadow-surface-1);
}

button.round-icon-text {
  height: 40px;
  padding: 8px;
  border-radius: 20px;
  color: var(--text-primary);
  background: var(--surface-2);
}

button.round-icon-text.small {
  height: 32px;
  gap: 4px;
  padding: 6px 12px 6px 10px;
  font-size: 12px;
  border-radius: 16px;
  color: var(--text-primary);
  background: var(--surface-2);
}

button.round-icon-text.success {
  background: var(--success-light);
}

button.round-icon-text.danger {
  background: var(--danger-light);
}

button.round-icon-text:hover {
  background: var(--shadow-surface-1);
}

button.icon {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-primary);
  background-color: transparent;
}

button.icon:hover {
  transform: scale(1.1);
}

button.secondary {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
}

button.secondary:hover {
  box-shadow: 0 0 6px var(--shadow-surface-1);
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-container.ai input {
  display: none;
}

.input-container.ai {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 8px;
  padding-left: 12px;
  border-radius: 10px;
  border: 1px solid #00000010;
  background: linear-gradient(135deg, var(--ai-gradient));
  transition: box-shadow 0.3s ease;
}

.input-container.ai:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.input-container.ai label {
  flex: 1;
  display: flex;
  flex-direction: row;
  font-size: 16px;
  font-weight: lighter;
  align-items: center;
  gap: 10px;
}

.input-container.ai button {
  height: 36px;
  padding: 0px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  border: 0px;
  background-color: var(--background-button-supporting);
}

.horizontal {
  flex-direction: row;
  justify-content: space-between;
}

.horizontal.compact {
  flex-direction: row;
  justify-content: flex-start;
}

.input-container label {
  font-size: 14px;
  font-weight: 600;
  display: block;
  user-select: none;
}

.input-container input,
select {
  width: 100;
  height: 48px;
  padding: 12px;
  border-radius: 8px;
  color: var(--text-primary);
  background-color: var(--background-input);
  border: 1px solid var(--border-default);
  font-size: 16px;
  outline: none;
}

select.secondary {
  height: 36px;
  padding: 8px 8px;
  font-size: 14px;
  background-color: var(--surface-1);
}

input.secondary {
  height: 36px;
  padding: 8px 12px;
  font-size: 14px;
  background-color: var(--surface-1);
}

.input-container input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-opacity);
}

.input-container input:disabled,
select:disabled {
  background-color: var(--surface-2);
}

.radio-group {
  height: 48px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-2);
}

.radio-group.compact {
  height: 36px;
}

.radio-group input {
  display: none;
}

.radio-group label {
  font-weight: normal;
}

.radio-group.flex label {
  flex: 1;
}

.radio-group input + span {
  width: 100%;
  text-align: center;
  display: inline-block;
  height: 40px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  align-content: center;
  color: var(--text-primary);
  user-select: none;
}

.radio-group.compact input + span {
  height: 28px;
}

.radio-group input:checked + span {
  background-color: var(--surface-1);
  box-shadow: 0 0 3px var(--shadow-surface-1);
}

/** Layouts */

.multi-columns {
  display: flex;
  gap: 16px;
}

.multi-columns .column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/** Icons */

.icon-smaller {
  width: 14px;
  height: 14px;
}

.icon-small {
  width: 16px;
  height: 16px;
}

.icon-sm {
  width: 20px;
  height: 20px;
}

.icon-medium {
  width: 24px;
  height: 24px;
}

/** Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: flex;
  opacity: 0;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 400px;
  gap: 24px;
  margin: 24px;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 0 10px var(--shadow-surface-1);
  background-color: var(--surface-1);
}

.modal-content h2 {
  margin-top: 8px;
  margin-bottom: 16px;
}

.modal-content p {
  font-weight: 200;
}

.modal-content .close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.toast {
  position: absolute;
  bottom: 24px;
  background-color: var(--brand-lighter);
  z-index: 200;
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 12px;
  color: var(--text-primary);
  box-shadow: 0 0 24px var(--shadow-surface-2);
  background-color: var(--info-toast);
}

.toast.success {
  background-color: var(--success-toast);
}

.toast.danger {
  background-color: var(--danger-toast);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.toast.hide {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast button {
  height: 36px;
  padding: 0px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--background-button-supporting);
}

/** Helpers */
.flex {
  flex: 1;
}
