/* study/static/study/base.css — 참가자 화면 공통 스타일
 *
 * 디자인 기준: CLAUDE.md 4절 "화면 디자인" (Gero et al., 2026 실험 화면 참고)
 * 2026-11-01 연구자 요청으로 흰색 위주에서 Gero 화면처럼 보조 색을 쓰도록 조정:
 *   파란 머리 띠, 연한 파랑·연회색 패널, 연한 파랑 제목 띠, 초록 '주제' 상자, 노란 '참고' 상자.
 * AI 내용(초안·의견)에는 정확/오류를 짐작하게 하는 색 차이를 두지 않는다(의견 박스는 한 가지 색).
 * 외부 폰트·CDN 없음(시스템 폰트).
 */
:root {
  --bg: #f4f7fb;             /* 페이지 바탕: 아주 연한 파랑 회색 */
  --panel: #f1f3f6;          /* 회색 패널 (Gero 오른쪽 패널) */
  --panel-blue: #eaf1fb;     /* 연한 파랑 패널 */
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5f6b7a;
  --line: #d9e1ec;
  --primary: #1a73e8;
  --primary-hover: #1765cc;
  --primary-dark: #174ea6;
  --primary-soft: #a8c7fa;   /* 비활성 버튼 */
  --primary-tint: #e3eefd;   /* 연한 파랑 바탕 (제목 띠·선택 강조) */
  --ok: #2e7d32;             /* 기준 충족 */
  --ok-tint: #e8f5e9;        /* 초록 '주제' 상자 바탕 */
  --ok-line: #66bb6a;
  --error: #d93025;          /* 기준 미충족·오류 */
  --error-tint: #fdecea;
  --note-tint: #fff4ce;      /* 노란 '참고' 상자 */
  --note-line: #f0d27a;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;        /* 한국어는 어절 단위로 줄바꿈 */
  overflow-wrap: break-word;
}

/* 파란 머리 띠 */
.site-header {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.page { margin: 0 auto; padding: 32px 16px 64px; }
.page.narrow { max-width: 760px; }

h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.05rem; margin: 24px 0 8px; }

/* ── 페이지 머리: 단계 표시 + 제목 (모든 참가자 페이지 공통) ── */
.page-head { text-align: center; margin: 4px 0 24px; }
.page-head .step {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.page-head h1 { margin: 0; color: var(--primary); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.01em; }

/* ── 카드 ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin: 16px 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: 1rem; margin: 18px 0 4px; color: var(--primary-dark); }

/* 카드 위 제목 띠 (Gero 'Your Outline' 처럼 연한 파랑) */
.band {
  margin: 24px 0 -8px;
  padding: 6px 14px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
}

/* 안내 상자: 연한 파랑 + 왼쪽 파란 줄 */
.lead-box {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--panel-blue);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
}

/* 초록 '주제' 상자 (Gero ESSAY TOPIC) — AI 내용에는 쓰지 않는다 */
.topic-box {
  background: var(--ok-tint);
  border: 2px solid var(--ok-line);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.topic-box > :first-child { margin-top: 0; }
.topic-box > :last-child { margin-bottom: 0; }

/* ── 입력 ── */
label { display: block; font-weight: 600; margin-bottom: 6px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* ── 버튼: 파란 채움(주) / 흰 바탕(보조) / 비활성은 연한 파랑 + 커서 금지 ── */
button {
  font: inherit;
  padding: 9px 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
  margin-top: 12px;
  font-weight: 600;
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(26, 115, 232, 0.3); }
button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
button.primary:disabled { background: var(--primary-soft); border-color: var(--primary-soft); box-shadow: none; cursor: not-allowed; }
button.secondary { background: var(--card); color: var(--text); }
button.secondary:hover:not(:disabled) { background: var(--panel); }
button.danger { color: var(--error); border-color: #f3b2ac; }
button.danger:hover:not(:disabled) { background: var(--error-tint); }
button:disabled { cursor: not-allowed; }
button:focus-visible, a.button:focus-visible { outline: 3px solid var(--primary-tint); outline-offset: 1px; }

a.button {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
a.button.primary { background: var(--primary); color: #fff; }
a.button.primary:hover { background: var(--primary-hover); }
.resume { background: var(--panel-blue); border-color: #bcd3f5; }
.resume p { margin-top: 0; }

.actions { display: flex; justify-content: flex-end; gap: 8px; }
.error { color: var(--error); margin: 8px 0 0; font-weight: 600; }
.note { color: var(--muted); font-size: 0.93rem; }
.center { text-align: center; }
/* 노란 '참고' 상자 (Gero Note) */
.todo { background: var(--note-tint); border: 1px solid var(--note-line); padding: 6px 10px; border-radius: 6px; font-size: 0.9rem; }
.instructions { padding-left: 20px; }
.instructions li { margin-bottom: 8px; }
.instructions li:last-child { margin-bottom: 0; }
.instructions li::marker { color: var(--primary); }

/* ─────────────────────────────────────────────
 * 사후 설문(5단계): 문항마다 카드 한 장, 1–7 가로 선택 버튼, 양 끝 척도 이름
 * ───────────────────────────────────────────── */
.survey-form { margin-top: 8px; }
.q-card {
  margin: 0 0 12px;
  padding: 16px 20px 18px;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.q-card .q-text { float: left; width: 100%; padding: 0; margin: 0 0 14px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.q-card .q-text + * { clear: both; }
.q-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}
.q-body { min-width: 0; }
/* 영어 원문(단어 바꾸기 규칙 적용): 한국어 아래 작게 */
.q-en {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  word-break: normal;
}
.likert-end .q-en { font-size: 0.72rem; margin-top: 1px; }
.q-card.unanswered { border-color: var(--error); background: #fffafa; box-shadow: 0 0 0 2px var(--error-tint); }

.likert { display: flex; align-items: center; gap: 12px; }
.likert-end { flex: 0 0 120px; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.likert-end:first-child { text-align: right; }
.likert-options { display: flex; gap: 8px; flex: 1; justify-content: center; }
.likert-options label { margin: 0; font-weight: 400; }
.likert-options input { position: absolute; opacity: 0; pointer-events: none; }
.likert-options span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-blue);
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.1s, border-color 0.1s;
}
.likert-options span:hover { border-color: var(--primary); background: var(--primary-tint); }
.likert-options input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(26, 115, 232, 0.4); }
.likert-options input:focus-visible + span { outline: 3px solid var(--primary-tint); outline-offset: 1px; }
.survey-actions { justify-content: center; margin-top: 8px; }
.survey-actions button { min-width: 200px; }

/* 보기 이름 버튼(사전 설문 단일·복수 선택, PM 퀴즈) — 선택하면 파랗게 */
.section-gap { height: 18px; }
.choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-options label { margin: 0; font-weight: 400; }
.choice-options input { position: absolute; opacity: 0; pointer-events: none; }
.choice-options span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-blue);
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.35;
  transition: background 0.1s, border-color 0.1s;
}
.choice-options span:hover { border-color: var(--primary); background: var(--primary-tint); }
.choice-options input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(26, 115, 232, 0.4); }
.choice-options input:focus-visible + span { outline: 3px solid var(--primary-tint); outline-offset: 1px; }
/* 긴 문장 보기(PM 퀴즈)는 한 줄에 하나씩 */
.choice-options.stacked { flex-direction: column; }
.choice-options.stacked span { width: 100%; justify-content: flex-start; font-weight: 500; }

/* ── PM 퀴즈 ── */
.quiz-background { margin: 0 0 14px; padding: 10px 16px; font-weight: 600; color: #2b5a2e; }
.quiz-card .q-text { font-weight: 500; }
.quiz-table { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 0.9rem; }
.quiz-table th, .quiz-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.quiz-table th { background: var(--primary-tint); color: var(--primary-dark); font-weight: 700; }
.quiz-question { margin: 0 0 10px; font-weight: 700; }
.todo-inline { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px;
               background: var(--note-tint); border: 1px solid var(--note-line); font-size: 0.78rem; font-weight: 600; color: #6b5300; }

/* ── 디브리핑 ── */
.debrief h2:first-of-type { margin-top: 12px; }
/* 마지막 선택: 철회(왼쪽, 보조) / 동의(오른쪽, 주) */
.choice-buttons { display: flex; justify-content: center; gap: 12px; }
.choice-buttons form { margin: 0; }
.choice-buttons button { margin-top: 0; min-width: 180px; }
