:root {
  --accent: #0f766e;
  --accent-light: #e0f2f1;
  --danger: #b91c1c;
  --border: #d4d4d8;
  --text-muted: #575d68;
}

.apply-about {
  background-color: #f5f5f5;
  padding: 0.8rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin: 1.5rem 0 3.5rem;
}

.apply-about ul {
  padding-inline-start: 1.5rem;
  margin-block-start: 0.5rem;
  margin-block-end: 0.5rem;
}

.apply-about li {
  margin-bottom: 0.5rem;
}

.apply-about .important {
  background: linear-gradient(transparent 75%, #ffff77 30%);
}

.apply-about .note {
  font-size: 0.8rem;
  list-style-type: none;
}

@media (max-width: 600px) {
  .apply-about {
    font-size: 0.9rem;
  }
}

.form-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.form-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ================================
   ステップインジケーター（丸＋横ライン）
   ================================ */

/* 全体の並び */
.steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 2rem 0 2rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

/* 各ステップ */
.step {
  position: relative;
  flex: 1;
  text-align: center;
  color: #b0b0b0; /* 未完了の文字色（グレー） */
}

/* 丸と丸をつなぐ横ライン（背景・グレー） */
.step::before {
  content: "";
  position: absolute;
  top: 13px; /* 丸の中心の高さに合わせる（24pxの半分＋α） */
  left: 0;
  right: 0;
  height: 5px;
  background: #e0e0e0;
  z-index: 0;
}

/* 最初のステップは、左半分の線を消す */
.step:first-child::before {
  left: 50%;
}

/* 最後のステップは、右半分の線を消す */
.step:last-child::before {
  right: 50%;
}

/* ステップ番号の丸 */
.step-circle {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  border: 2px solid #009688;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  box-sizing: border-box;
  color: #009688;
}

/* ラベル（丸の下の文字） */
.step-label-main {
  display: block;
  margin-top: 0.1rem;
  font-weight: 700;
}

/* すでに完了したステップ */
.step.is-done {
  color: #009688;
}

.step.is-done::before {
  background: #009688;
}

.step.is-done .step-circle {
  background: color-mix(in srgb, #009688 20%, white);
  border-color: #009688;
  color: #009688;
}

/* 現在のステップ（アクティブ） */
.step.is-active {
  color: #009688;
}

.step.is-active::before {
  background: #009688;
}

.step.is-active .step-circle {
  background: #009688;
  border-color: #009688;
  color: #fff;
}

/* スマホ向け微調整 */
@media (max-width: 600px) {
  .steps {
    margin: 1.5rem 0;
    padding: 0;
  }

  .step-circle {
    width: 28px;
    height: 28px;
  }

  .step-label-main {
    font-size: 0.8rem;
  }
}

/* 共通フォームレイアウト */
.form-section {
  margin-bottom: 20px;
  padding: 14px 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
}

@media (max-width: 600px) {
  .form-section {
    padding: 1rem 0;
    background: none;
    border-radius: 0;
    border: none;
    border-top: 1px solid #d3d3d3;
  }
}

.form-section-title {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-required {
  font-size: 0.75rem;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 2px 8px;
}

.tag-optional {
  font-size: 0.75rem;
  background: #e5e7eb;
  color: #4b5563;
  border-radius: 999px;
  padding: 2px 8px;
}

.form-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.8rem 0 0;
}

.form-section-desc.red {
  color: var(--danger);
  font-weight: bold;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 600px) {
  .field-row {
    gap: 0px;
  }
}

@media (min-width: 600px) {
  .field-row--2col {
    flex-direction: row;
  }
  .field-row--2col .field {
    flex: 1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0.8rem;
}

.field-label {
  font-size: 0.9rem;
  font-weight: bold;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field-label-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-required-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--danger);
}

.field-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
select {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 9px 11px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  background: #fff;
}

input::placeholder {
  color: #9ca3af;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.3);
  background: #ffffff;
}

.field-error {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--danger);
  display: none;
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.2);
}

.field.has-error .field-error {
  display: block;
}

/* 受講料ラジオ */
.fee-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 6px;
}

@media (min-width: 480px) {
  .fee-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fee-option {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.fee-option input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.fee-option-main {
  font-weight: 600;
}

.fee-option-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.fee-option.is-selected {
  border-color: var(--accent);
  background: #f0fdfa;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

/* ボタン */
.actions {
  margin: 3rem auto 2rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.btn {
  font-size: 1rem;
  border-radius: 999px;
  border: none;
  padding: 0.8rem 2rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.3s ease;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .actions {
    gap: 1rem;
  }
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #009688, #00796b);
  color: #fff;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.2);
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.25);
}

.btn-secondary:hover {
  filter: brightness(0.9);
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ffd48c, var(--mainbtn-color), #e37400);
  color: #fff;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.25);
}

.btn-apply .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  display: none;
  animation: spin 0.6s linear infinite;
}

.btn-apply.is-loading .spinner {
  display: inline-block;
}

.btn-apply.is-loading #submitFormText {
  opacity: 0.8;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-apply:hover {
  filter: brightness(1.2);
}

.btn-apply:disabled {
  pointer-events: none;
}

/* 確認画面 */
.step-panel {
  display: none;
}

.step-panel.is-active {
  display: block;
}

.confirm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.confirm-table tr:nth-child(odd) {
  background: #f9fafb;
}

.confirm-table th,
.confirm-table td {
  padding: 8px 10px;
  vertical-align: top;
}

.confirm-table th {
  width: 32%;
  text-align: left;
  font-weight: 600;
  color: #4b5563;
  border-right: 1px solid #e5e7eb;
}

.confirm-table td {
  color: #111827;
}

.confirm-note {
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .confirm-table tr {
    padding: 0.5rem;
    display: block;
  }

  .confirm-table th {
    width: 100%;
    color: #009688;
    font-size: 0.85rem;
    border-right: none;
  }

  .confirm-table th,
  .confirm-table td {
    padding: 0;
    display: block;
  }
}

/* 完了画面 */
.complete-box {
  text-align: center;
  padding: 1.5rem 0 0;
}

.complete-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--accent);
  background: #ecfdf5;
}

.complete-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.complete-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.complete-small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.apply-end {
  text-align: center;
  padding: 1rem;
  border: 1.5px solid #e57373;
  background: #fff5f5;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
  font-weight: bold;
}
