/* ============================================================
   join.css — 入会申込フォームページ 専用スタイル
   ============================================================ */

html { scroll-padding-top: 88px; }

/* ============================================================
   STEPPER（進行ステップ表示）
   ============================================================ */
.step-item { transition: opacity .4s ease; }

.step-dot {
  transition: background-color .4s ease, color .4s ease, transform .3s ease;
}

/* アクティブステップのドットを拡大 */
.step-item.is-active .step-dot {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(255,255,255,.35);
}

/* 完了ステップ */
.step-item.is-done .step-dot {
  background-color: rgba(255,255,255,.9) !important;
  color: #16a34a !important;
}

.step-line {
  transition: background-color .5s ease;
}
.step-line.is-done {
  background-color: rgba(255,255,255,.75) !important;
}

/* ============================================================
   FORM BLOCKS（セクション単位のカード）
   ============================================================ */
.form-block {
  background: #fff;
  border-radius: 1.5rem;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: box-shadow .3s ease;
}
.form-block:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.09);
}

.form-block-header {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1.125rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.form-block-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.form-block-title {
  font-size: .9375rem;
  font-weight: 700;
  color: #1e293b;
  font-family: 'Noto Serif JP', serif;
}

.form-block-body {
  padding: 1.5rem;
}

/* ============================================================
   FIELD 共通
   ============================================================ */
.field-wrap { position: relative; }

.field-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .5rem;
  line-height: 1.4;
}

.required-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  color: #ef4444;
  margin-left: .25rem;
}

.optional-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: .25rem;
  padding: .1em .4em;
  margin-left: .375rem;
  vertical-align: middle;
}

.field-input {
  width: 100%;
  padding: .75rem 1rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: .75rem;
  font-size: .875rem;
  color: #1e293b;
  font-family: 'Noto Sans JP', sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  line-height: 1.6;
}
.field-input::placeholder { color: #94a3b8; }
.field-input:hover  { border-color: #cbd5e1; background: #fff; }
.field-input:focus  {
  outline: none;
  border-color: #4ade80;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74,222,128,.15);
}
.field-input.has-error {
  border-color: #f87171;
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(248,113,113,.12);
}
.field-input.is-valid {
  border-color: #4ade80;
  background: #f0fdf4;
}

textarea.field-input { min-height: 8rem; }

.field-error {
  font-size: .75rem;
  color: #ef4444;
  margin-top: .375rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.field-error::before {
  content: '⚠';
  font-size: .7rem;
}

.field-hint {
  font-size: .7rem;
  color: #94a3b8;
}

/* ============================================================
   CHECKBOX CARDS（専門分野）
   ============================================================ */
.checkbox-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-face {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .875rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: .75rem;
  font-size: .8125rem;
  font-weight: 500;
  color: #475569;
  transition: all .2s ease;
  user-select: none;
}

.checkbox-card:hover .checkbox-face {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.checkbox-input:checked + .checkbox-face {
  border-color: #4ade80;
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(74,222,128,.25);
}

.checkbox-input:focus-visible + .checkbox-face {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}

/* ============================================================
   文字カウンター
   ============================================================ */
#motivation-count {
  transition: color .2s ease;
}
#motivation-count.count-warning { color: #f97316; font-weight: 600; }
#motivation-count.count-ok      { color: #22c55e; font-weight: 600; }

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.submit-btn {
  position: relative;
  overflow: hidden;
}
.submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.18);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform .45s ease;
}
.submit-btn:not(:disabled):hover::after {
  transform: translateX(110%) skewX(-15deg);
}

/* ============================================================
   CONFIRM TABLE（確認画面）
   ============================================================ */
.confirm-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color .15s ease;
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row:hover { background: #fafafa; }

.confirm-th {
  padding: .875rem 1rem;
  background: #f8fafc;
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: flex;
  align-items: flex-start;
  padding-top: 1rem;
  border-right: 1px solid #f1f5f9;
}

.confirm-td {
  padding: .875rem 1.25rem;
  font-size: .875rem;
  color: #1e293b;
  line-height: 1.7;
  word-break: break-all;
}

@media (max-width: 480px) {
  .confirm-row {
    grid-template-columns: 1fr;
  }
  .confirm-th {
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: .375rem;
  }
  .confirm-td { padding-top: .375rem; }
}

/* ============================================================
   SUCCESS ICON（完了画面）
   ============================================================ */
@keyframes scaleIn {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes ringPulse {
  0%   { transform: scale(.8); opacity: 0; }
  50%  { opacity: .4; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes checkDraw {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0;  }
}

.success-icon-wrap {
  position: relative;
  width: 7rem;
  height: 7rem;
}

.success-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #4ade80;
  animation: ringPulse 1.6s ease-out .3s forwards;
  opacity: 0;
}

.success-icon-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(74,222,128,.4);
  animation: scaleIn .55s cubic-bezier(.34,1.56,.64,1) forwards;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .form-block-body { padding: 1.25rem 1rem; }
  .form-block-header { padding: .875rem 1rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .success-icon-ring,
  .success-icon-inner { animation: none !important; }
  .success-icon-inner { opacity: 1; }
  .submit-btn::after  { display: none; }
}
