/* ============================================================
   ディセクテラ 従業員フォーム スタイル
   ============================================================ */

:root {
  --navy: #1A2E4A;
  --navy-mid: #2D4A70;
  --navy-light: #3D6A9A;
  --gold: #E8A020;
  --gold-light: #F5C842;
  --bg: #F0F4F8;
  --white: #FFFFFF;
  --text: #1A1A2E;
  --text-sub: #5A6A7E;
  --success: #2ECC71;
  --warn: #E67E22;
  --danger: #E74C3C;
  --border: #DDE3EC;
  --shadow: 0 2px 16px rgba(26,46,74,0.10);
  --shadow-lg: 0 8px 32px rgba(26,46,74,0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   認証画面
   ============================================================ */
.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #4A7AB5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-container {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
}

.auth-header {
  background: var(--navy);
  padding: 36px 32px 28px;
  text-align: center;
  color: var(--white);
}

.auth-logo {
  width: 60px; height: 60px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: var(--white);
  margin: 0 auto 16px;
}

.auth-title { font-size: 20px; font-weight: 700; letter-spacing: 0.05em; }
.auth-subtitle { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1; padding: 14px;
  background: #F5F7FA;
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  color: var(--text-sub);
  transition: all 0.2s;
  font-family: inherit;
}

.auth-tab.active {
  background: var(--white);
  color: var(--navy);
  border-bottom: 2px solid var(--gold);
}

.auth-form { padding: 28px 32px 32px; }

.register-note {
  background: #EEF6FF;
  border-left: 3px solid var(--navy-light);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--navy-mid);
  margin-bottom: 20px;
  line-height: 1.6;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.required { color: var(--danger); font-size: 11px; }

.form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus { outline: none; border-color: var(--navy-light); }

.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 40px; }

.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-sub); font-size: 14px;
}

.auth-btn {
  width: 100%; padding: 14px;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  margin-top: 8px;
}

.auth-btn:hover { background: var(--navy-mid); transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }

.auth-error {
  margin: 0 32px 20px;
  padding: 10px 14px;
  background: #FFF0F0;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--danger);
}

.hidden { display: none !important; }

/* ============================================================
   メニュー画面
   ============================================================ */
.menu-bg {
  min-height: 100vh;
  background: var(--bg);
  padding: 0 0 40px;
}

.menu-container { max-width: 640px; margin: 0 auto; padding: 0 20px; }

.menu-header {
  background: var(--navy);
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
  position: sticky; top: 0; z-index: 100;
}

.menu-logo {
  width: 44px; height: 44px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: var(--white);
  flex-shrink: 0;
}

.menu-user-info { flex: 1; }
.menu-user-name { font-size: 16px; font-weight: 700; color: var(--white); }
.menu-user-sub { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }

.logout-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.25); }

.menu-cards { display: flex; flex-direction: column; gap: 16px; }

.menu-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}

.menu-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--navy-light);
}

.menu-card.primary { border-color: var(--gold); }
.menu-card.disabled { cursor: default; opacity: 0.6; }

.menu-card-icon {
  width: 52px; height: 52px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--white);
  flex-shrink: 0;
}

.menu-card.primary .menu-card-icon { background: var(--gold); }

.menu-card-body { flex: 1; }
.menu-card-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.menu-card-desc { font-size: 13px; color: var(--text-sub); margin-top: 4px; }

.menu-card-arrow { color: var(--text-sub); font-size: 16px; }

/* ============================================================
   フォーム画面
   ============================================================ */
.form-wrapper { min-height: 100vh; background: var(--bg); padding-bottom: 100px; }

.form-top-bar {
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  position: sticky; top: 0; z-index: 100;
}

.back-to-menu-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.8);
  font-size: 13px; cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.back-to-menu-btn:hover { color: var(--white); }

.form-top-title {
  font-size: 14px; font-weight: 700;
  color: var(--white);
}

.save-draft-btn {
  background: rgba(232,160,32,0.2);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.2s;
}
.save-draft-btn:hover { background: rgba(232,160,32,0.35); }

.progress-bar-wrapper {
  background: var(--white);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.progress-bar-track {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-light), var(--gold));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-info {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-sub);
  margin-top: 4px;
}

.draft-saved-msg { color: var(--success); font-size: 11px; }

.form-body { max-width: 760px; margin: 0 auto; padding: 24px 20px; }

.section-header { margin-bottom: 24px; }

.section-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  margin-bottom: 8px;
}

.section-badge.choice { background: #EEF2FF; color: var(--navy); }
.section-badge.text { background: #FFF8E7; color: #9A6000; }

.section-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.section-desc { font-size: 13px; color: var(--text-sub); }

.questions-list { display: flex; flex-direction: column; gap: 16px; }

.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.question-card.answered { border-color: rgba(46,204,113,0.4); }

.question-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}

.question-number {
  background: var(--navy);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
}

.text-question .question-number { background: var(--gold); }

.question-category {
  font-size: 11px;
  color: var(--text-sub);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 20px;
}

.question-text {
  font-size: 14px; line-height: 1.8;
  color: var(--text);
  margin-bottom: 16px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.option-label {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.option-label:hover { border-color: var(--navy-light); background: #F5F8FF; }
.option-label.selected { border-color: var(--navy); background: #EEF2FF; }

.option-label input[type="radio"] { display: none; }

.option-value {
  width: 24px; height: 24px;
  background: var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-sub);
  flex-shrink: 0;
  transition: all 0.15s;
}

.option-label.selected .option-value {
  background: var(--navy);
  color: var(--white);
}

.option-text { font-size: 12px; color: var(--text); line-height: 1.4; }

.question-hint {
  background: #FFFBEE;
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  font-size: 12px; color: #7A5500;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.6;
}

.text-answer-area {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text);
  resize: vertical; font-family: inherit;
  line-height: 1.8;
  transition: border-color 0.2s;
}

.text-answer-area:focus { outline: none; border-color: var(--navy-light); }

.char-count {
  font-size: 11px; color: var(--text-sub);
  margin-top: 4px; text-align: right;
}

.char-count.warn { color: var(--warn); }

/* ナビゲーション */
.form-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  z-index: 100;
}

.nav-btn {
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 700;
  cursor: pointer; border: none;
  font-family: inherit;
  display: flex; align-items: center; gap: 8px;
  transition: all 0.15s;
}

.nav-btn.primary { background: var(--navy); color: var(--white); }
.nav-btn.primary:hover { background: var(--navy-mid); transform: translateY(-1px); }
.nav-btn.secondary { background: var(--bg); color: var(--navy); border: 1.5px solid var(--border); }
.nav-btn.secondary:hover { background: var(--border); }
.nav-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ============================================================
   確認画面
   ============================================================ */
.confirm-container {
  max-width: 480px; margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.confirm-icon { font-size: 48px; color: var(--navy); margin-bottom: 20px; }
.confirm-title { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 24px; }

.confirm-stats { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.confirm-stat {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}

.confirm-stat.ok { background: #F0FFF4; color: #1E7A4A; }
.confirm-stat.warn { background: #FFF8E7; color: var(--warn); }

.confirm-warning {
  background: #FFF3CD;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px; color: #7A5500;
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.6;
}

.confirm-desc { font-size: 13px; color: var(--text-sub); margin-bottom: 28px; line-height: 1.6; }

.confirm-actions { display: flex; gap: 12px; justify-content: center; }
.confirm-actions .nav-btn { padding: 12px 24px; }

/* ============================================================
   完了画面
   ============================================================ */
.done-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.done-container {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.done-animation { margin-bottom: 24px; }

.done-circle {
  width: 80px; height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--white);
  margin: 0 auto;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.done-title { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.done-desc { font-size: 14px; color: var(--text-sub); line-height: 1.8; margin-bottom: 32px; }

.done-btn {
  padding: 14px 32px;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.2s;
}
.done-btn:hover { background: var(--navy-mid); }

/* ============================================================
   マイページ
   ============================================================ */
.mypage-wrapper { min-height: 100vh; background: var(--bg); }

.mypage-header {
  background: var(--navy);
  padding: 16px 24px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}

.back-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.25); }

.mypage-title { flex: 1; font-size: 16px; font-weight: 700; color: var(--white); }
.mypage-user { font-size: 13px; color: rgba(255,255,255,0.8); }

.mypage-body { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }

.mypage-profile-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-row { display: flex; gap: 10px; align-items: center; }
.profile-label { font-size: 12px; color: var(--text-sub); min-width: 60px; }
.profile-val { font-size: 14px; font-weight: 600; color: var(--navy); }

.mypage-section-title {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.history-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.history-card:hover {
  border-color: var(--navy-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.history-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}

.history-period { font-size: 15px; font-weight: 700; color: var(--navy); }
.history-date { font-size: 12px; color: var(--text-sub); margin-top: 3px; }

.history-badges { display: flex; align-items: center; gap: 8px; }

.badge-feedback {
  background: #FFF3E0;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

.history-arrow { color: var(--text-sub); font-size: 16px; }

.history-scores {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}

.history-score-item { text-align: center; }
.history-score-label { font-size: 10px; color: var(--text-sub); }
.history-score-val { font-size: 18px; font-weight: 700; color: var(--navy); }
.score-max { font-size: 11px; color: var(--text-sub); font-weight: 400; }

.history-score-item.total { margin-left: auto; }
.total-val { font-size: 24px; color: var(--navy); }

.history-scoring { font-size: 13px; color: var(--text-sub); font-style: italic; }

.empty-history {
  text-align: center; padding: 60px 20px;
  color: var(--text-sub);
}
.empty-history i { font-size: 48px; margin-bottom: 16px; display: block; }

/* ランクバッジ */
.history-rank, .detail-rank {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 14px; font-weight: 900;
  letter-spacing: 0.05em;
}
.rank-s { background: linear-gradient(135deg, #FFD700, #FFA500); color: var(--white); }
.rank-a { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: var(--white); }
.rank-b { background: linear-gradient(135deg, #CD7F32, #A0522D); color: var(--white); }
.rank-c { background: #EEF2FF; color: var(--navy); border: 1px solid var(--border); }
.rank-d { background: #F5F5F5; color: var(--text-sub); border: 1px solid var(--border); }

/* ============================================================
   履歴詳細
   ============================================================ */
.detail-score-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.detail-scores { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.detail-score-item { display: flex; align-items: center; gap: 12px; }
.detail-score-label { width: 80px; font-size: 13px; color: var(--text-sub); flex-shrink: 0; }

.detail-score-bar-wrap {
  flex: 1; height: 10px;
  background: var(--bg);
  border-radius: 5px; overflow: hidden;
}

.detail-score-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-light), var(--gold));
  border-radius: 5px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.detail-score-num { width: 70px; text-align: right; font-size: 14px; font-weight: 700; color: var(--navy); }
.detail-score-num span { font-size: 11px; color: var(--text-sub); font-weight: 400; }

.detail-total-row {
  display: flex; align-items: center; gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.detail-total-label { font-size: 14px; font-weight: 700; color: var(--navy); }
.detail-total-score { font-size: 32px; font-weight: 900; color: var(--navy); margin-left: auto; }
.detail-total-max { font-size: 13px; color: var(--text-sub); font-weight: 400; }

/* フィードバック */
.feedback-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border-left: 4px solid var(--gold);
}

.feedback-card.pending { border-left-color: var(--border); }

.feedback-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.feedback-date { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.feedback-text { font-size: 14px; line-height: 1.8; color: var(--text); }
.feedback-pending { font-size: 13px; color: var(--text-sub); font-style: italic; }

/* 記述式詳細 */
.text-detail-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.text-detail-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}

.text-detail-qid {
  background: var(--gold);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
}

.text-detail-cat {
  background: var(--bg);
  color: var(--text-sub);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
}

.text-detail-score {
  margin-left: auto;
  font-size: 14px; font-weight: 700;
  color: var(--navy);
}

.text-detail-question {
  font-size: 13px; color: var(--navy);
  line-height: 1.7;
  margin-bottom: 12px;
  font-weight: 600;
}

.text-detail-answer {
  font-size: 13px; color: var(--text);
  line-height: 1.8;
  background: var(--bg);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.text-detail-comment {
  font-size: 12px; color: var(--text-sub);
  background: #F5F8FF;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--navy-light);
  line-height: 1.6;
}

/* ============================================================
   トースト通知
   ============================================================ */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #1E7A4A; color: var(--white); }
.toast-error { background: var(--danger); color: var(--white); }

/* ============================================================
   ローディング
   ============================================================ */
.loading {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-sub);
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 600px) {
  .auth-form { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr 1fr; }
  .mypage-profile-card { grid-template-columns: 1fr; }
  .history-scores { gap: 10px; }
  .confirm-actions { flex-direction: column; }
  .detail-total-score { font-size: 24px; }
}
