/* エントリーフォーム共通スタイル（スマホ優先・高コントラスト） */
:root {
  --ef-bg: #f5f7fa;
  --ef-surface: #ffffff;
  --ef-text: #1a1a1a;
  --ef-muted: #4a4a4a;
  --ef-border: #2c3e50;
  --ef-primary: #0b4f8a;
  --ef-primary-hover: #083d6b;
  --ef-error: #b00020;
  --ef-success: #1b5e20;
  --ef-radius: 8px;
  --ef-font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  /* フォーム項目の縦間隔（ラベル↔入力・項目ブロック間で共通） */
  --ef-space-label-input: 10px;
  --ef-space-field: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--ef-font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ef-text);
  background: var(--ef-bg);
  -webkit-text-size-adjust: 100%;
}

.ef-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

.ef-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--ef-primary);
}

.ef-org {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--ef-muted);
}

.ef-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--ef-primary);
}

.ef-main {
  background: var(--ef-surface);
  padding: 20px 16px;
  border-radius: var(--ef-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ef-lead {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.7;
}

/* --- ステップフロー（共通・横並び） --- */
.ef-progress {
  margin-bottom: 32px;
  padding: 20px 16px 0;
  border: 1px solid #e2e8f0;
  border-radius: var(--ef-radius);
  background: #f8fafc;
}

.ef-progress-now {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--ef-primary);
  border-radius: 6px;
  background: #e8f2fb;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ef-progress-now-kicker {
  font-weight: bold;
  color: var(--ef-muted);
  white-space: nowrap;
}

.ef-progress-now-title {
  color: var(--ef-primary);
  font-size: 1.05rem;
}

.ef-progress-now-count {
  font-size: 0.85rem;
  color: var(--ef-muted);
  white-space: nowrap;
}

.ef-progress-bar {
  height: 8px;
  margin-bottom: 0;
  border-radius: 999px;
  background: #dde3ea;
  overflow: hidden;
}

.ef-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ef-primary);
  transition: width 0.25s ease;
}

.ef-stepper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  list-style: none;
  margin: 0;
  padding: 8px 4px 4px;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ef-stepper-item {
  position: relative;
  flex: 1 1 0;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 28px 8px 16px;
  text-align: center;
}

/* ステップ間のつなぎ線（横） */
.ef-stepper-item:not(.is-last)::before {
  content: "";
  position: absolute;
  top: 42px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: #cfd8dc;
  z-index: 0;
}

.ef-stepper-item.is-done:not(.is-last)::before {
  background: var(--ef-success);
}

.ef-stepper-here {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: bold;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 4px;
  background: var(--ef-primary);
  color: #fff;
  z-index: 2;
}

.ef-stepper-marker {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 4px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid #b0bec5;
  background: #fff;
  color: var(--ef-muted);
  flex-shrink: 0;
}

.ef-stepper-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  width: 100%;
  padding: 0 2px;
  line-height: 1.35;
}

.ef-stepper-id {
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--ef-muted);
  letter-spacing: 0.02em;
}

.ef-stepper-name {
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--ef-text);
  word-break: break-word;
  hyphens: auto;
}

/* 完了済み */
.ef-stepper-item.is-done .ef-stepper-marker {
  border-color: var(--ef-success);
  background: var(--ef-success);
  color: #fff;
}

.ef-stepper-item.is-done .ef-stepper-id,
.ef-stepper-item.is-done .ef-stepper-name {
  color: var(--ef-muted);
  font-weight: normal;
}

/* 現在 */
.ef-stepper-item.is-current .ef-stepper-marker {
  width: 32px;
  height: 32px;
  margin-top: 6px;
  border-color: var(--ef-primary);
  background: var(--ef-primary);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(11, 79, 138, 0.2);
}

.ef-stepper-item.is-current .ef-stepper-id,
.ef-stepper-item.is-current .ef-stepper-name {
  color: var(--ef-primary);
}

.ef-stepper-item.is-current .ef-stepper-name {
  font-weight: bold;
}

/* これから */
.ef-stepper-item.is-upcoming .ef-stepper-marker {
  background: #fafafa;
}

.ef-stepper-item.is-upcoming .ef-stepper-id,
.ef-stepper-item.is-upcoming .ef-stepper-name {
  color: #9e9e9e;
  font-weight: normal;
}

@media (min-width: 520px) {
  .ef-progress {
  }

  .ef-stepper {
    padding: 12px 8px 8px;
    gap: 8px;
  }

  .ef-stepper-item {
    min-width: 80px;
    padding: 30px 10px 18px;
  }

  .ef-stepper-item:not(.is-last)::before {
    top: 46px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
  }

  .ef-stepper-marker {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .ef-stepper-item.is-current .ef-stepper-marker {
    width: 36px;
    height: 36px;
  }

  .ef-stepper-label {
    margin-top: 12px;
    gap: 5px;
  }

  .ef-stepper-id {
    font-size: 0.7rem;
  }

  .ef-stepper-name {
    font-size: 0.78rem;
  }

  .ef-stepper-here {
    top: 10px;
    font-size: 0.7rem;
    padding: 4px 10px;
  }
}

/* ステップ直下の本文との間隔 */
.ef-progress + .ef-lead {
  margin-top: 8px;
}

.ef-field {
  display: flex;
  flex-direction: column;
  gap: var(--ef-space-label-input);
  margin-bottom: var(--ef-space-field);
}

.ef-field label,
.ef-field legend,
.ef-group-label {
  display: block;
  margin: 0;
  font-weight: bold;
  font-size: 1rem;
}

/* 生年月日（親ラベル + 年月日） */
.ef-birthdate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.ef-birthdate-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ef-field .ef-birthdate-item select {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 12px 8px;
  font-size: 1rem;
}

.ef-field .ef-birthdate-item--year select {
  min-width: 5.5em;
}

.ef-field .ef-birthdate-item:not(.ef-birthdate-item--year) select {
  min-width: 3.5em;
}

.ef-input-unit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.ef-input-unit input {
  flex: 1 1 8em;
  min-width: 6em;
  max-width: 14em;
}

.ef-input-unit-suffix {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--ef-text);
  white-space: nowrap;
  flex-shrink: 0;
}

.ef-draft-notice {
  margin-bottom: 16px;
}

.ef-step4-guide {
  margin-bottom: 24px;
}

.ef-postal-address {
  margin: 0 0 16px;
  white-space: pre-line;
  line-height: 1.6;
}

/* STEP1：流れ＋エントリーシート送信案内（コンパクト） */
.ef-guide-compact {
  margin-bottom: 24px;
  border: 1px solid #d0dae4;
  border-radius: var(--ef-radius);
  background: #f8fafc;
  overflow: hidden;
}

.ef-flow-compact {
  padding: 14px 16px 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.ef-flow-compact-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--ef-primary);
}

.ef-flow-compact-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ef-flow-compact-item {
  flex: 1 1 auto;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
  position: relative;
}

.ef-flow-compact-item:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: bold;
  color: #b0bec5;
  z-index: 1;
  pointer-events: none;
}

.ef-flow-compact-item.is-current {
  border-color: var(--ef-primary);
  background: #e8f2fb;
}

.ef-flow-compact-item.is-current .ef-flow-compact-id,
.ef-flow-compact-item.is-current .ef-flow-compact-label {
  color: var(--ef-primary);
}

.ef-flow-compact-item.is-highlight {
  border-color: #f9a825;
  background: #fff8e1;
}

.ef-flow-compact-item.is-highlight .ef-flow-compact-id {
  color: #e65100;
}

.ef-flow-compact-id {
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--ef-muted);
  line-height: 1.2;
}

.ef-flow-compact-label {
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--ef-text);
  line-height: 1.25;
}

.ef-flow-compact-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ef-muted);
}

.ef-documents-compact {
  padding: 14px 16px 16px;
}

.ef-documents-compact-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: bold;
  color: var(--ef-text);
  line-height: 1.4;
}

.ef-documents-compact-step {
  display: inline-block;
  margin-right: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  background: #e65100;
  border-radius: 4px;
  vertical-align: middle;
}

.ef-documents-compact-lead {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ef-muted);
}

.ef-documents-compact-items {
  margin: 0 0 10px;
  padding-left: 1.2em;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ef-documents-compact-items li {
  margin-bottom: 2px;
}

.ef-documents-compact-methods {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

@media (min-width: 520px) {
  .ef-documents-compact-methods {
    grid-template-columns: 1fr 1fr;
  }
}

.ef-documents-method {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e0e0e0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.ef-documents-method-label {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--ef-primary);
  background: #e8f2fb;
  border-radius: 4px;
}

.ef-documents-method-text {
  color: var(--ef-text);
}

.ef-postal-inline {
  font-size: 0.8rem;
}

.ef-documents-compact-more {
  margin: 0;
  font-size: 0.85rem;
}

.ef-documents-compact-more a {
  font-weight: bold;
}

@media (max-width: 519px) {
  .ef-flow-compact-item:not(:last-child)::after {
    display: none;
  }

  .ef-flow-compact-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .ef-flow-compact-item {
    min-width: 0;
  }

  .ef-flow-compact-item:nth-child(4),
  .ef-flow-compact-item:nth-child(5) {
    grid-column: span 1;
  }
}

@media (min-width: 520px) {
  .ef-flow-compact-item {
    min-width: 0;
    flex: 1;
  }
}

.ef-birthdate-unit {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--ef-text);
  white-space: nowrap;
}

.ef-required::after {
  content: " *";
  color: var(--ef-error);
}

.ef-field input[type="text"],
.ef-field input[type="email"],
.ef-field input[type="tel"],
.ef-field input[type="number"],
.ef-field select,
.ef-field textarea {
  width: 100%;
  padding: 14px 12px;
  font-size: 1.05rem;
  border: 2px solid var(--ef-border);
  border-radius: var(--ef-radius);
  background: #fff;
  color: var(--ef-text);
}

.ef-field input:focus,
.ef-field select:focus,
.ef-field textarea:focus {
  outline: 3px solid #4a90d9;
  outline-offset: 2px;
  border-color: var(--ef-primary);
}

.ef-field textarea {
  min-height: 120px;
  resize: vertical;
}

.ef-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
  margin-bottom: var(--ef-space-field);
}

.ef-inline .ef-field {
  flex: 1 1 12em;
  min-width: min(100%, 12em);
  margin-bottom: 0;
}

.ef-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ef-muted);
}

.ef-error-box {
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 2px solid var(--ef-error);
  border-radius: var(--ef-radius);
  background: #ffebee;
  color: var(--ef-error);
}

.ef-error-box ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.ef-info-box {
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 2px solid var(--ef-primary);
  border-radius: var(--ef-radius);
  background: #e3f2fd;
}

.ef-success-box {
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 2px solid var(--ef-success);
  border-radius: var(--ef-radius);
  background: #e8f5e9;
}

.ef-btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  border: none;
  border-radius: var(--ef-radius);
  cursor: pointer;
  text-decoration: none;
}

.ef-btn-primary {
  background: var(--ef-primary);
  color: #fff;
}

.ef-btn-primary:hover {
  background: var(--ef-primary-hover);
}

.ef-btn-secondary {
  margin-top: 12px;
  background: #fff;
  color: var(--ef-primary);
  border: 2px solid var(--ef-primary);
}

.ef-btn-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

@media (min-width: 480px) {
  .ef-btn-row--dual {
    flex-direction: row;
  }
  .ef-btn-row--dual .ef-btn {
    flex: 1;
  }
}

.ef-section {
  margin: 32px 0 16px;
  padding-top: 16px;
  border-top: 2px dashed #ccc;
}

.ef-section h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--ef-primary);
}

.ef-family-block,
.ef-scholarship-block {
  padding: 16px;
  margin-bottom: 16px;
  border: 2px solid #ddd;
  border-radius: var(--ef-radius);
  background: #fafafa;
}

.ef-family-block h3,
.ef-scholarship-block h3 {
  margin: 0;
  font-size: 1rem;
}

.ef-repeatable-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ef-repeatable-remove {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 0.85rem;
  color: #666;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

.ef-repeatable-remove:hover {
  color: #c00;
  border-color: #c00;
}

.ef-repeatable-add {
  margin-top: 4px;
}

.ef-repeatable-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ef-field-error {
  margin: 8px 0 0;
  color: #c00;
  font-size: 0.9rem;
}

.ef-confirm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ef-confirm-table th,
.ef-confirm-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

.ef-confirm-table th {
  width: 38%;
  font-weight: bold;
  background: #f0f4f8;
}

.ef-footer {
  margin-top: 32px;
  padding-top: 16px;
  font-size: 0.85rem;
  color: var(--ef-muted);
  text-align: center;
}

.ef-copy {
  margin-top: 8px;
}

.ef-checkbox label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: normal;
}

.ef-checkbox input {
  width: 24px;
  height: 24px;
  margin-top: 4px;
  flex-shrink: 0;
}

.ef-link-list a {
  color: var(--ef-primary);
  font-weight: bold;
}

/* --- 送信中オーバーレイ --- */
body.ef-is-submitting {
  overflow: hidden;
}

.ef-submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ef-submit-overlay[hidden] {
  display: none !important;
}

.ef-submit-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ef-submit-overlay__dialog {
  position: relative;
  width: min(100%, 360px);
  margin: 0;
  padding: 32px 28px 28px;
  border-radius: 16px;
  background: var(--ef-surface);
  box-shadow:
    0 24px 48px rgba(11, 79, 138, 0.18),
    0 0 0 1px rgba(11, 79, 138, 0.08);
  text-align: center;
  animation: ef-overlay-in 0.28s ease-out;
}

@keyframes ef-overlay-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ef-submit-overlay__spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--ef-primary);
  border-radius: 50%;
  animation: ef-spin 0.75s linear infinite;
}

@keyframes ef-spin {
  to {
    transform: rotate(360deg);
  }
}

.ef-submit-overlay__title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--ef-primary);
  line-height: 1.4;
}

.ef-submit-overlay__message {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ef-muted);
}

.ef-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
