.form-label {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f0f9ff;
  font-weight: 700;
}
@media (min-width: 768px) {
  .form-label {
    width: 300px;
    padding: 24px;
  }
}
.form-label small {
  font-size: 0.875rem;
  line-height: 160%;
}
.form-label .optional,
.form-label .required {
  padding: 1px 7px 2.5px;
  border-radius: 2px;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: normal;
}
.form-label .required {
  background: #dc1b1b;
}
.form-label .optional {
  background: #555;
}

.helper-text {
  color: #999;
  font-size: 0.875rem;
  line-height: 160%;
}

.form-control {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.csv-error,
.error-box > span,
.form-control .error {
  align-items: flex-start;
  gap: 8px;
  color: #dc1b1b;
}
.csv-error::before,
.error-box > span::before,
.form-control .error::before {
  content: "";
  flex-shrink: 0;
  width: 17px;
  height: 16px;
  margin-top: 5px;
  background: url("../img/icon/error.svg");
}

.form-control .error {
  display: none;
}
.form-control .invalid.error,
.form-control .invalid + .error {
  display: flex;
}
.form-control.readonly .invalid + .error {
  display: none;
}

.error-box > span {
  display: none;
}
.error-box > span.invalid {
  display: flex;
}

.csv-error {
  display: flex;
}

.form-data {
  flex-grow: 1;
  word-break: break-all;
  padding: 16px;
}
@media (min-width: 768px) {
  .form-data {
    padding: 24px;
  }
}

.form-field {
  display: flex;
  border-top: 1px solid #ccc;
}
.form-field.border-bottom, .form-field:last-of-type {
  border-bottom: 1px solid #ccc;
}
@media (max-width: 767px) {
  .form-field {
    flex-direction: column;
  }
}
.form-field fieldset {
  display: contents;
}

.select,
.input {
  height: 48px;
  padding: 0 16px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.08) inset;
}
.valid .select, .select.valid,
.valid .input,
.input.valid {
  background-color: #fff;
}
.invalid .select, .select.invalid,
.invalid .input,
.input.invalid {
  border-color: #dc1b1b;
  background-color: #f9e6e6;
}

input[type=text].select:read-only,
.input:read-only {
  border-color: #dfdfdf;
  background-color: #dfdfdf;
  box-shadow: none;
}

.select {
  appearance: none;
  position: relative;
  padding-right: 32px;
  background-image: url("../img/icon/chevron-down.svg");
  background-repeat: no-repeat;
  background-position: center right 16px;
}
.select:has(option:checked[value=""]) {
  color: #666;
}
.select option {
  color: #222;
}

input[type=text].select:read-only {
  background-image: url("../img/icon/chevron-down-light.svg");
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 940px) {
  .name-field {
    flex-direction: row;
    gap: 24px;
  }
}
.name-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
}
.name-field .input {
  flex-grow: 1;
  min-width: 0;
  color: #222;
}
@media (min-width: 768px) {
  .name-field .input {
    width: 240px;
  }
}

.check-wrap {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}
.readonly .check-wrap, .check-wrap:has(:disabled) {
  color: #ccc;
  pointer-events: none;
}
.check-wrap input {
  flex-shrink: 0;
  margin-top: 0.3em;
}

.checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  border: 1px solid #ccc;
  background: #fff;
  box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.08) inset;
  vertical-align: middle;
  appearance: none;
}
.checkbox:checked {
  border-color: #007dd3;
  background: #007dd3;
}
.checkbox:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 12px;
  height: 10px;
  background: url("../img/icon/check.svg");
}

.radio {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 100%;
  border: 1px solid #ccc;
  background: #fff;
  box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.08) inset;
  vertical-align: middle;
  appearance: none;
}
.radio:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 100%;
  background: #007dd3;
}
.readonly .radio:checked::after {
  background: currentColor;
}
.readonly .radio, .radio:disabled {
  border-color: #e6e6e6;
  box-shadow: none;
  pointer-events: none;
}

.radio-button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding-left: 16px;
  padding-right: 8px;
  border-radius: 4px;
  border: 1px solid #b6b6b6;
  background: #fff;
  box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.25);
  font-weight: 700;
  line-height: normal;
}
.radio-button:has(:checked) {
  border: 2px solid #007dd3;
}

.radio-button-field {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.radio-button-field fieldset {
  display: contents;
}
.radio-button-field legend {
  font-size: 1.125rem;
  font-weight: 700;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: 480px;
}
.login-field label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-field .input {
  flex-grow: 1;
}
