/*
 * お問い合わせ・採用フォーム（自作 PHP / Contact Form 7 共通）
 * 本院の表レイアウト + 告知サイト風3ステップ（サイトカラー）
 */

.entry-content .uj-form,
.entry-content .uj-recruit-form,
.entry-content .uj-form--recruit,
.entry-content .uj-form--recruit-cf7,
.entry-content .uj-form--contact,
.entry-content .uj-form--contact-cf7 {
  margin: 1.25em 0 2.5em;
  max-width: 100%;
}

.entry-content .uj-form__test-notice,
.entry-content .uj-recruit-form__test-notice {
  margin: 0.75em 0 1em;
  color: var(--uj-recruit-opening-color, #c0392b);
  font-weight: 600;
  line-height: 1.6;
}

/* --- 3ステップ --- */
.entry-content .uj-form__steps {
  margin: 0 0 1.75em;
  padding: 1.1rem 1.25rem 1rem;
  border: 1px solid var(--uj-info-table-border-color, var(--uj-green-nav, #4b6423));
  border-radius: 2px;
  background: var(--uj-surface, #fff);
}

/* 本文 ol スタイル（main.css）の影響を打ち消す */
body.uj-headings-combo-sub .entry-content ol.uj-form__steps-list,
body.uj-headings-combo-sub .entry-content .uj-form__steps-list {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
  list-style-type: none;
  list-style-position: inside;
  background: none;
  border: none;
  border-radius: 0;
}

body.uj-headings-combo-sub .entry-content .uj-form__steps-list > li.uj-form__step {
  margin: 0;
  padding: 0;
  line-height: 1.35;
}

body.uj-headings-combo-sub .entry-content .uj-form__steps-list > li.uj-form__step + li.uj-form__step {
  margin-top: 0;
}

.entry-content .uj-form__steps-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 2.1rem minmax(2.35rem, auto);
  column-gap: 0.75rem;
  row-gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  justify-items: center;
  align-items: center;
}

.entry-content .uj-form__steps-list::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 16%;
  right: 16%;
  height: 2px;
  background: var(--uj-border-soft, #e0ddd6);
  z-index: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

/* li は箱を消し、マーカーとラベルを親グリッドの行に直接配置 */
.entry-content .uj-form__step {
  display: contents;
}

.entry-content .uj-form__step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: #d8d4cc;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.entry-content .uj-form__step:nth-child(1) .uj-form__step-marker {
  grid-column: 1;
}

.entry-content .uj-form__step:nth-child(2) .uj-form__step-marker {
  grid-column: 2;
}

.entry-content .uj-form__step:nth-child(3) .uj-form__step-marker {
  grid-column: 3;
}

.entry-content .uj-form__step-label {
  display: block;
  grid-row: 2;
  align-self: start;
  justify-self: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--uj-text-soft, #5f5a54);
  line-height: 1.35;
  text-align: center;
}

.entry-content .uj-form__step:nth-child(1) .uj-form__step-label {
  grid-column: 1;
}

.entry-content .uj-form__step:nth-child(2) .uj-form__step-label {
  grid-column: 2;
}

.entry-content .uj-form__step:nth-child(3) .uj-form__step-label {
  grid-column: 3;
}

.entry-content .uj-form__step.is-active .uj-form__step-marker {
  background: var(--uj-green-nav-dark, #3d502f);
}

.entry-content .uj-form__step.is-active .uj-form__step-label {
  color: var(--uj-text, #3a3835);
}

.entry-content .uj-form__step.is-done .uj-form__step-marker {
  background: var(--uj-green-nav, #4b6423);
}

/* --- 入力テーブル --- */
.entry-content .uj-form__table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--uj-info-table-border-color, var(--uj-green-nav, #4b6423));
  background: var(--uj-surface, #fff);
  font-family: var(--uj-font);
  font-size: 15px;
  line-height: 1.55;
}

.entry-content .uj-form__table :is(th, td) {
  padding: 0.85rem 1rem;
  border: 1px solid var(--uj-info-table-border-color, var(--uj-green-nav, #4b6423));
  vertical-align: middle;
  text-align: left;
}

.entry-content .uj-form__table th {
  width: 36%;
  min-width: 12.5rem;
  background: var(--uj-info-table-label-bg, rgba(75, 100, 35, 0.07));
  font-weight: 600;
  color: var(--uj-text, #3a3835);
  vertical-align: middle;
}

.entry-content .uj-form__label-cell {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
}

.entry-content .uj-form__table th > .uj-form__badge + .title-contactform7,
.entry-content .uj-form__table th > .uj-form__badge + span:not(.uj-form__badge) {
  margin-inline-start: 0.35em;
}

.entry-content .uj-form__label-cell .uj-form__badge + .title-contactform7,
.entry-content .uj-form__label-cell .uj-form__badge + span:not(.uj-form__badge) {
  margin-inline-start: 0;
}

.entry-content .uj-form__label-cell .uj-form__badge {
  flex: 0 0 auto;
}

.entry-content .uj-form__label-cell .title-contactform7 {
  white-space: nowrap;
  line-height: 1.45;
}

.entry-content .wpcf7-form .uj-form__table th > p {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
  margin: 0;
}

.entry-content .wpcf7-form .uj-form__table th .uj-form__label-cell {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.entry-content .wpcf7-form .uj-form__table th .uj-form__badge + span:not(.uj-form__badge) {
  margin-inline-start: 0.35em;
}

.entry-content .uj-form__field-hint {
  margin: 0.55em 0 0;
  color: var(--uj-recruit-opening-color, #c0392b);
  font-size: calc(1em - 1pt);
  font-weight: 400;
  line-height: 1.5;
}

.entry-content .wpcf7-form .uj-form__field-hint {
  margin: 0.55em 0 0;
}

.entry-content .uj-form__table td {
  background: var(--uj-surface, #fff);
}

.entry-content .uj-form__badge {
  display: inline-block;
  margin: 0;
  padding: 0.12rem 0.42rem;
  border-radius: 2px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  vertical-align: middle;
}

.entry-content .uj-form__badge--required {
  background: var(--uj-recruit-callout-color, #b83232);
}

.entry-content .uj-form__badge--optional {
  background: #5a7f96;
}

.entry-content .uj-form__input,
.entry-content .uj-form__textarea,
.entry-content .wpcf7-form .uj-form__input,
.entry-content .wpcf7-form .uj-form__textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0.55em 0.65em;
  border: 1px solid var(--uj-border-soft, #e0ddd6);
  border-radius: 2px;
  background: #fff;
  font-family: var(--uj-font);
  font-size: 15px;
  line-height: 1.5;
}

.entry-content .uj-form__input[readonly],
.entry-content .wpcf7-form .uj-form__input[readonly] {
  background: var(--uj-bg, #f5f3f1);
  color: var(--uj-text, #3a3835);
}

.entry-content .uj-form__textarea,
.entry-content .wpcf7-form .uj-form__textarea {
  min-height: 10em;
  resize: vertical;
}

.entry-content .uj-form__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.entry-content .uj-form__fieldset > legend.screen-reader-text {
  pointer-events: none;
}

.entry-content .uj-form__radio-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  line-height: 1.35;
}

.entry-content .uj-form__radio-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  font-weight: 400;
  line-height: 1.35;
  cursor: pointer;
}

.entry-content .uj-form__radio-label:last-child {
  margin-bottom: 0;
}

.entry-content .uj-form__radio {
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
}

/* CF7 は fieldset 内を <p> で包むため、行間ではなく余白で項目間隔を制御 */
.entry-content .wpcf7-form .uj-form__fieldset > p:has(.wpcf7-radio),
.entry-content .wpcf7-form .uj-form__fieldset > p:has(.wpcf7-checkbox) {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.35;
}

.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-radio,
.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-checkbox {
  display: block;
  line-height: 1.35;
}

.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-radio .wpcf7-list-item,
.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-checkbox .wpcf7-list-item {
  display: block;
  margin: 0 0 0.2rem;
  line-height: 1.35;
}

.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-radio .wpcf7-list-item label,
.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-checkbox .wpcf7-list-item label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  line-height: 1.35;
  cursor: pointer;
}

.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-radio .wpcf7-list-item:last-child,
.entry-content .wpcf7-form .wpcf7-form-control.wpcf7-checkbox .wpcf7-list-item:last-child {
  margin-bottom: 0;
}

.entry-content .wpcf7-form .wpcf7-list-item-label {
  font-weight: 400;
  line-height: 1.35;
}

.entry-content .uj-form__actions,
.entry-content .wpcf7-form .uj-form__actions {
  margin: 1.35em 0 0;
  text-align: center;
}

.entry-content .uj-form__actions--confirm {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.entry-content .uj-form__button,
.entry-content .wpcf7-form .uj-form__button,
.entry-content .wpcf7-form input.wpcf7-submit.uj-form__button {
  display: inline-block;
  min-width: 12rem;
  padding: 0.75em 1.8em;
  border: 1px solid var(--uj-green-nav-dark, #3d502f);
  border-radius: 2px;
  background: var(--uj-green-nav-dark, #3d502f);
  color: #fff;
  font-family: var(--uj-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
}

.entry-content .uj-form__button--secondary {
  background: #fff;
  color: var(--uj-text, #3a3835);
  border-color: #9a958c;
}

.entry-content .uj-form__button:hover,
.entry-content .uj-form__button:focus-visible,
.entry-content .wpcf7-form .uj-form__button:hover,
.entry-content .wpcf7-form .uj-form__button:focus-visible {
  filter: brightness(0.95);
  outline: none;
}

.entry-content .uj-form__notice,
.entry-content .uj-recruit-form__notice {
  margin: 0 0 1.25em;
  padding: 0.9em 1em;
  border-radius: 2px;
}

.entry-content .uj-form__notice--success,
.entry-content .uj-recruit-form__notice--success {
  border: 2px solid #46b450;
  background: #fff;
  color: var(--uj-text, #3a3835);
}

.entry-content .uj-form__notice--error,
.entry-content .uj-recruit-form__notice--error {
  border: 2px solid var(--uj-recruit-opening-color, #c0392b);
  background: #fff8f7;
  color: var(--uj-text, #3a3835);
}

.entry-content .uj-form__notice ul,
.entry-content .uj-recruit-form__notice ul {
  margin: 0;
  padding-left: 1.2em;
}

.entry-content .uj-form__actions--back,
.entry-content .uj-recruit-form__actions--back,
.entry-content .wpcf7 .uj-form__actions--back {
  margin-top: 1.25em;
  text-align: center;
}

.entry-content .uj-form__back-link,
.entry-content .uj-recruit-form__back-link {
  display: inline-block;
  padding: 0.65em 1.6em;
  border: 1px solid #9a958c;
  border-radius: 2px;
  background: #fff;
  color: var(--uj-text, #3a3835);
  font-family: var(--uj-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.entry-content .uj-form__back-link:hover,
.entry-content .uj-form__back-link:focus-visible,
.entry-content .uj-recruit-form__back-link:hover,
.entry-content .uj-recruit-form__back-link:focus-visible {
  filter: brightness(0.95);
  outline: none;
}

/* 確認テーブル（自作） */
.entry-content .uj-form__table--confirm {
  margin: 0 0 1.25em;
}

.entry-content .uj-form__table--confirm th {
  white-space: nowrap;
  width: 36%;
  min-width: 12.5rem;
  background: var(--uj-info-table-label-bg, rgba(75, 100, 35, 0.07));
}

/* CF7 + Confirm Plus */
.entry-content .wpcf7 {
  margin: 1.25em 0 2em;
}

.entry-content .wpcf7-form .uj-form__table p,
.entry-content .wpcf7-form .uj-form__actions p {
  margin: 0;
}

.entry-content .wpcf7-form br {
  display: none;
}

.entry-content .wpcf7-form .wpcf7-form-control-wrap {
  display: block;
}

.entry-content .wpcf7 form.wpcf7-form > .uj-form__steps {
  margin-bottom: 1.75em;
}

.entry-content .wpcf7 > .uj-form__steps {
  margin-bottom: 1.75em;
}

.entry-content div#wpcf7cpcnf {
  margin: 0 0 1.25em;
}

/* 確認画面：visibility:hidden だとフォームの高さが残り、確認表が画面下に押し出される */
.entry-content .wpcf7 form.wpcf7-form.wpcf7cp-form-hide {
  display: none !important;
}

.entry-content .wpcf7:has(> .uj-form__steps) #wpcf7cpcnf {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1;
  margin-top: 0;
}

.entry-content div#wpcf7cpcnf table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--uj-info-table-border-color, var(--uj-green-nav, #4b6423));
}

.entry-content div#wpcf7cpcnf table :is(th, td) {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--uj-info-table-border-color, var(--uj-green-nav, #4b6423));
  vertical-align: top;
  text-align: left;
  line-height: 1.6;
}

.entry-content div#wpcf7cpcnf table th {
  width: 32%;
  background: var(--uj-info-table-label-bg, rgba(75, 100, 35, 0.07));
  font-weight: 600;
}

.entry-content div#wpcf7cpcnf .wpcf7cp-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 1.25em;
}

.entry-content div#wpcf7cpcnf button.wpcf7cp-cfm-edit-btn,
.entry-content div#wpcf7cpcnf button.wpcf7cp-cfm-submit-btn {
  min-width: 12rem;
  padding: 0.75em 1.8em;
  border-radius: 2px;
  font-family: var(--uj-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.entry-content div#wpcf7cpcnf button.wpcf7cp-cfm-edit-btn {
  background: #fff;
  color: var(--uj-text, #3a3835);
  border: 1px solid #9a958c;
}

.entry-content div#wpcf7cpcnf button.wpcf7cp-cfm-submit-btn {
  background: var(--uj-green-nav-dark, #3d502f);
  color: #fff;
  border: 1px solid var(--uj-green-nav-dark, #3d502f);
}

.entry-content .wpcf7-response-output {
  margin: 1em 0 0;
  padding: 0.9em 1em;
  border: 2px solid #46b450;
  border-radius: 2px;
}

@media (max-width: 767px) {
  .entry-content .uj-form__steps-list::before {
    left: 10%;
    right: 10%;
  }

  .entry-content .uj-form__step-label {
    font-size: 0.74rem;
  }

  .entry-content .uj-form__label-cell .title-contactform7 {
    white-space: normal;
  }

  .entry-content .uj-form__table th {
    min-width: 0;
    width: 100%;
  }

  .entry-content .uj-form__table :is(th, td),
  .entry-content div#wpcf7cpcnf table :is(th, td) {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .entry-content .uj-form__table tr + tr th,
  .entry-content div#wpcf7cpcnf table tr + tr th {
    border-top: 0;
  }
}

/* 旧クラス互換 */
.entry-content .uj-recruit-form__field,
.entry-content .uj-recruit-form__input,
.entry-content .uj-recruit-form__textarea,
.entry-content .uj-recruit-form__button,
.entry-content .uj-recruit-form__confirm-table {
  /* 旧ページ向け：新クラスへ寄せる */
}

.entry-content .uj-recruit-form__input,
.entry-content .uj-recruit-form__textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.55em 0.65em;
  border: 1px solid var(--uj-border-soft, #e0ddd6);
  border-radius: 2px;
  background: #fff;
  font-family: var(--uj-font);
  font-size: 15px;
}

.entry-content .uj-recruit-form__button {
  display: inline-block;
  padding: 0.65em 1.6em;
  border: 1px solid var(--uj-green-nav-dark, #3d502f);
  border-radius: 2px;
  background: var(--uj-green-nav-dark, #3d502f);
  color: #fff;
  font-family: var(--uj-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
