/* 編集ページ */
div.wrap_boxs {
  display: flex;
  flex-wrap: wrap;
  width: calc(100% - 50px);
}

div.item_set {
  display: flex;
  width: 100%;
}

div.item_set:not(:last-child) {
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

/* フレーム */
form {
  width: 100%;
  margin: 0 auto;
}

/* 入力フォーム */
input,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  font-size: var(--t_form);
  background-color: var(--input_text);
  border: 1px solid var(--gray4);
  color: var(--black);
}

input:focus {
  outline: none;
}

::placeholder {
  color: var(--gray3);
}

/*input="text"サイズ*/
.input_xs {
  width: 55px;
  text-align: center;
}

.input_xs p {
  margin: 0 10px;
}

.input_s {
  width: 80px;
  text-align: center;
}

.input_m {
  width: 250px;
}

.input_ml {
  width: 400px;
}
.input_l {
  width: 100%;
}

/* ログイン */
.input_login {
  width: 100%;
  max-width: 500px;
}

/* 1. 親要素：基準位置（relative）にする */
.password-container {
  position: relative;
  max-width: 500px;
  width: 100%;
}

/* 2. 入力欄：右側にアイコン分のスペースを空ける */
.password-container input[type="password"] {
  width: 100%;
  padding: 10px;
  padding-right: 40px;
  /* ★ここが重要：アイコンと文字の衝突を防ぐ */
  box-sizing: border-box;
}

/* 3. アイコンの親：絶対配置（absolute）で右端の中央に置く */
.password-container .eyebox {
  position: absolute;
  top: 50%;
  right: 10px;
  /* 右端からの距離 */
  transform: translateY(-50%);
  /* 縦方向の真ん中寄せ */
  cursor: pointer;
  /* マウスホバーで指マークにする */
}

.icon_eye {
  color: var(--gray4);
  font-size: 16px;
}

/*ラジオボタン*/
.radio1 {
  display: flex;
  flex-wrap: wrap;
  gap: 15px 30px;
  border: none;
}

.radio1 label {
  display: flex;
  align-items: center;
  color: var(--black);
  gap: 10px;
  position: relative;
  cursor: pointer;
  font-size: 1rem;
}

.radio1 label::before,
.radio1 label::after {
  border-radius: 50%;
  content: "";
}

.radio1 label::before {
  width: 36px;
  height: 36px;
  border: 3px solid var(--input_radio);
  box-sizing: border-box;
}

.radio1 label::after {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background-color: var(--input_radio);
}

.radio1 label:has(:checked)::after {
  background-color: var(--blue2);
  animation: anim-radio-2 0.3s linear;
}

.radio1 input {
  display: none;
}

/*チェックボックス*/
.checkbox1 {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  width: 100%;
  gap: 1em 4em;
  border: none;
}

.checkbox1 label {
  display: flex;
  align-items: center;
  gap: 0 0.5em;
  position: relative;
  cursor: pointer;
}

.checkbox1 label::before,
.checkbox1 label:has(:checked)::after {
  content: "";
  margin-right: 10px;
}

.login .checkbox1 label::before,
.login .checkbox1 label:has(:checked)::after {
  margin-right: 0;
}

.checkbox1 label::before {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background-color: var(--input_checkbox);
}

.login .checkbox1 label::before {
  width: 23px;
  height: 23px;
}

.checkbox1 label:has(:checked)::before {
  background-color: var(--blue2);
}

.checkbox1 label:has(:checked)::after {
  position: absolute;
  top: 3px;
  left: 10px;
  transform: rotate(45deg);
  width: 9px;
  height: 20px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
}

.login .checkbox1 label:has(:checked)::after {
  top: 2px;
  left: 9px;
  width: 6px;
  height: 15px;
}

.checkbox1 input {
  display: none;
}

/* セレクトボックス */
.selectbox {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 100%;
  min-width: 250px;
}

/* 三角形 */
.selectbox::after {
  position: absolute;
  right: 15px;
  width: 10px;
  height: 7px;
  background-color: var(--gray4);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  content: "";
  pointer-events: none;
}

.selectbox select {
  appearance: none;
  width: 100%;
  height: 2.2em;
  padding: 8px;
  color: var(--black);
  border: 1px solid var(--gray4);
  background-color: var(--input_selectbox);
  border-radius: 6px;
  font-size: var(--t_form);
  cursor: pointer;
}

select:has(option[value=""]:checked) {
  color: var(--gray3);
}

/*ファイルを選択*/
input[type="file"] {
  display: inline-block;
  width: 500px;
  cursor: pointer;
  padding: 0;
  font-size: 0.7rem;
  color: #000;
  border: 1px solid var(--border);
}

::file-selector-button,
::-webkit-file-upload-button {
  display: block;
  width: 130px;
  background-color: var(--gray1);
  border-top: none;
  border-bottom: none;
  border-left: none;
  border-right: 20px solid #fff;
  cursor: pointer;
  padding: 15px 0;
  border-radius: 5px 0 0 5px;
  color: #000;
  font-size: 0.8rem;
}

/* セレクトボックスでその他を選択すると入力欄が表示 */
.hide {
  display: none;
  width: 100%;
}

.box_open li {
  display: block;
}

.wrap_open:has(
    input[name="applications.mooring_method[]"][value="other"]:checked
  )
  .box_open,
.wrap_open:has(
    select[name="applications.location_type"] option[value="other"]:checked
  )
  .box_open,
.wrap_open:has(input[name="applications.event_period"][value="limited"]:checked)
  .box_open,
.wrap_open:has(
    input[name="applications.closed_day_setting"][value="yes"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="applications.capacity_limit_setting"][value="limited"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="applications.age_limit_setting"][value="limited"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="applications.weight_limit_setting"][value="limited"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="applications.terms_use_setting"][value="yes"]:checked
  )
  .box_open,
.wrap_open:has(input[name="applications.terms_use[]"][value="other"]:checked)
  .box_open2,
.wrap_open:has(
    input[name="applications.monitoring_type[]"][value="other"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="applications.insurance_setting"][value="yes"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="applications.insurance_coverage[]"][value="other"]:checked
  )
  .box_open2,
.wrap_open:has(
    input[name="applications.safety_manager_setting"][value="assign"]:checked
  )
  .box_open,
.wrap_open:has(input[name="publish"][value="open"]:checked) .box_open,
.wrap_open:has(
    input[name="application_reviews.status"][value="returned"]:checked
  )
  .box_open,
.wrap_open:has(
    input[name="training_applications.payment_status"][value="paid"]:checked
  )
  .box_open {
  display: block;
  margin-top: 15px;
  animation: fadedown 1.2s;
}

/*-- フィールドを複製追加 --*/
ul.wrap-field-group {
  width: 100%;
}

li.field-group {
  flex-direction: column;
  width: 100%;
}

ul.items-container {
  flex-direction: column;
  position: relative;
  width: 100%;
}

.item {
  display: block;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
}

/* ポップアップを開くボタン */
button.js-open-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

button.js-open-btn img {
  width: 20px;
}

@media only screen and (max-width: 768px) {
  /*ファイルを選択*/
  input[type="file"] {
    width: 300px;
  }

  .item:not(:first-child) {
    margin-bottom: 10px;
  }

  /*追加ボタン*/
  .item .btn-delete {
    margin-left: 0;
    margin-top: 10px;
  }

  div.hide {
    margin-left: 0;
  }

  /* 途中保存 */
  button.data_save {
    width: 100px;
    font-size: 1rem;
  }

  li.item {
    flex-flow: wrap;
  }
}
