.form-control {
  appearance: none;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs);
  color: var(--text);
  display: block;
  font-size: 1rem;
  line-height: 1.5rem;
  outline: 0;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

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

@media (min-width: 640px) {
  .form-control {
    font-size: 0.875rem;
  }
}

.form-control:disabled {
  background: var(--surface-subtle);
  cursor: not-allowed;
}

.form-control.error,
.form-control.is-invalid {
  box-shadow: inset 0 0 0 1px var(--red-300), var(--shadow-xs);
}

.form-control.error:focus,
.form-control.is-invalid:focus {
  box-shadow: inset 0 0 0 2px var(--red-500), var(--shadow-xs);
}

select:not([multiple]) {
  appearance: none;
  background-color: var(--surface);
  background-image: var(--select-arrow-icon);
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5rem;
  outline: 0;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  width: 100%;
}

select:not([multiple]):disabled {
  background-color: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: not-allowed;
  opacity: 0.75;
}

@media (min-width: 640px) {
  select:not([multiple]) {
    font-size: 0.875rem;
  }
}

select[multiple] {
  background: var(--surface);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5rem;
  min-height: 120px;
  outline: 0;
  padding: 0.625rem 0.75rem;
  width: 100%;
}

.form-control:focus,
select:not([multiple]):focus,
select[multiple]:focus-visible {
  box-shadow: inset 0 0 0 1px var(--indigo-500), 0 0 0 3px var(--indigo-100), var(--shadow-xs);
}

select[multiple]:disabled {
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: not-allowed;
  opacity: 0.75;
}

option {
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

option:checked,
option:hover {
  background: var(--surface-subtle);
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cg fill='%236b7280'%3E%3Cpath d='m2.25,10.5c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061L9.22,1.72c.293-.293.768-.293,1.061,0s.293.768,0,1.061l-7.5,7.5c-.146.146-.338.22-.53.22Z' stroke-width='0'%3E%3C/path%3E%3Cpath d='m9.75,10.5c-.192,0-.384-.073-.53-.22L1.72,2.78c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l7.5,7.5c.293.293.293.768,0,1.061-.146.146-.338.22-.53.22Z' stroke-width='0'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  cursor: pointer;
  height: 16px;
  width: 16px;
}

input[list] {
  appearance: none;
}

input[list].replace-default-datalist-arrow::-webkit-calendar-picker-indicator {
  -webkit-appearance: none !important;
  display: none !important;
}

input[list].replace-default-datalist-arrow {
  background-image: var(--select-arrow-icon);
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
}

[type="checkbox"],
[type="radio"] {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  height: 1rem;
  width: 1rem;
}

[type="checkbox"] {
  border-radius: var(--radius-sm);
}

[type="radio"] {
  border-radius: 999px;
}

[type="checkbox"]:focus-visible,
[type="radio"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

[type="checkbox"]:checked,
[type="radio"]:checked {
  background-color: var(--indigo-500);
  border-color: var(--indigo-500);
}

[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

[type="checkbox"]:indeterminate {
  background-color: var(--indigo-500);
  border-color: var(--indigo-500);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cg fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' %3e%3cline x1='10.75' y1='6' x2='1.25' y2='6'%3e%3c/line%3e%3c/g%3e%3c/svg%3e");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 75% 75%;
}

[type="radio"]:checked {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

[type="checkbox"]:disabled,
[type="radio"]:disabled {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  cursor: not-allowed;
  opacity: 0.75;
}
