/*
 * 그린 스튜디오: 퀘스트보드7의 흰 바탕, 얇은 선, 절제된 글자 크기를 따르고 강조색은 초록.
 * 기본 구조와 상태별 스타일은 styles.css, reading.css에 두고 여기서는 덮어쓰기만 한다.
 * 글꼴: 본문 Pretendard Variable(fonts.css), 제목과 큰 숫자 Paperlogy. 둘 다 SIL OFL(public/fonts/*-LICENSE.txt).
 */

@font-face {
  font-family: "Paperlogy";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/paperlogy-1/Paperlogy-5Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Paperlogy";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/paperlogy-1/Paperlogy-6SemiBold.woff2") format("woff2");
}

:root {
  --ink: #252b29;
  --ink-soft: #66706c;
  --ink-faint: #8a938f;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --line: #e2e9e5;
  --line-strong: #cbd8d1;
  --brand: #1f8a55;
  --brand-dark: #166b41;
  --brand-soft: #ebf6ef;
  --brand-ring: rgba(31, 138, 85, 0.22);
  --accent: #b7832c;
  --accent-soft: #fbf4e6;
  --yellow: #b7832c;
  --yellow-soft: #fbf4e6;
  --danger: #b5605c;
  --danger-soft: #fcf0ef;
  --success: #2d8a5c;
  --success-soft: #edf7f1;
  --shadow: 0 10px 30px rgba(34, 52, 44, 0.08);
  --shadow-soft: none;
  --radius-xl: 16px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-body: "Pretendard Variable", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --font-display: "Paperlogy", var(--font-body);
  font-family: var(--font-body);
}

html,
body {
  background: var(--paper);
}

body {
  font-weight: 450;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
.home-simple h1,
.detail-stat strong,
.detail-title-card h2,
.reading-summary strong,
.reading-score,
.student-number,
.class-code-input,
.progress-ring strong {
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  letter-spacing: -0.045em;
}

h2,
h3 {
  letter-spacing: -0.035em;
}

h3 {
  font-weight: 650;
}

p {
  line-height: 1.65;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

/* 브랜드 */
.brand-symbol {
  width: 26px;
  height: 26px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  flex: none;
}

.brand-symbol i {
  border-radius: 4px;
  background: var(--brand);
}

.brand-symbol i:nth-child(2) {
  opacity: 0.35;
}

.brand-symbol i:nth-child(3) {
  opacity: 0.65;
}

.brand-symbol.large {
  width: 44px;
  height: 44px;
  gap: 4px;
}

.brand-symbol.large i {
  border-radius: 7px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

/* 머리글 */
.site-header,
.teacher-nav {
  min-height: 60px;
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.teacher-nav {
  justify-content: flex-start;
  gap: 22px;
}

.teacher-nav > .btn {
  margin-left: auto;
}

.nav-item {
  min-height: 38px;
  padding: 9px 13px;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink-soft);
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}

/* 단추 */
.btn {
  min-height: 42px;
  padding: 9px 16px;
  border-color: var(--line);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: none;
}

.btn:hover:not(:disabled) {
  transform: none;
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 2px 6px rgba(31, 138, 85, 0.16);
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.btn-success {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.btn-soft {
  border-color: var(--line);
  background: var(--surface);
}

.btn-soft:hover:not(:disabled) {
  background: var(--surface-soft);
}

.btn-ghost {
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-danger {
  border-color: #f0dddc;
  background: var(--surface);
  color: var(--danger);
}

.btn-small {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.icon-btn {
  border-radius: 10px;
}

.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.student-card:focus-visible,
.mission-card:focus-visible,
.nav-item:focus-visible,
.clickable-card:focus-visible {
  outline: 3px solid var(--brand-ring);
  outline-offset: 2px;
}

/* 입력 */
input,
textarea,
select {
  border-color: var(--line-strong);
  border-radius: 10px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
}

input::placeholder,
textarea::placeholder {
  color: #a3aca8;
}

.field label,
.field-label {
  font-size: 0.86rem;
  font-weight: 650;
}

.answer-check {
  accent-color: var(--brand);
}

.answer-field:has(.answer-check:checked) .answer-text {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.answer-guide {
  color: var(--brand);
}

/* 카드: 그림자 대신 얇은 선 */
.panel,
.auth-card,
.question-card,
.mission-card,
.stat-card,
.class-card,
.review-card,
.detail-title-card,
.detail-stat,
.side-panel,
.table-wrap,
.reading-progress {
  border-color: var(--line);
  box-shadow: none;
}

.mission-card,
.mission-row,
.student-card,
.class-card {
  transition: border-color 120ms ease, background 120ms ease;
}

.mission-card:hover,
.mission-row.clickable-card:hover,
.student-card:hover {
  transform: none;
  border-color: var(--brand);
  box-shadow: none;
}

.mission-card.featured {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.mission-card {
  min-height: 0;
  gap: 4px;
}

.mission-card h3 {
  margin: 12px 0 6px;
  font-size: 1.12rem;
}

.mission-card-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.mission-card-footer strong {
  color: var(--brand);
  font-weight: 650;
}

.pill,
.status-badge,
.count-chip {
  font-weight: 600;
}

.pill {
  min-height: 26px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.pill.accent {
  background: var(--accent-soft);
  color: #8a5f19;
}

.status-badge {
  min-height: 26px;
  font-size: 0.74rem;
}

.status-badge.submitted,
.status-badge.published {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-badge.approved,
.status-badge.closed {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.draft {
  background: var(--accent-soft);
  color: #8a5f19;
}

.banner {
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.banner.success {
  border-color: #cfe8da;
  background: var(--brand-soft);
}

/* 첫 화면 */
.home-simple {
  justify-items: center;
  gap: 20px;
}

.home-simple h1 {
  font-size: clamp(2.1rem, 6vw, 3.3rem);
}

.home-sub {
  margin: -8px 0 16px;
  color: var(--ink-soft);
  text-align: center;
}

.home-entry-actions {
  width: min(440px, calc(100vw - 32px));
}

.home-entry-button {
  font-weight: 650;
}

.home-entry-button.student {
  width: 100%;
}

.home-entry-button.student {
  min-height: 96px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(31, 138, 85, 0.18);
}

.home-entry-button.student:hover,
.home-entry-button.student:focus-visible {
  box-shadow: 0 8px 22px rgba(31, 138, 85, 0.24);
}

.auth-card {
  display: grid;
  justify-items: stretch;
  gap: 6px;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(34, 52, 44, 0.06);
}

.auth-card > .brand-symbol {
  justify-self: center;
  margin-bottom: 8px;
}

.auth-card h1 {
  text-align: center;
}

/* 학생 번호 카드 */
.student-card {
  min-height: 108px;
  border-radius: 14px;
}

.student-number {
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.15rem;
}

.student-name {
  font-weight: 600;
}

/* 교사 요약과 표 */
.detail-stat small,
.detail-title-card p {
  font-weight: 550;
}

.detail-stat strong {
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}

th {
  background: var(--surface-soft);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0;
}

th,
td {
  border-bottom-color: var(--line);
}

.clickable-row:hover td {
  background: #f8fbf9;
}

.class-card.active {
  border-color: var(--brand);
}

/* 대화 상자 */
.modal {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(25, 40, 33, 0.18);
}

.modal-head h2 {
  font-size: 1.3rem;
}

.modal-backdrop {
  background: rgba(30, 40, 36, 0.38);
}

.toast {
  border-radius: 12px;
}

.global-loading span {
  background: var(--brand);
}

.language-option[aria-pressed="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

/* 윤독 */
.reading-summary {
  border-color: #d5eadd;
  background: var(--brand-soft);
}

.reading-summary strong {
  color: var(--brand-dark);
}

.reading-scene-no {
  background: var(--brand);
  font-family: var(--font-display);
  font-weight: 600;
}

.reading-scene-list li.untouched {
  border-color: #ead7b2;
  background: var(--accent-soft);
}

.reading-scene-list li.untouched .reading-scene-count {
  color: #8a5f19;
}

.reading-scene-bar span {
  background: var(--brand);
}

.reading-result.approved {
  background: var(--brand-soft);
}

.reading-result.submitted {
  background: #eef6f6;
}

.reading-score span,
.reading-summary strong span {
  font-family: var(--font-body);
  font-weight: 500;
}

.reading-hint {
  border: 1px solid var(--line);
}

.reading-chip {
  font-weight: 650;
}

.reading-chip.approved {
  background: var(--brand-soft);
  color: var(--brand);
}

.reading-ai-box blockquote {
  border-left-color: var(--brand);
}

@media (max-width: 760px) {
  .teacher-nav {
    gap: 10px;
  }

  .teacher-nav .app-brand-text {
    display: none;
  }
}

@media (max-width: 430px) {
  .site-header .app-brand-text {
    display: none;
  }
}
