.dg-field,
input[type='text'],
input[type='email'],
input[type='url'],
input[type='tel'],
input[type='password'],
input[type='search'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'],
input[type='week'],
input[type='color'],
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: inline-block;
  width: 100%;
  height: var(--dg-control-height);
  min-height: var(--dg-control-height);
  max-height: var(--dg-control-height);
  padding: 0.5rem 0.75rem;
  border: var(--dg-border-width) solid var(--dg-border) !important;
  border-radius: var(--dg-radius-sm);
  background: var(--dg-bg-card);
  color: var(--dg-text-main);
  line-height: 1.2;
  outline: 0;
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
textarea {
  height: auto;
  min-height: 6.5rem;
  max-height: none;
  resize: vertical;
}
select {
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--dg-text-subtle) 50%),
    linear-gradient(135deg, var(--dg-text-subtle) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 1.05rem) calc(50% - 0.15rem),
    calc(100% - 0.75rem) calc(50% - 0.15rem),
    calc(100% - 2.25rem) 0;
  background-size:
    0.35rem 0.35rem,
    0.35rem 0.35rem,
    2.25rem 100%;
  background-repeat: no-repeat;
}
input::placeholder,
textarea::placeholder {
  color: var(--dg-text-subtle);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--dg-border-strong);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--dg-accent);
}
input:disabled,
select:disabled,
textarea:disabled,
[disabled] .dg-field {
  background: #f3f6f5;
  color: var(--dg-text-subtle);
  cursor: not-allowed;
  opacity: 0.9;
}

.is-invalid input,
.is-invalid select,
.is-invalid textarea {
  border-color: var(--dg-accent-error);
  outline-color: var(--dg-accent-error);
}
.is-valid input,
.is-valid select,
.is-valid textarea {
  border-color: var(--dg-accent-success);
  outline-color: var(--dg-accent-success);
}

input[type='checkbox'],
.dg-check {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.25rem;
  border: var(--dg-border-width) solid var(--dg-border);
  background: var(--dg-bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

input[type='checkbox']:focus,
.dg-check:focus {
  border-color: var(--dg-accent-strong);
}

input[type='checkbox']:checked,
.dg-check:checked {
  background: var(--dg-accent);
  border-color: var(--dg-accent);
}

input[type='checkbox']:checked::after,
.dg-check:checked::after {
  font-family: 'datso' !important;
  content: "\e933";
  font-size: 1rem;
  color: var(--dg-text-main);
  line-height: 1;
  position: absolute;
}


input[type='radio'],
.dg-radio {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: var(--dg-border-width) solid var(--dg-border);
  background: var(--dg-bg-card);
  display: inline-block;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}
input[type='radio']:focus,
.dg-radio:focus {
  border-color: var(--dg-accent-strong);
}
input[type='radio']:checked,
.dg-radio:checked {
  border-color: var(--dg-accent);
  background: var(--dg-bg-card);
}
input[type='radio']:checked::after,
.dg-radio:checked::after {
  content: '';
  position: absolute;
  inset: 0.25rem;
  border-radius: 50%;
  background: var(--dg-accent);
}

.dg-switch {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--dg-border);
  transition: background-color 0.2s ease;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}
.dg-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.dg-switch i {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--dg-bg-card);
  transition: transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.dg-switch input:checked + i {
  transform: translateX(1rem);
}
.dg-switch input:checked ~ .track {
  background: var(--dg-accent);
}
.dg-switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--dg-border);
  transition: background-color 0.2s ease;
}

input[type='file'] {
  height: auto;
  padding: 0.5rem;
  background: var(--dg-bg-card);
  border: var(--dg-border-width) solid var(--dg-border);
  border-radius: var(--dg-radius-sm);
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 0.3rem;
  background: var(--dg-border);
  border-radius: 999px;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--dg-accent);
  margin-top: -0.35rem;
}
input[type='range']::-moz-range-track {
  height: 0.3rem;
  background: var(--dg-border);
  border-radius: 999px;
}
input[type='range']::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--dg-accent);
}

.dg-input-sm {
  height: 2rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}
.dg-input-lg {
  height: 3rem;
  padding: 0.65rem 1rem;
  font-size: 1rem;
}
.dg-textarea-sm {
  min-height: 4.5rem;
}
.dg-textarea-lg {
  min-height: 9rem;
}

.dg-field-group {
  display: flex;
  width: 100%;
}
.dg-field-group > *:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.dg-field-group > *:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1.5px;
}
.dg-card .control-label {
  text-transform: uppercase;
  margin-bottom: 3px;
  font-size: .85rem;
  color: #777;
  letter-spacing: .5px;
}
.dg-card .input-group {
  display: flex;
  flex-wrap: nowrap;
}
.dg-card .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right-width: 0;
}

.dg-card .input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
