:root {
  --bg-page: #f6f7f9;
  --bg-card: #ffffff;
  --text-main: #1d1d1d;
  --text-muted: #7b7f93;
  --label: #454a54;
  --placeholder: #9598ab;
  --border: #e4e5e7;
  --input-bg: #f3f4f6;
  --focus: #1aa9f5;
  --error: #fb0a0a;
  --primary: #ffc300;
  --primary-hover: #ffcf33;
  --primary-pressed: #fab400;
  --primary-disabled: #f7e7bd;
  --secondary: #ecedee;
  --secondary-hover: #f3f4f6;
  --secondary-pressed: #e4e5e7;
  --secondary-disabled: #f3f4f6;
}

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

body {
  margin: 0;
  font-family: Inter, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, #fff4cc 0%, var(--bg-page) 45%);
  color: var(--text-main);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.form-card {
  width: min(740px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 24px;
  display: grid;
  gap: 24px;
}

.form-card__header {
  display: grid;
  gap: 6px;
}

.form-card__header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.form-card__header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 20px;
}

.form-card__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field label,
.field legend {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  color: var(--label);
}

.field input[type="text"]:not(.multiselect__search-input),
.field input[type="email"],
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-main);
  outline: none;
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field input[type="text"]:not(.multiselect__search-input)::placeholder,
.field input[type="email"]::placeholder,
.field textarea::placeholder {
  color: var(--placeholder);
  font-style: italic;
}

.field--select {
  width: 100%;
}

.selectbox {
  position: relative;
  width: 100%;
}

.selectbox__trigger {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  border: 1px solid #e4e5e7;
  border-radius: 6px;
  background: #f3f4f6;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1d1d1d;
  cursor: pointer;
  text-align: left;
}

.selectbox__trigger:focus {
  outline: none;
}

.selectbox__value {
  flex: 1;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #1d1d1d;
}

.selectbox__value--placeholder {
  color: #9598ab;
  font-style: italic;
}

.selectbox__chevron {
  width: 16px;
  height: 16px;
  position: relative;
  flex: none;
}

.selectbox__chevron::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-right: 1.33px solid #1d1d1d;
  border-bottom: 1.33px solid #1d1d1d;
  transform: rotate(45deg);
}

.selectbox__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e4e5e7;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  z-index: 20;
}

.selectbox__group {
  display: flex;
  flex-direction: column;
  padding: 4px;
  max-height: 224px;
  overflow-y: auto;
}

.selectbox__item {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding: 6px 8px 6px 32px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #1d1d1d;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.selectbox__item:focus {
  outline: none;
}

.selectbox__item:hover,
.selectbox__item:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.selectbox__item--label {
  font-weight: 600;
  cursor: default;
}

.selectbox__item--selected::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 9px;
  width: 8px;
  height: 5px;
  border-left: 1.33px solid #1d1d1d;
  border-bottom: 1.33px solid #1d1d1d;
  transform: rotate(-45deg);
}

.selectbox__footer {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.selectbox__footer[hidden] {
  display: none;
}

.selectbox__footer-chevron {
  width: 16px;
  height: 16px;
  position: relative;
}

.selectbox__footer-chevron::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-right: 1.33px solid #1d1d1d;
  border-bottom: 1.33px solid #1d1d1d;
  transform: rotate(45deg);
}

.selectbox__footer-chevron--up::before {
  transform: rotate(-135deg);
}

.field--multiselect {
  width: 100%;
}

.field--multiselect-used {
  height: 40px;
  gap: 0;
  min-width: 0;
}

.field--multiselect-used > label,
.field--multiselect-used > .hint {
  display: none;
}

.multiselect {
  position: relative;
  width: 100%;
  min-width: 0;
}

.multiselect__trigger {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #e4e5e7;
  border-radius: 6px;
  background: #f3f4f6;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.multiselect__trigger:focus {
  outline: none;
}

.multiselect__value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #1d1d1d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multiselect__value--placeholder {
  color: #9598ab;
  font-style: italic;
  font-weight: 400;
}

.multiselect__chevrons {
  width: 16px;
  height: 16px;
  position: relative;
  flex: none;
}

.multiselect__chevrons::before,
.multiselect__chevrons::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 6px;
  height: 6px;
  border-right: 1.33px solid #1d1d1d;
  border-bottom: 1.33px solid #1d1d1d;
}

.multiselect__chevrons::before {
  top: 2px;
  transform: rotate(-135deg);
}

.multiselect__chevrons::after {
  bottom: 2px;
  transform: rotate(45deg);
}

.multiselect__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  height: 212px;
  background: #fff;
  border: 1px solid #e4e5e7;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  z-index: 25;
}

.multiselect__search {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  border-bottom: 1px solid #e4e5e7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.multiselect__search-icon {
  width: 16px;
  height: 16px;
  border: 1.33px solid #b6b9ca;
  border-radius: 999px;
  position: relative;
}

.multiselect__search-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.33px;
  background: #b6b9ca;
  right: -3px;
  bottom: 0;
  transform: rotate(45deg);
}

.multiselect__search input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  color: #1d1d1d;
}

.multiselect__search input::placeholder {
  color: #9598ab;
  font-style: italic;
}

.multiselect__search input:focus {
  outline: none;
}

.multiselect__group {
  width: 100%;
  height: 168px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.multiselect__item {
  -webkit-appearance: none;
  appearance: none;
  width: calc(100% - 8px);
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 2px;
  padding: 6px 8px;
  gap: 8px;
  margin: 0 4px;
  display: flex;
  align-items: center;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #1d1d1d;
  cursor: pointer;
}

.multiselect__item:hover,
.multiselect__item:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.multiselect__item--selected {
  font-weight: 600;
}

.multiselect__check {
  width: 16px;
  height: 16px;
  position: relative;
  opacity: 0;
  flex: none;
}

.multiselect__check::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 8px;
  height: 5px;
  border-left: 1.33px solid #1d1d1d;
  border-bottom: 1.33px solid #1d1d1d;
  transform: rotate(-45deg);
}

.multiselect__item-value {
  width: auto;
  flex: 1;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #1d1d1d;
}

.multiselect__item-value mark {
  background: #ffc300;
  color: #1d1d1d;
  padding: 0 1px;
  border-radius: 2px;
}

.multiselect__item--selected .multiselect__check {
  opacity: 1;
}

.field--focused .multiselect__trigger {
  box-shadow: 0 0 0 2px var(--focus);
}

.field--focused input:not(.multiselect__search-input),
.field--focused textarea,
.field--focused .selectbox__trigger {
  box-shadow: 0 0 0 2px var(--focus);
}

.field--error input:not(.multiselect__search-input),
.field--error textarea,
.field--error .selectbox__trigger,
.field--error .checkbox__box {
  box-shadow: 0 0 0 2px var(--error);
}

.field--disabled input,
.field--disabled textarea {
  color: #b4b3b3;
  cursor: not-allowed;
}

.hint,
.error {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

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

.error {
  display: none;
  color: var(--error);
}

.field--error .error {
  display: block;
}

.field--error .hint {
  display: none;
}

.field--radio {
  border: 0;
  margin: 0;
  padding: 0;
}

.field--radio legend {
  margin-bottom: 8px;
}

.radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
  position: relative;
}

.radio input {
  position: absolute;
  opacity: 0;
}

.radio__control {
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid #b6b9ca;
  border-radius: 9999px;
  flex: none;
  margin-top: 1px;
}

.radio__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  min-height: 40px;
}

.radio__text strong {
  display: flex;
  align-items: center;
  font-size: 14px;
  line-height: 100%;
  font-weight: 500;
  color: #1d1d1d;
}

.radio__text small {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #454a54;
}

.radio input:checked + .radio__control {
  border: 5px solid #ffc300;
}

.radio input:checked + .radio__control + .radio__text strong {
  font-weight: 700;
}

.radio input:focus-visible + .radio__control {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__track {
  width: 44px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  background: var(--input-bg);
  display: flex;
  transition: background-color 140ms ease;
}

.switch__thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: transform 140ms ease;
}

.switch input:checked + .switch__track {
  background: var(--primary);
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(20px);
}

.switch__text {
  display: grid;
  gap: 6px;
}

.switch__text strong {
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
}

.switch__text small {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 20px;
}

.checkbox {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 8px;
  row-gap: 8px;
  align-items: start;
  cursor: pointer;
}

.checkbox input {
  position: absolute;
  opacity: 0;
}

.checkbox__box {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid #b6b9ca;
  background: #fff;
  margin-top: 2px;
}

.checkbox__text {
  display: grid;
  gap: 6px;
}

.checkbox__text strong {
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
}

.checkbox__text small {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 20px;
}

.checkbox input:checked + .checkbox__box {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:checked + .checkbox__box::after {
  content: "";
  display: block;
  width: 8px;
  height: 5px;
  margin: 4px 0 0 3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.checkbox .error {
  grid-column: 2;
}

.form-card__footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.component-showcase {
  grid-column: 1 / -1;
  display: grid;
  gap: 24px;
  padding-top: 8px;
  border-top: 1px solid #eceef2;
}

.component-showcase__header {
  display: grid;
  gap: 6px;
}

.component-showcase__header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

.component-showcase__header p {
  margin: 0;
  color: #7b7f93;
  font-size: 14px;
  line-height: 20px;
}

.inline-message {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 393px;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 6px;
  align-self: stretch;
  flex: none;
  z-index: 3;
}

.inline-message__container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
}

.inline-message__icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #fb0a0a;
  color: #fb0a0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  flex: none;
}

.inline-message__headline {
  margin: 0;
  width: 100%;
  max-width: 325px;
  min-height: 40px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: #1d1d1d;
}

.inline-message--error {
  background: #ffe6e6;
  border-bottom: 2px solid #fb0a0a;
}

.toast-stack {
  display: grid;
  gap: 16px;
}

.toast {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 92px;
  padding: 24px 32px 24px 24px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  position: relative;
}

.toast--info { border: 1px solid #1aa9f5; }
.toast--success { border: 1px solid #64c315; }
.toast--warning { border: 1px solid #ff8800; }
.toast--error { border: 1px solid #fb0a0a; }
.toast--loading { border: 1px solid #1d1d1d; }

.toast__close {
  position: absolute;
  right: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 4px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  opacity: 0.5;
  color: #1d1d1d;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

.toast__close::before,
.toast__close::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 1.33px;
  background: #1d1d1d;
}

.toast__close::before {
  transform: rotate(45deg);
}

.toast__close::after {
  transform: rotate(-45deg);
}

.toast__close:hover {
  opacity: 1;
}

.toast__icon {
  width: 16px;
  height: 16px;
  flex: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.toast__icon--info {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='6.666' stroke='%231AA9F5' stroke-width='1.333'/%3E%3Cpath d='M8 6.1V10.2' stroke='%231AA9F5' stroke-width='1.333' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='4.35' r='0.9' fill='%231AA9F5'/%3E%3C/svg%3E");
}

.toast__icon--success {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='6.666' stroke='%2364C315' stroke-width='1.333'/%3E%3Cpath d='M4.8 8.2L7.2 10.4L11.4 5.9' stroke='%2364C315' stroke-width='1.333' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.toast__icon--warning {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='6.666' stroke='%23FF8800' stroke-width='1.333'/%3E%3Cpath d='M8 4.9V8.8' stroke='%23FF8800' stroke-width='1.333' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.15' r='0.9' fill='%23FF8800'/%3E%3C/svg%3E");
}

.toast__icon--error {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M8 2.3L14.1 12.9H1.9L8 2.3Z' stroke='%23FB0A0A' stroke-width='1.333' stroke-linejoin='round'/%3E%3Cpath d='M8 6.2V9.4' stroke='%23FB0A0A' stroke-width='1.333' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.1' r='0.85' fill='%23FB0A0A'/%3E%3C/svg%3E");
}

.toast__icon--loading {
  border: 1.33px solid #1d1d1d;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

.toast__text {
  display: grid;
  gap: 4px;
  flex: 1;
}

.toast__text strong {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: #1d1d1d;
}

.toast__text span {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #1d1d1d;
  opacity: 0.9;
}

.tooltip-demo {
  width: fit-content;
  position: relative;
}

.tooltip-anchor {
  height: 36px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #1d1d1d;
  background: #fff;
  font: 500 14px/20px Inter, "Segoe UI", sans-serif;
  cursor: pointer;
}

.tooltip-box {
  box-sizing: border-box;
  display: none;
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
  align-items: center;
  width: 125px;
  height: 32px;
  padding: 6px 12px;
  background: #1d1d1d;
  border: 1px solid #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.tooltip-demo:hover .tooltip-box,
.tooltip-demo:focus-within .tooltip-box {
  display: flex;
}

.table-demo {
  display: flex;
  width: 100%;
  border-top: 1px solid #e4e5e7;
}

.table-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 110px;
}

.table-head {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid #e4e5e7;
  display: flex;
  align-items: center;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #7b7f93;
}

.table-cell {
  min-height: 52px;
  padding: 16px;
  border-bottom: 0.5px solid #e4e5e7;
  display: flex;
  align-items: center;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #1d1d1d;
}

.table-cell--strong {
  font-weight: 500;
}

.table-col--right .table-head,
.table-col--right .table-cell {
  justify-content: flex-end;
  text-align: right;
}

.btn {
  position: relative;
  border: 0;
  border-radius: 6px;
  height: 40px;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn--primary {
  background: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--primary:active {
  background: var(--primary-pressed);
}

.btn--secondary {
  background: var(--secondary);
}

.btn--secondary:hover {
  background: var(--secondary-hover);
}

.btn--secondary:active {
  background: var(--secondary-pressed);
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
}

.btn--primary[disabled] {
  background: var(--primary-disabled);
}

.btn--secondary[disabled] {
  background: var(--secondary-disabled);
}

.btn__loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 1.33px solid var(--text-main);
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

.btn--loading .btn__label {
  display: none;
}

.btn--loading .btn__loader {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 820px) {
  .form-card__content {
    grid-template-columns: 1fr;
  }

  .form-card__footer {
    flex-direction: column-reverse;
  }

  .form-card__footer .btn {
    width: 100%;
  }
}
