/* ====================================================
   GENBA ENTRY — Design System v2
   炭黒 #1A1A1A | 安全黄 #FFD700 | クリーム #F5F5F0
   ==================================================== */

/* ─── CSS Variables ─────────────────────────────────── */
:root {
  --ge-dark:   #1A1A1A;
  --ge-yellow: #FFD700;
  --ge-cream:  #F5F5F0;
  --ge-muted:  #6B7280;
  --ge-border: #E5E7EB;
  --ge-danger: #E53E3E;
}

body { background: var(--ge-cream); }

/* ─── ヘッダー ──────────────────────────────────────── */
.ge-header {
  background: var(--ge-dark);
  color: var(--ge-cream);
  padding: .75rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
@media (min-width: 768px) { .ge-header { padding: 1rem 1.5rem; } }
.ge-header-accent { height: 4px; background: var(--ge-yellow); }

/* ─── フォームカード ────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid var(--ge-border);
  border-radius: .5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* ─── ステッパー ────────────────────────────────────── */
.stepper { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.step-item { display: flex; align-items: center; flex: 1; min-width: 0; }
.step-circle {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.step-circle.done   { background: var(--ge-dark); color: #fff; }
.step-circle.active { background: var(--ge-yellow); color: var(--ge-dark); }
.step-circle.todo   { background: var(--ge-border); color: var(--ge-muted); }
.step-label         { font-size: .65rem; margin-top: 2px; text-align: center; white-space: nowrap; }
.step-label-active  { color: var(--ge-dark); font-weight: 700; }
.step-label-done    { color: var(--ge-muted); }
.step-label-todo    { color: #9CA3AF; }
.step-line { flex: 1; height: 2px; background: var(--ge-border); margin: 0 2px; margin-bottom: 18px; }
.step-line.done { background: var(--ge-dark); }

/* ─── セクションタイトル ────────────────────────────── */
.step-section-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--ge-dark);
  margin-bottom: .75rem;
  padding-left: .75rem;
  border-left: 4px solid var(--ge-yellow);
}

/* ─── フォーム要素 ──────────────────────────────────── */
.f-label { display: block; font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: 3px; }
.f-input, .f-select, .f-textarea {
  width: 100%; padding: .45rem .65rem;
  border: 1px solid #d1d5db; border-radius: .375rem;
  font-size: .875rem; color: #111;
  transition: border-color .15s, border-left-width .1s;
  box-sizing: border-box; background: #fff;
}
.f-input:focus, .f-select:focus, .f-textarea:focus {
  outline: none;
  border-color: var(--ge-yellow);
  border-left: 3px solid var(--ge-yellow);
  box-shadow: none;
}
.f-textarea { min-height: 64px; resize: vertical; }
.f-select { background: #fff; }
.f-radio-group { display: flex; flex-wrap: wrap; gap: .75rem; }
.f-radio-label { display: flex; align-items: center; gap: .35rem; font-size: .875rem; cursor: pointer; }
.f-radio-label input[type="radio"] { accent-color: var(--ge-dark); }
.f-error { font-size: .75rem; color: var(--ge-danger); margin-top: 3px; }

/* ─── ボタン ────────────────────────────────────────── */
.btn-primary {
  background: var(--ge-yellow); color: var(--ge-dark); font-weight: 700;
  padding: .55rem 1.25rem; border-radius: .375rem; border: none;
  font-size: .875rem; cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .02em;
}
.btn-primary:hover:not(:disabled) { background: #e6c200; }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  background: #fff; color: var(--ge-dark); font-weight: 600;
  padding: .55rem 1.25rem; border-radius: .375rem;
  border: 2px solid var(--ge-dark);
  font-size: .875rem; cursor: pointer; transition: background .15s;
}
.btn-secondary:hover { background: var(--ge-cream); }

/* ─── アラート ──────────────────────────────────────── */
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; border-radius: .375rem; padding: .75rem; color: #991b1b; font-size: .875rem; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; border-radius: .375rem; padding: .75rem; color: #92400e; font-size: .875rem; }
.alert-info    { background: #f9f9f6; border: 1px solid #d1d5db; border-left: 4px solid var(--ge-dark); border-radius: .375rem; padding: .75rem; color: #374151; font-size: .875rem; }

/* ─── 教育セクションタブ ────────────────────────────── */
.edu-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.edu-tab {
  padding: .3rem .7rem; border-radius: 4px; font-size: .75rem; font-weight: 600;
  border: 2px solid var(--ge-border); background: #fff; color: var(--ge-muted);
  cursor: pointer; transition: all .15s;
}
.edu-tab.active { background: var(--ge-yellow); color: var(--ge-dark); border-color: var(--ge-yellow); }
.edu-tab.done   { background: var(--ge-dark); color: #fff; border-color: var(--ge-dark); }

/* 教育確認ボタン 3状態 */
.edu-confirm-btn-locked {
  width: 100%; padding: .75rem; border-radius: .375rem; font-weight: 600;
  font-size: .875rem; margin-bottom: .75rem; cursor: not-allowed;
  background: #e5e7eb; color: #9ca3af; border: none; display: block;
}
.edu-confirm-btn-active {
  width: 100%; padding: .75rem; border-radius: .375rem; font-weight: 700;
  font-size: .875rem; margin-bottom: .75rem; cursor: pointer; border: none; display: block;
  background: var(--ge-yellow); color: var(--ge-dark);
  transition: background .15s, transform .1s;
}
.edu-confirm-btn-active:hover { background: #e6c200; }
.edu-confirm-btn-active:active { transform: scale(.98); }
.edu-confirm-btn-done {
  width: 100%; padding: .75rem; border-radius: .375rem; font-weight: 600;
  font-size: .875rem; margin-bottom: .75rem; cursor: default; border: none; display: block;
  background: var(--ge-dark); color: #fff;
}

/* ─── 署名キャンバス ────────────────────────────────── */
#sig-canvas {
  border: 2px dashed #d1d5db; border-radius: .375rem;
  width: 100%; height: 150px; touch-action: none;
  cursor: crosshair; background: #fff;
}
#sig-canvas.signed { border: 2px solid var(--ge-yellow); }

/* ─── カメラモーダル ────────────────────────────────── */
#camera-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
#camera-video { width: 100%; min-height: 240px; border-radius: .5rem; background: #000; display: block; }

/* ─── 進捗バー ──────────────────────────────────────── */
.progress-bar-wrap { background: #e5e7eb; border-radius: 9999px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--ge-yellow); transition: width .3s; border-radius: 9999px; }

/* ─── 資格チェックボックス ──────────────────────────── */
.f-cb-label { display: flex; align-items: center; gap: .45rem; font-size: .875rem; cursor: pointer; padding: .15rem 0; }
.f-cb-label input[type="checkbox"] { width: 1rem; height: 1rem; flex-shrink: 0; accent-color: var(--ge-dark); cursor: pointer; }
.f-cb-item { display: flex; flex-direction: column; gap: .25rem; }
.f-input-sub {
  margin-left: 1.5rem; padding: .3rem .55rem;
  border: 1px solid #d1d5db; border-radius: .375rem;
  font-size: .8rem; width: calc(100% - 1.5rem); box-sizing: border-box;
}

/* ─── 修了証 (complete.php) ─────────────────────────── */
.certificate-wrap {
  border: 3px solid var(--ge-dark); border-radius: .5rem;
  padding: 1.5rem; background: #fff; position: relative; text-align: center;
}
.certificate-inner {
  border: 1.5px solid #9CA3AF; border-radius: .25rem; padding: 1.25rem;
}
.certificate-title {
  font-size: 1.15rem; font-weight: 900; letter-spacing: .08em;
  color: var(--ge-dark); margin-bottom: .5rem;
}
.certificate-divider { border: none; border-top: 2px solid var(--ge-dark); margin: .75rem 0; }
.certificate-stamp {
  display: inline-block;
  border: 3px solid #C0392B; color: #C0392B;
  font-weight: 900; font-size: .95rem; padding: .35rem .9rem;
  border-radius: 4px; transform: rotate(-12deg);
  letter-spacing: .12em; margin: .75rem 0;
}
.certificate-row {
  display: flex; justify-content: space-between;
  font-size: .875rem; padding: .35rem 0;
  border-bottom: 1px dotted #d1d5db; text-align: left; gap: .5rem;
}
.certificate-row-label { color: var(--ge-muted); font-size: .8rem; white-space: nowrap; }
.certificate-row-value { font-weight: 600; color: var(--ge-dark); }

/* ─── リール日付ピッカー v2 ─────────────────────────── */
.rp-trigger {
  display: flex; align-items: center; gap: .45rem; width: 100%;
  padding: .48rem .7rem; border: 1px solid #d1d5db; border-radius: .375rem;
  background: #fff; cursor: pointer; font-size: .875rem; color: #111827;
  transition: border-color .15s; box-sizing: border-box; user-select: none;
}
.rp-trigger:hover { border-color: var(--ge-yellow); }
.rp-trigger-icon  { color: #6b7280; flex-shrink: 0; display: flex; align-items: center; }
.rp-trigger-text  { flex: 1; }
.rp-trigger-arrow { color: #9ca3af; font-size: .7rem; }

.rp-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 9999; opacity: 0; transition: opacity .22s ease;
}
.rp-modal-overlay.rp-open { opacity: 1; }
.rp-modal {
  background: #fff; border-radius: 22px 22px 0 0; width: 100%; max-width: 480px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -12px 48px rgba(0,0,0,.18);
}
.rp-modal-overlay.rp-open .rp-modal { transform: translateY(0); }
.rp-drag-handle { width: 36px; height: 4px; background: #e2e8f0; border-radius: 2px; margin: 12px auto 0; }
.rp-modal-header { padding: 8px 20px 14px; border-bottom: 1px solid #f1f5f9; }
.rp-modal-hd-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.rp-modal-title  { font-size: 1rem; font-weight: 700; color: #0f172a; }
.rp-era-btn {
  padding: 4px 14px; font-size: .72rem; font-weight: 700;
  background: var(--ge-dark); color: var(--ge-yellow);
  border: 1.5px solid var(--ge-dark); border-radius: 20px;
  cursor: pointer; letter-spacing: .03em; transition: background .15s;
}
.rp-era-btn:hover { background: #333; }
.rp-reel-area { position: relative; height: 240px; overflow: hidden; margin: 2px 0; background: #fff; }
.rp-cols { display: flex; height: 240px; padding: 0 20px; }
.rp-fade { position: absolute; left: 0; right: 0; height: 88px; pointer-events: none; z-index: 2; }
.rp-fade-top { top: 0; background: linear-gradient(to bottom, rgba(255,255,255,1) 30%, rgba(255,255,255,0)); }
.rp-fade-bot { bottom: 0; background: linear-gradient(to top, rgba(255,255,255,1) 30%, rgba(255,255,255,0)); }
.rp-center-line {
  position: absolute; left: 20px; right: 20px; top: 50%; transform: translateY(-50%);
  height: 48px; border-top: 2px solid var(--ge-yellow); border-bottom: 2px solid var(--ge-yellow);
  border-radius: 4px; background: rgba(255,215,0,.1);
  pointer-events: none; z-index: 1;
}
.rp-col-wrap { flex: 1; min-width: 0; }
.rp-col { position: relative; width: 100%; height: 240px; overflow: hidden; cursor: grab; outline: none; }
.rp-col:active { cursor: grabbing; }
.rp-col-inner { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.rp-item {
  height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 500; color: #374151; user-select: none; white-space: nowrap;
}
.rp-labels { display: flex; padding: 0 20px; }
.rp-col-label { flex: 1; text-align: center; font-size: .62rem; font-weight: 600; color: #94a3b8; letter-spacing: .05em; padding: 4px 0 5px; }
.rp-modal-footer { display: flex; gap: 10px; padding: 10px 20px 22px; }
.rp-btn { flex: 1; padding: .7rem; border-radius: 14px; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background .15s, transform .1s; }
.rp-btn:active { transform: scale(.97); }
.rp-btn-cancel { flex: 1; border: 1.5px solid #e5e7eb; background: #f8fafc; color: #475569; }
.rp-btn-cancel:hover { background: #f1f5f9; }
.rp-btn-confirm { flex: 2; border: none; background: var(--ge-dark); color: var(--ge-yellow); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.rp-btn-confirm:hover { background: #333; }

/* ─── レスポンシブ補完 ──────────────────────────────── */
.header-logo { height: 44px; width: auto; }
@media (min-width: 480px) { .header-logo { height: 60px; } }

@media (max-width: 540px) {
  .step-label { display: none; }
  .step-circle { width: 1.75rem; height: 1.75rem; }
  .step-line { margin-bottom: 0; }
  .stepper { padding-bottom: 0; }
}
@media (max-width: 380px) { .form-2col { grid-template-columns: 1fr !important; } }
@media (max-width: 360px) {
  .nav-btns { flex-direction: column-reverse !important; align-items: stretch; gap: .5rem; }
  .nav-btns > button, .nav-btns > a { width: 100%; text-align: center; display: block; }
}
@media (max-width: 380px) { .form-card { padding: .875rem; } }
@media (max-width: 639px) {
  .btn-primary, .btn-secondary { min-height: 42px; }
  .f-input, .f-select { min-height: 40px; }
}

/* ─── 教育コンテンツエリア ───────────────────────────── */
#eduContent { overflow: hidden; }

/* ─── セクション見出し（カード全幅バナー） ──────────── */
.edu-section-title {
  font-size: 1rem; font-weight: 800;
  color: var(--ge-dark); letter-spacing: .04em;
  margin: -1.25rem -1.25rem .75rem;
  padding: .6rem 1.25rem;
  background: var(--ge-yellow);
}

/* ─── Markdownレンダリング（学習コンテンツ風） ──────── */
.edu-md-block { margin-bottom: .6rem; font-size: .9rem; line-height: 1.75; color: #1f2937; }
.edu-md-block:last-child { margin-bottom: 0; }

.edu-md-block p { margin: 0 0 .35rem; }
.edu-md-block p:last-child { margin-bottom: 0; }

/* h1 = 大項目バナー（黒地×黄文字） */
.edu-md-block h1 {
  font-size: .9375rem; font-weight: 800; letter-spacing: .04em;
  margin: .75rem 0 .5rem; padding: .45rem .75rem;
  background: var(--ge-dark); color: var(--ge-yellow);
  border-radius: .375rem;
}
/* h2 = 中項目（黄色左ボーダー＋薄黄背景） */
.edu-md-block h2 {
  font-size: .875rem; font-weight: 700;
  margin: .6rem 0 .3rem; padding: .3rem .6rem .3rem .75rem;
  border-left: 4px solid var(--ge-yellow);
  background: #fffde7; border-radius: 0 .25rem .25rem 0;
  color: var(--ge-dark);
}
/* h3 = 小項目 */
.edu-md-block h3 {
  font-size: .875rem; font-weight: 700;
  margin: .5rem 0 .2rem; padding-left: .75rem;
  border-left: 2px solid #d1d5db; color: #374151;
}

/* ul = チェックボックス風リスト */
.edu-md-block ul { list-style: none; padding-left: 0; margin: .3rem 0 .5rem; }
.edu-md-block ul li {
  position: relative;
  padding: .3rem .4rem .3rem 1.8rem;
  margin-bottom: .2rem;
  background: #f9fafb; border: 1px solid #f3f4f6; border-radius: .25rem;
  line-height: 1.55;
}
.edu-md-block ul li::before {
  content: '•';
  position: absolute; left: .5rem; top: .3rem;
  color: var(--ge-dark); font-weight: 700; font-size: .85rem;
}

/* ol = 番号バッジ付きリスト */
.edu-md-block ol { list-style: none; counter-reset: edu-ol; padding-left: 0; margin: .3rem 0 .5rem; }
.edu-md-block ol li {
  counter-increment: edu-ol;
  position: relative;
  padding: .3rem .4rem .3rem 2.1rem;
  margin-bottom: .25rem; line-height: 1.55;
}
.edu-md-block ol li::before {
  content: counter(edu-ol);
  position: absolute; left: .25rem; top: .3rem;
  width: 1.4rem; height: 1.4rem;
  background: var(--ge-dark); color: var(--ge-yellow);
  border-radius: 50%; font-size: .7rem; font-weight: 700;
  text-align: center; line-height: 1.4rem;
}

/* blockquote = ⚠警告ボックス */
.edu-md-block blockquote {
  border-left: none;
  background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: .375rem;
  padding: .6rem .75rem .6rem 2.25rem;
  color: #78350f; margin: .4rem 0; position: relative;
}
.edu-md-block blockquote::before {
  content: '⚠'; position: absolute; left: .6rem; top: .55rem; font-size: .95rem;
}
.edu-md-block blockquote p { margin: 0; }

/* strong = 黄色ハイライト */
.edu-md-block strong, .edu-md-block b {
  font-weight: 700; color: var(--ge-dark);
  background: rgba(255,215,0,.3); padding: .05rem .2rem; border-radius: .2rem;
}
.edu-md-block em, .edu-md-block i { font-style: italic; color: #6b7280; }
.edu-md-block del { text-decoration: line-through; }

/* code = 黒地×黄文字 */
.edu-md-block code {
  background: #1a1a1a; color: #ffd700;
  padding: .1rem .35rem; border-radius: .25rem; font-family: monospace; font-size: .875em;
}

/* hr = 黄色グラデーション区切り */
.edu-md-block hr {
  border: none; height: 2px;
  background: linear-gradient(to right, var(--ge-yellow), transparent);
  margin: .6rem 0;
}

/* GFMチェックボックス（タスクリスト） — JS が .edu-tasklist クラスを付与 */
.edu-md-block ul.edu-tasklist { padding-left: 0; }
.edu-md-block ul.edu-tasklist li { background: none; border: none; padding-left: 0; }
.edu-md-block ul.edu-tasklist li::before { display: none; }
.edu-md-block ul.edu-tasklist li input[type="checkbox"] { margin-right: .35rem; pointer-events: none; vertical-align: middle; accent-color: var(--ge-dark); }

/* 確認完了テキスト */
.edu-confirm-note {
  position: relative;
  margin-top: .75rem; padding: .5rem .75rem .5rem 2rem;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: .375rem;
  font-size: .875rem; font-weight: 600; color: #15803d;
}
.edu-confirm-note::before { content: '✓'; position: absolute; left: .65rem; top: .5rem; font-weight: 900; }

@media (min-width: 768px) {
  .f-label { font-size: 1rem; margin-bottom: 5px; }
  .f-input, .f-select { font-size: 1rem; padding: .6rem .9rem; min-height: 46px; }
  .f-textarea { font-size: 1rem; padding: .6rem .9rem; min-height: 88px; }
  .f-radio-label { font-size: 1rem; gap: .5rem; }
  .f-cb-label    { font-size: 1rem; }
  .f-error       { font-size: .85rem; }
  .f-input-sub   { font-size: .9rem; }
  .btn-primary, .btn-secondary { font-size: 1rem; padding: .75rem 2rem; min-height: 48px; }
  .form-card { padding: 1.75rem; margin-bottom: 1.25rem; }
  .step-circle { width: 2.25rem; height: 2.25rem; font-size: .85rem; }
  .step-label  { font-size: .75rem; }
  .step-line   { margin-bottom: 22px; }
  .step-section-title { font-size: 1.3rem; }
  .form-card h3 { font-size: .95rem; }
  .rp-trigger { font-size: 1rem; min-height: 46px; padding: .6rem .9rem; }
  #sig-canvas { height: 200px; }
  .alert-error, .alert-warning, .alert-info { font-size: .95rem; }
  .edu-confirm-btn-locked,
  .edu-confirm-btn-active,
  .edu-confirm-btn-done { font-size: 1rem; padding: .875rem; }
  .edu-section-title { margin: -1.75rem -1.75rem .75rem; padding: .7rem 1.75rem; font-size: 1.075rem; }
  .edu-md-block { font-size: .9375rem; }
  .edu-md-block h2 { font-size: .9375rem; }
  .edu-md-block h3 { font-size: .9rem; }
  .edu-confirm-note { font-size: .9375rem; }
}
