/* ============================================================
   就活ことば化AI — アプリ画面 スタイルシート (claudedesign準拠)
   フラットデザイン / グラデーション・影・ぼかし禁止
   font-weight: 400 / 500 のみ
   ============================================================ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --blue-50: #E6F1FB;
  --blue-100: #B5D4F4;
  --blue-200: #85B7EB;
  --blue-400: #378ADD;
  --blue-600: #185FA5;
  --blue-800: #0C447C;
  --blue-900: #042C53;
  --teal-50: #E1F5EE;
  --teal-400: #1D9E75;
  --teal-600: #0F6E56;
  --purple-50: #EEEDFE;
  --purple-600: #534AB7;
  --amber-50: #FAEEDA;
  --amber-600: #854F0B;
  --amber-800: #633806;
  --red-50: #FCEBEB;
  --red-400: #E24B4A;
  --red-600: #A32D2D;
  --green-50: #EAF3DE;
  --green-400: #639922;
  --green-600: #3B6D11;
  --gray-50: #F1EFE8;
  --gray-100: #D3D1C7;
  --gray-200: #B4B2A9;
  --gray-400: #888780;
  --gray-600: #5F5E5A;
  --gray-800: #444441;
  --gray-900: #2C2C2A;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: .25s ease;
}

html { font-size: 16px; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-900);
  line-height: 1.7;
  background: #fafaf8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

/* ── ヘッダー ────────────────────── */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-50);
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.app-logo {
  font-size: 1rem;
  font-weight: 500;
  color: var(--blue-600);
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.app-logo-icon {
  width: 28px; height: 28px;
  background: var(--blue-600);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .7rem; font-weight: 500;
}
.app-back {
  font-size: .85rem;
  color: var(--gray-400);
  text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.app-back:hover { color: var(--blue-600); }

/* ── メインコンテナ ──────────────────── */
.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ── プログレスバー ──────────────────── */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 4px;
}
.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.progress-step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(-50% + 16px);
  right: calc(50% + 16px);
  height: 2px;
  background: var(--gray-100);
  transition: background var(--transition);
}
.progress-step:first-child::before { display: none; }
.progress-step.done::before,
.progress-step.active::before { background: var(--blue-600); }

.progress-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-400);
  transition: background var(--transition), color var(--transition);
  position: relative; z-index: 1;
}
.progress-step.active .progress-dot {
  background: var(--blue-600);
  color: #fff;
}
.progress-step.done .progress-dot {
  background: var(--teal-400);
  color: #fff;
}
.progress-label {
  margin-top: 8px;
  font-size: .72rem;
  color: var(--gray-400);
  font-weight: 500;
  text-align: center;
}
.progress-step.active .progress-label { color: var(--blue-600); font-weight: 500; }
.progress-step.done .progress-label   { color: var(--teal-600); }

/* ── ステップカード ──────────────────── */
.step-panel {
  display: none;
  animation: fadeSlide .35s ease;
}
.step-panel.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-50);
  padding: 32px 28px;
  margin-bottom: 20px;
}
.step-card h2 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
  color: var(--gray-900);
}
.step-card .step-desc {
  font-size: .85rem;
  color: var(--gray-400);
  margin-bottom: 24px;
}

/* ── フォーム ────────────────────── */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--gray-800);
}
.form-group label .required {
  color: var(--red-400);
  font-size: .75rem;
  margin-left: 4px;
}
.form-group label .optional {
  color: var(--gray-400);
  font-size: .75rem;
  font-weight: 400;
  margin-left: 4px;
}
.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue-600);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.form-group .hint {
  font-size: .78rem;
  color: var(--gray-400);
  margin-top: 4px;
}
.form-group .error-msg {
  font-size: .78rem;
  color: var(--red-400);
  margin-top: 4px;
  display: none;
}
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: var(--red-400);
}
.form-group.has-error .error-msg { display: block; }

/* セレクトボタン群 */
.select-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.select-btn {
  padding: 8px 16px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: .85rem;
  font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.select-btn:hover { border-color: var(--blue-400); color: var(--blue-600); }
.select-btn.selected {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}

/* 文字数ボタン */
.char-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.char-btn {
  padding: 8px 18px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: .85rem;
  font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.char-btn:hover { border-color: var(--blue-400); color: var(--blue-600); }
.char-btn.selected {
  background: var(--blue-50);
  border-color: var(--blue-600);
  color: var(--blue-600);
  font-weight: 500;
}

/* ── ナビゲーションボタン ───────────────── */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-primary {
  background: var(--blue-600);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-800); }
.btn-primary:disabled,
.btn-disabled {
  background: var(--gray-200) !important;
  color: var(--gray-400) !important;
  cursor: not-allowed !important;
  pointer-events: none;
}
.btn-secondary {
  background: var(--gray-50);
  color: var(--gray-600);
}
.btn-secondary:hover { background: var(--gray-100); }
.btn-generate {
  background: var(--blue-600);
  color: #fff;
  padding: 14px 36px;
  font-size: .95rem;
}
.btn-generate:hover { background: var(--blue-800); }

/* ── ローディング ────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.9);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loading-overlay.active { display: flex; }

.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--gray-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
}
.loading-sub {
  font-size: .85rem;
  color: var(--gray-400);
}

/* ── 結果画面 ────────────────────── */
.result-section {
  animation: fadeSlide .35s ease;
}
.result-answer-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-50);
  padding: 28px 24px;
  margin-bottom: 20px;
}
.result-answer-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--gray-900);
}
.result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: .8rem;
  color: var(--gray-400);
}
.result-meta .char-count {
  background: var(--blue-50);
  color: var(--blue-600);
  padding: 2px 10px;
  border-radius: var(--radius-md);
  font-weight: 500;
}
.result-answer-text {
  font-size: .92rem;
  line-height: 1.9;
  color: var(--gray-800);
  background: #fafaf8;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-50);
  padding: 20px;
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-copy {
  padding: 8px 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  font-size: .82rem;
  font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-copy:hover { background: var(--gray-100); }
.btn-copy.copied { background: var(--green-50); color: var(--green-600); border-color: var(--green-400); }

/* 文字数変更ボタン（結果画面） */
.result-charlimit {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-50);
}
.result-charlimit p {
  font-size: .82rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.result-charlimit .char-buttons .char-btn {
  font-size: .8rem;
  padding: 6px 14px;
}

/* フィードバックカード */
.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.feedback-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-50);
  padding: 20px;
  border-left: 3px solid;
}
.feedback-card.good     { border-left-color: var(--teal-400); }
.feedback-card.improve  { border-left-color: var(--amber-600); }
.feedback-card.interview{ border-left-color: var(--blue-600); }
.feedback-card.missing  { border-left-color: var(--purple-600); }
.feedback-card.ai-warn  { border-left-color: var(--red-400); }

.feedback-card h4 {
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.feedback-card ul {
  list-style: none;
  padding: 0;
}
.feedback-card li {
  font-size: .84rem;
  color: var(--gray-600);
  line-height: 1.7;
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.feedback-card li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gray-200);
}

/* 面接質問カードはフルワイド */
.feedback-full {
  grid-column: 1 / -1;
}

/* ── 結果画面の大ブロック共通 ─────────────── */
.result-block {
  margin: 28px 0;
}
.result-block-title {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.result-block-desc {
  font-size: .82rem;
  color: var(--gray-400);
  margin-bottom: 14px;
}
.review-section-note {
  font-size: .8rem;
  color: var(--gray-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.review-section-note a { color: var(--blue-600); font-weight: 500; }

/* ── ES品質スコア（観点別評価） ─────────────── */
.quality-card {
  background: #fff;
  border: 1px solid var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 28px;
  align-items: stretch;
}
.quality-overall {
  flex-shrink: 0;
  min-width: 120px;
  text-align: center;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--gray-50);
  padding-right: 24px;
}
.quality-overall-num {
  font-size: 2.1rem;
  font-weight: 500;
  color: var(--blue-600);
  line-height: 1.2;
}
.quality-overall-num small {
  font-size: .9rem;
  color: var(--gray-400);
  font-weight: 400;
}
.quality-overall-label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-800);
  margin-top: 2px;
}
.quality-overall-level {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: 2px;
}
.quality-axes { flex: 1; min-width: 0; }
.quality-axis {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-50);
}
.quality-axis:last-child { border-bottom: none; }
.quality-axis-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px;
}
.quality-axis-label {
  font-size: .84rem;
  font-weight: 500;
  color: var(--gray-800);
}
.quality-axis-score { font-size: .88rem; font-weight: 500; }
.quality-axis-score small { font-size: .7rem; color: var(--gray-400); font-weight: 400; }
.q-high { color: var(--teal-600); }
.q-mid  { color: var(--amber-600); }
.q-low  { color: var(--red-600); }
.quality-bar { display: flex; gap: 4px; }
.quality-seg {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--gray-50);
}
.quality-seg.filled.q-high { background: var(--teal-400); }
.quality-seg.filled.q-mid  { background: #D29A2B; }
.quality-seg.filled.q-low  { background: var(--red-400); }
.quality-axis-comment {
  font-size: .78rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-top: 5px;
}

/* ── 面接対策セクション ─────────────── */
.interview-prep {
  background: #fff;
  border: 1px solid var(--blue-100);
  border-left: 3px solid var(--blue-600);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.prep-sub { margin-top: 18px; }
.prep-sub-title {
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-900);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px;
}
.prep-step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--blue-600);
  color: #fff;
  font-size: .72rem; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prep-sub-desc {
  font-size: .78rem;
  color: var(--gray-400);
  margin: 0 0 10px 28px;
}
.prep-question-list {
  margin-left: 28px;
}
.prep-question-list .interview-q-item {
  padding: 10px 0;
}
.prep-limit-note {
  font-size: .78rem;
  color: var(--gray-400);
  margin: 6px 0 0 28px;
}
.prep-limit-note a { color: var(--blue-600); }
.prep-sub .deep-dive-card { margin-left: 28px; }

/* ── アップセルCTA ──────────────────── */
.upsell-section {
  background: #fff;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  padding: 0;
  margin: 20px 0;
  overflow: hidden;
}
.upsell-header {
  padding: 20px 24px 12px;
}
.upsell-header h4 {
  font-size: .95rem;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.upsell-header p {
  font-size: .8rem;
  color: var(--gray-400);
}
/* プラン別グループ */
.upsell-plan-group {
  border-top: 1px solid var(--gray-100);
}
.upsell-plan-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 24px 0;
  text-decoration: none;
}
.upsell-plan-name {
  font-size: .92rem;
  font-weight: 500;
}
.upsell-plan-group.plan-light .upsell-plan-name { color: var(--blue-600); }
.upsell-plan-group.plan-standard .upsell-plan-name { color: var(--purple-600); }
.upsell-plan-price {
  font-size: .78rem;
  color: var(--gray-400);
}
.upsell-plan-link {
  margin-left: auto;
  font-size: .76rem;
  font-weight: 500;
  color: var(--blue-600);
  white-space: nowrap;
}
.upsell-plan-head:hover .upsell-plan-link { text-decoration: underline; }
.upsell-plan-lead {
  font-size: .76rem;
  color: var(--gray-400);
  padding: 2px 24px 6px;
}
.upsell-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  cursor: pointer;
}
.upsell-item:hover { background: var(--blue-50); }
.upsell-item-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}
.upsell-item-body { flex: 1; min-width: 0; }
.upsell-item-title {
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-900);
}
.upsell-item-desc {
  font-size: .78rem;
  color: var(--gray-400);
  margin-top: 1px;
}
.upsell-footer {
  text-align: center;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--gray-50);
}

/* ── 新規作成ボタン ──────────────────── */
.result-new {
  text-align: center;
  margin-top: 24px;
}

/* ── 残り回数表示 ────────────────────── */
.remaining-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--amber-50);
  color: var(--amber-800);
  border-radius: var(--radius-md);
  font-size: .78rem;
  font-weight: 500;
}

/* ── ESカテゴリタブ（経験入力 Step 2） ──────────── */
.es-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
  padding: 4px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}
.es-cat-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: .82rem;
  font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.es-cat-tab:hover {
  background: #fff;
  color: var(--gray-900);
}
.es-cat-tab.active {
  background: #fff;
  border-color: var(--blue-400);
  color: var(--blue-600);
  font-weight: 500;
}
.es-cat-tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.es-cat-tab-dot.filled {
  background: var(--green-400);
}
.es-cat-tab-dot.empty {
  background: var(--gray-200);
}

/* ── レスポンシブ ────────────────────── */
/* タブレット */
@media (max-width: 768px) {
  .app-header { padding: 0 16p