.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 3px;
  font: inherit;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap;
  transition:
    background-color .15s ease,
    border-color .15s ease,
    color .15s ease;
}

a.btn,
button.btn,
input[type="button"].btn,
input[type="submit"].btn,
input[type="reset"].btn {
  appearance: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-ghost {
  color: var(--ink);
  background: var(--white);
}

.btn-ghost:hover {
  background: #fdfdfd;
  border-color: rgba(0, 0, 0, .2);
}

.btn-dark {
  color: var(--on-black);
  background: #181818;
  border-color: transparent;
}

.btn-dark:hover {
  background: #282828;
}

.btn-danger {
  color: #fff;
  background: #b42318;
  border-color: transparent;
}

.btn-danger:hover {
  background: #912018;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-lg {
  height: 46px;
  padding: 0 20px;
}

.btn-icon {
  width: 40px;
  padding: 0;
}

.btn-sm.btn-icon {
  width: 32px;
}

.btn-block {
  width: 100%;
}

.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn[disabled],
.btn:disabled,
.btn.is-disabled {
  opacity: .5;
  pointer-events: none;
}

.form-group {
  margin-bottom: 18px;
}

.form-label,
.form-group > label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.form-required::after {
  margin-left: 3px;
  color: #b42318;
  content: "*";
}

.form-help,
.form-error {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}

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

.form-error {
  color: #b42318;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 3px;
  font: inherit;
  outline: none;
  transition:
    background-color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;
}

.input,
.select {
  height: 40px;
  padding: 0 12px;
}

.textarea {
  min-height: 112px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #999;
  opacity: 1;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(0, 0, 0, .22);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #181818;
  box-shadow: 0 0 0 1px #181818;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  color: var(--muted);
  background: #f7f7f7;
  cursor: not-allowed;
  opacity: .7;
}

.input[readonly],
.textarea[readonly] {
  background: #f7f7f7;
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: #b42318;
}

.input.is-invalid:focus,
.select.is-invalid:focus,
.textarea.is-invalid:focus {
  box-shadow: 0 0 0 1px #b42318;
}

.input.is-valid,
.select.is-valid,
.textarea.is-valid {
  border-color: #19733b;
}

input.input,
select.select,
textarea.textarea {
  appearance: none;
}

select.select {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

select.select[multiple] {
  height: auto;
  min-height: 112px;
  padding: 8px 12px;
  background-image: none;
}

@supports (appearance: base-select) {
  select.select:not([multiple]),
  select.select:not([multiple])::picker(select) {
    appearance: base-select;
  }

  select.select:not([multiple])::picker(select) {
    margin-top: 4px;
    padding: 4px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 3px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
  }

  select.select:not([multiple])::picker-icon {
    display: none;
  }

  select.select:not([multiple]) option {
    min-height: 34px;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--white);
    border-radius: 2px;
  }

  select.select:not([multiple]) option:hover,
  select.select:not([multiple]) option:focus-visible {
    color: var(--ink);
    background: #f3f3f3;
    outline: none;
  }

  select.select:not([multiple]) option:checked {
    color: var(--on-black);
    background: #181818;
  }
}

.input-group {
  display: flex;
  width: 100%;
}

.input-group > .input,
.input-group > .select {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.input-group > :not(:first-child) {
  margin-left: -1px;
}

.input-group > :first-child:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > :last-child:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group > :not(:first-child):not(:last-child) {
  border-radius: 0;
}

.input-addon {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, .12);
  white-space: nowrap;
}

.checkbox,
.radio {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.checkbox input,
.radio input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #181818;
  cursor: pointer;
}

.checkbox input:focus-visible,
.radio input:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.checkbox input:disabled,
.radio input:disabled {
  cursor: not-allowed;
  opacity: .5;
}

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

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.switch-control {
  position: relative;
  width: 36px;
  height: 20px;
  background: #bbb;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 3px;
  transition: background-color .15s ease;
}

.switch-control::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--white);
  border-radius: 2px;
  content: "";
  transition: transform .15s ease;
}

.switch input:checked + .switch-control {
  background: #181818;
}

.switch input:checked + .switch-control::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-control {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.switch input:disabled + .switch-control {
  cursor: not-allowed;
  opacity: .5;
}

.file-input {
  width: 100%;
  min-height: 40px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 3px;
  font: inherit;
}

.file-input::file-selector-button {
  height: 38px;
  margin-right: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: #f7f7f7;
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, .12);
  border-radius: 2px 0 0 2px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.file-input::file-selector-button:hover {
  background: #f1f1f1;
}

.file-input:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.range {
  width: 100%;
  accent-color: #181818;
  cursor: pointer;
}

.range:disabled {
  cursor: not-allowed;
  opacity: .5;
}
