/* ============================================================
   전기기사 필기 준비 (cbt.chatgpts.kr) - 디자인 시스템 (style.css)
   - Electric Blue & Deep Slate CBT 테마
   ============================================================ */

:root {
  /* 메인 테마 컬러 */
  --primary: #2563EB;          /* Electric Blue */
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-border: #BFDBFE;

  --accent-cyan: #06B6D4;      /* High Voltage Cyan */
  --accent-cyan-light: #ECFEFF;

  --success: #10B981;          /* 정답 에메랄드 */
  --success-light: #ECFDF5;
  --success-border: #A7F3D0;

  --danger: #EF4444;           /* 오답 로즈 레드 */
  --danger-light: #FEF2F2;
  --danger-border: #FECACA;

  --warning: #F59E0B;          /* 주의/핵심 골드 */
  --warning-light: #FFFBEB;

  /* 중립색 (뉴트럴) */
  --bg-main: #F8FAFC;          /* 배경 슬레이트 50 */
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-subtle: #F1F5F9;

  --text-main: #0F172A;        /* 슬레이트 900 */
  --text-muted: #475569;       /* 슬레이트 600 */
  --text-subtle: #94A3B8;      /* 슬레이트 400 */
  --text-white: #FFFFFF;

  --border: #E2E8F0;           /* 슬레이트 200 */
  --border-dark: #CBD5E1;

  /* 그림자 */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
  --shadow-blue: 0 8px 24px rgba(37, 99, 235, 0.2);

  /* 모서리 반경 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* 타이포그래피 */
  --font-main: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-display: "Gowun Dodum", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --transition-fast: 0.18s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 기본 리셋 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* 레이아웃 래퍼 */
.app-wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   상단 헤더 & 네비게이션 (데스크톱 & 모바일)
   ============================================================ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-main);
  flex-wrap: wrap;
  gap: 14px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.site-logo:hover {
  color: var(--primary);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1D4ED8 0%, #06B6D4 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.logo-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  background: var(--primary);
  color: #FFFFFF;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

.nav-link {
  padding: 7px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 모바일 보조 네비게이션 칩 바 */
.mobile-subnav {
  display: none;
  gap: 6px;
  padding: 10px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.mobile-subnav::-webkit-scrollbar {
  display: none;
}

@media (max-width: 900px) {
  .mobile-subnav {
    display: flex;
  }
}

.mobile-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: var(--transition-fast);
}

.mobile-subnav a:hover,
.mobile-subnav a.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* 공통 버튼 스타일 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-white {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
}

.btn-white:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
}

/* ============================================================
   히어로 섹션
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #1E3A8A 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 44px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-section::after {
  content: "⚡";
  position: absolute;
  right: -20px;
  bottom: -40px;
  font-size: 16rem;
  opacity: 0.05;
  pointer-events: none;
}

.hero-tag,
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.hero-desc,
.hero-subtitle {
  font-size: 1.02rem;
  color: #CBD5E1;
  max-width: 720px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-actions,
.hero-btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   Ebook 기출문제집 & 이론집 배너 카드
   ============================================================ */
.ebook-banner-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.ebook-banner-header {
  margin-bottom: 18px;
}

.badge-accent {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  border: 1px solid rgba(6, 182, 212, 0.35);
  letter-spacing: 0.04em;
}

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.ebook-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition-fast);
}

.ebook-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.ebook-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ebook-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ebook-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.14);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.ebook-tag.tag-purple {
  color: #C084FC;
  background: rgba(192, 132, 252, 0.14);
}

.ebook-tag.tag-emerald {
  color: #34D399;
  background: rgba(52, 211, 153, 0.14);
}

.ebook-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ebook-meta {
  font-size: 0.78rem;
  color: #94A3B8;
}

.ebook-arrow {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

/* ============================================================
   대시보드 통계 카드
   ============================================================ */
.stats-grid,
.stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .stats-grid,
  .stats-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition-fast);
}

.stat-box:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.stat-value,
.stat-number {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ============================================================
   학습 모드 그리드
   ============================================================ */
.study-modes-grid,
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.study-mode-card,
.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.study-mode-card:hover,
.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.mode-card.highlight {
  border-color: var(--primary-border);
  background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
}

.mode-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.mode-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.mode-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

.mode-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   5대 과목 진도 카드
   ============================================================ */
.subjects-grid,
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.subject-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.subject-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--primary-light);
  color: var(--primary);
}

.subject-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}

.subject-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 38px;
}

.subject-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

/* 빠른 시작 카드 그리드 */
.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: var(--transition-smooth);
}

.quick-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.quick-content h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.quick-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ============================================================
   CBT 퀴즈 엔진 스타일
   ============================================================ */
.cbt-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.cbt-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.cbt-exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 4px;
}

.cbt-progress-indicator {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cbt-progress-indicator span {
  color: var(--primary);
  font-size: 1.15rem;
}

/* 타이머 */
.cbt-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-main);
}

.cbt-timer-badge.warning {
  background: var(--danger-light);
  border-color: var(--danger-border);
  color: var(--danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 문제 카드 */
.question-block {
  margin-bottom: 28px;
}

.question-title-area {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.question-num-tag {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.question-stem {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.diagram-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  color: var(--text-main);
}

/* 선택지 */
.choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 1rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}

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

.choice-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  color: var(--text-muted);
}

.choice-text {
  flex: 1;
  line-height: 1.5;
}

/* 선택된 상태 */
.choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.choice-btn.selected .choice-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* 채점 완료 후 상태 */
.choice-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: #065F46;
  font-weight: 600;
}

.choice-btn.correct .choice-num {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.choice-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
  color: #991B1B;
}

.choice-btn.wrong .choice-num {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

/* 해설 박스 */
.explanation-box {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 20px;
  animation: fadeIn 0.25s ease-out;
}

.explanation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.explanation-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.explanation-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 12px;
}

.explanation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-subtle);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

/* 컨트롤 바 */
.cbt-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.btn-cbt-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  background: var(--bg-card);
  transition: var(--transition-fast);
}

.btn-cbt-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-cbt-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-cbt-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: var(--transition-fast);
}

.btn-cbt-action:hover {
  background: var(--primary-dark);
}

/* ============================================================
   결과 화면
   ============================================================ */
.cbt-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.result-badge.pass {
  background: var(--success-light);
  color: #065F46;
  border: 1px solid var(--success-border);
}

.result-badge.fail {
  background: var(--danger-light);
  color: #991B1B;
  border: 1px solid var(--danger-border);
}

.result-score-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-score-number {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 500px;
  margin: 24px auto 32px;
}

.result-sub-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.result-sub-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-sub-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ============================================================
   공식 암기 플립 카드 (Flashcard)
   ============================================================ */
.formulas-grid,
.flip-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.flip-card {
  background-color: transparent;
  width: 100%;
  height: 240px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flip-card-front {
  background: var(--bg-card);
  color: var(--text-main);
}

.flip-card-back {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  color: #ffffff;
  transform: rotateY(180deg);
  border-color: #1E3A8A;
}

.flip-subject-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
}

.flip-card-back .flip-subject-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.formula-display-box {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 12px 0;
  line-height: 1.4;
}

.flip-hint-text {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

/* ============================================================
   오류 신고 모달
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* ============================================================
   토스트 알림
   ============================================================ */
.cbt-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

.cbt-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================
   푸터
   ============================================================ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-disclaimer {
  line-height: 1.6;
  font-size: 0.82rem;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--primary);
}

/* 패밀리 링크 바 & 푸터 */
.family-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}

.family-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.family-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.family-links a,
.family-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition-fast);
}

.family-links a:hover,
.family-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.footer-legal {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-notice {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   모바일 반응형
   ============================================================ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.65rem;
  }
  .hero-section {
    padding: 28px 20px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cbt-container {
    padding: 20px 16px;
  }
  .choice-btn {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
  .result-score-number {
    font-size: 2.8rem;
  }
  .result-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   제미나이(Gemini) AI 비전공자 쉬운 설명 버튼 & 토스트
   ============================================================ */
.btn-gemini-ask {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
  color: #FFFFFF !important;
  border: 1px solid rgba(165, 180, 252, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(67, 56, 202, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-gemini-ask:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.38);
  border-color: rgba(199, 210, 254, 0.7);
  background: linear-gradient(135deg, #312E81 0%, #4338CA 50%, #6366F1 100%);
}

.btn-gemini-ask:active {
  transform: translateY(0);
}

.btn-gemini-ask .gemini-sparkle {
  font-size: 1.05rem;
  animation: sparkleGlow 2s infinite ease-in-out;
}

@keyframes sparkleGlow {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.18) rotate(12deg); opacity: 0.85; }
}

.btn-gemini-ask-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
  gap: 6px;
}

.gemini-action-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.gemini-help-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gemini-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #F8FAFC;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 99999;
  max-width: 90vw;
  width: 440px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.gemini-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 비전공자 화면 내 즉시 쉬운 설명 카드 */
.inline-beginner-box {
  margin-top: 12px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: var(--radius-sm);
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.btn-ai-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ai-sub:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ============================================================
   소유자 전용 Auth Gate (Google 로그인 진입 화면)
   ============================================================ */
html.cbt-locked,
body.cbt-locked {
  overflow: hidden !important;
  height: 100vh !important;
}

body.cbt-locked .app-wrap {
  filter: blur(12px) brightness(0.5);
  pointer-events: none !important;
  user-select: none !important;
}

#cbt-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0b0f19 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #FFFFFF;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#cbt-auth-gate.cbt-gate-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cbt-gate-modal {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 45px rgba(37, 99, 235, 0.25);
  border-radius: 24px;
  padding: 38px 32px;
  text-align: center;
  animation: gateModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cbt-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #60A5FA;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.cbt-gate-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 10px;
}

.cbt-gate-desc {
  font-size: 0.92rem;
  color: #94A3B8;
  line-height: 1.6;
  margin-bottom: 24px;
}

.cbt-gate-features {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cbt-gate-feat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #E2E8F0;
  font-weight: 500;
}

.cbt-gate-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 22px;
  background: #FFFFFF;
  color: #0F172A;
  border: none;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.cbt-gate-btn-google:hover {
  background: #F8FAFC;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

.cbt-gate-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s ease;
}

.cbt-gate-btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
}

.cbt-gate-footer {
  font-size: 0.78rem;
  color: #64748B;
  margin-top: 16px;
}



