/* static/theme.css - 디자인 토큰 단일 소스 (SSOT) */
/* Pretendard: templates/includes/head_base_styles.html · head_parent_report.html 에서 로드 */

:root {
  /* 폰트 패밀리 SSOT (v1.3.8 Pretendard) */
  --pf-font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  /* Design Tokens (report_builder 등에서 var()로 참조) */
  --pf-primary:    #1493E6;
  --pf-primary-d:  #0F7CC6;
  --pf-bg-page:    #F4F7FB;
  --pf-bg-white:   #FFFFFF;
  --pf-text-main:  #111827;
  --pf-text-sub:   #6B7280;
  --pf-border:     #E5E7EB;
  --pf-header-bg:       #1e3a8a; /* 기존 헤더·로그인 브랜드 파란색 (Midnight Blue) */
  --pf-header-bg-hover: #1e40af; /* 헤더/스크롤버튼 호버 등 */
  --pf-chip-bg:         #FFFFFF;
  --pf-chip-text:       #4B5563;

  --pf-level-good: #1D4ED8;
  --pf-bg-good:    #DBEAFE;
  --pf-level-norm: #374151;
  --pf-bg-norm:    #F3F4F6;
  --pf-level-bad:  #B91C1C;
  --pf-bg-bad:     #FEE2E2;

  --pf-radius:     12px;
  --pf-radius-pill: 999px;
  --pf-shadow:     0 10px 30px rgba(0,0,0,0.08);
  --badge-min-width: 4rem;
  --pf-toast-bg:   #334155;
  /* 버튼 확인 색 (SweetAlert 등 - --pf-primary와 동일) */
  --pf-btn-confirm: var(--pf-primary);
  /* 포커스/선택 링 색 (score-btn-active 등) */
  --pf-primary-ring: rgba(20, 147, 230, 0.25);
}

/* 2. 프로젝트 공통 폰트 (Pretendard v1.3.8) */
* {
  box-sizing: border-box;
  font-family: var(--pf-font-family) !important;
}

/* 뷰포트 폭 고정: 가로 스크롤 방지 (모든 화면 공통) */
html {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  color: var(--pf-text-main);
  background: var(--pf-bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  /* 전역: 단어 중간 줄바꿈 방지(한글·영어 단어 단위). 긴 URL 등은 overflow-wrap으로만 끊김 */
  overflow-wrap: break-word;
  word-break: keep-all;
}

/* 3. 메인 콘텐츠 영역 공통 (리포트빌더·빌링·약관 등) - 폭/패딩 단일 소스 */
.pf-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .pf-main { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .pf-main { padding-left: 2rem; padding-right: 2rem; }
}

/* 담임 선생님 의견 입력칸: 세로 높이 확대 (리포트 빌더 공통) */
.pf-teacher-comment {
  min-height: 10rem;
}
/* N회 생성 가능 문구: 가운데 정렬 (리포트 빌더) */
.pf-remaining-badge-wrap {
  text-align: center;
}

/* 헤더 배경 (디자인 토큰 1개로 통일) */
.pf-header {
  background-color: var(--pf-header-bg);
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }

/* 4. 입력창 스타일 강화 (글씨 진하게) */
.pf-input, .pf-select, .pf-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #CBD5E1; /* 테두리 좀 더 진하게 */
  border-radius: 10px;
  background: #fff;
  
  /* 입력 글씨 강조 */
  font-size: 15px;
  font-weight: 600; 
  color: #111; 
  
  outline: none;
  transition: all 0.2s;
}
.pf-input::placeholder, .pf-textarea::placeholder {
  font-weight: 400;
  color: #9CA3AF; /* 플레이스홀더는 연하게 */
}
.pf-input:focus, .pf-select:focus, .pf-textarea:focus {
  border-color: var(--pf-primary);
  box-shadow: 0 0 0 3px rgba(20, 147, 230, 0.12);
}

/* 버튼 시스템 (2층: 타입 + 크기) */
.pf-btn,
.pf-btn-primary,
.pf-btn-outline,
.pf-btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 크기 변형 */
.pf-btn-sm {
  min-height: 40px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
}
.pf-btn-md {
  min-height: 48px;
  padding: 0 1.25rem;
  font-size: 1rem;
}
.pf-btn-lg {
  min-height: 56px;
  padding: 0 1.5rem;
  font-size: 1.125rem;
}
.pf-btn-block {
  width: 100%;
}

/* 의미 타입 */
.pf-btn-primary {
  background: var(--pf-primary);
  border-color: var(--pf-primary);
  color: #fff;
}
.pf-btn-primary:hover {
  background: var(--pf-primary-d);
  border-color: var(--pf-primary-d);
}

.pf-btn-outline {
  background: #fff;
  border-color: #CBD5E1;
  color: #64748B;
}
.pf-btn-outline:hover {
  border-color: var(--pf-primary);
  color: var(--pf-primary);
  background: #F0F9FF;
}

.pf-btn-dark {
  background: #1F2937;
  border-color: #1F2937;
  color: #fff;
}
.pf-btn-dark:hover {
  background: #111827;
  border-color: #111827;
}

.pf-btn:disabled,
.pf-btn-primary:disabled,
.pf-btn-outline:disabled,
.pf-btn-dark:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 카드 박스 */
.pf-card {
  background: var(--pf-bg-white);
  border-radius: 16px;
  border: 1px solid var(--pf-border);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  padding: 24px;
}

/* 모달 (팝업) 공통 */
.pf-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6); /* 배경 조금 더 어둡게 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s;
}
.pf-modal-backdrop.show { opacity: 1; visibility: visible; }

.pf-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 400px;
  max-width: 90vw;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 에러 메시지 */
.pf-error-box {
  padding: 12px; margin-bottom: 16px; border-radius: 8px;
  background: #FEF2F2; color: #B91C1C; font-size: 13px; display: none;
}
.pf-error-box.show { display: block; }
.pf-field-error {
  margin-top: 4px; font-size: 12px; color: #B91C1C; display: none;
}
.pf-field-error.show { display: block; }

/* 필드 에러 메시지 (실시간 검증용, text-red-600 대체) */
.field-error {
  font-size: 12px;
  color: var(--pf-level-bad);
  margin-top: 4px;
  min-height: 16px;
}

/* 입력 오류 시 빨간 테두리 */
.input-error {
  border-color: var(--pf-level-bad) !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12) !important;
}

/* 폼 그룹 */
.pf-form-group {
  margin-bottom: 20px;
}
.pf-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--pf-text-main);
  margin-bottom: 6px;
}

/* 링크 */
.pf-link {
  color: var(--pf-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.pf-link:hover {
  color: var(--pf-primary-d);
  text-decoration: underline;
}

/* 성공 메시지 */
.pf-ok {
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #ECFDF5;
  color: #065F46;
  font-size: 13px;
  display: none;
}
.pf-ok.show { display: block; }

/* 하단 토스트 알림 스타일 ("편집하기" 버튼 테마 적용) */
.pf-toast-container {
  position: fixed;
  bottom: 40px; /* 화면 하단 배치 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  align-items: center;
}

/* 애니메이션: 아래에서 위로 등장 */
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 토스트 팝업 공통 스타일 */
.pf-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 480px;
  padding: 14px 20px;
  border-radius: var(--pf-radius-pill);
  background: var(--pf-toast-bg);
  color: #FFFFFF;
  box-shadow: 0 10px 20px rgba(51, 65, 85, 0.25);
  border: none;
  pointer-events: auto;
  animation: slideInUp 0.3s ease-out;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  transition: opacity 0.3s, transform 0.3s;
}

.pf-toast.pf-toast--error,
.pf-toast.pf-toast--success,
.pf-toast.pf-toast--info {
  background: var(--pf-toast-bg);
  color: #FFFFFF;
}

/* 닫기 버튼 스타일 (흰색으로 변경) */
.pf-toast-close-btn {
  background: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.6) !important; /* 반투명 흰색 */
  cursor: pointer !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  padding: 0 !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important; /* 우측 끝으로 밀기 */
  transition: color 0.2s !important;
}

.pf-toast-close-btn:hover {
  color: #FFFFFF !important;
}

/* 인증 페이지 좌측 브랜딩 패널 (login / signup / find) */
.auth-brand-pattern {
  background-color: var(--pf-header-bg);
  background-image: radial-gradient(circle at 80% 20%, var(--pf-header-bg-hover) 0%, var(--pf-header-bg) 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.auth-brand-pattern--find {
  background-image: radial-gradient(circle at 50% 120%, var(--pf-header-bg-hover) 0%, var(--pf-header-bg) 60%, #111827 100%);
}

/* ==========================================================================
   Scroll To Top 버튼
   ========================================================================== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 50;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--pf-header-bg);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

.scroll-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background-color: var(--pf-header-bg-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 아이콘 크기 조정 */
.scroll-to-top svg {
  width: 24px;
  height: 24px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* 푸터 사업자정보: 기본은 줄바꿈 허용(모바일·태블릿 잘림 방지), 큰 화면에서만 한 줄 유지 */
.footer-compact .footer-seg,
.footer-compact .footer-sep {
  white-space: normal;
}
.footer-compact .footer-seg.footer-addr {
  word-break: keep-all;
}
.footer-compact p,
.footer-compact .footer-seg {
  overflow-wrap: break-word;
  word-break: keep-all; /* 단어 중간 줄바꿈 방지(한글·영어 단어 단위로만 줄바꿈) */
  min-width: 0;
}

@media (min-width: 1024px) {
  .footer-compact .footer-seg,
  .footer-compact .footer-sep {
    white-space: nowrap;
  }
}

/* 이용약관 MD → HTML 표시 (모달/페이지) */
.terms-html { font-size: 0.875rem; line-height: 1.6; color: #374151; }
.terms-html h1 { font-size: 1.125rem; font-weight: 700; color: #111827; margin-bottom: 0.75rem; }
.terms-html h2 { font-size: 1rem; font-weight: 700; color: #111827; margin-top: 1rem; margin-bottom: 0.5rem; }
.terms-html h3 { font-size: 0.9375rem; font-weight: 700; color: #111827; margin-top: 0.75rem; margin-bottom: 0.375rem; }
.terms-html p { margin-bottom: 0.5rem; }
.terms-html ul { margin: 0.5rem 0 0.5rem 1.25rem; padding-left: 0; list-style-type: disc; }
.terms-html li { margin-bottom: 0.25rem; }
.terms-html strong { font-weight: 600; color: #111827; }
.terms-html em { font-style: italic; }

@media (max-width: 767px) {
  .terms-html { font-size: 0.9375rem; }
  .terms-html h1 { font-size: 1.25rem; }
  .terms-html h2 { font-size: 1.0625rem; }
}

/* SweetAlert2 (signup, find — pf-swal.js) */
.swal2-academic-popup {
  border-radius: 8px !important;
  font-family: var(--pf-font-family) !important;
}

/* ==========================================================================
   App chrome (푸터·결제/요금제 메인 — report_builder.css와 분리)
   ========================================================================== */
.footer-report-builder {
  margin-top: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.footer-report-builder footer {
  background-color: #f1f5f9 !important;
  border-top: 1px solid #e2e8f0 !important;
  margin-top: 0;
  border-radius: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.footer-report-builder footer > div {
  max-width: min(1400px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem !important;
  box-sizing: border-box;
  min-width: 0;
}

@media (min-width: 1024px) {
  .footer-report-builder footer > div {
    padding: 1rem 1.5rem 1.25rem !important;
  }
}

.footer-report-builder footer .text-sm {
  font-size: 0.8125rem;
  color: #64748b !important;
}

.footer-report-builder footer .font-semibold.text-gray-900 {
  font-size: 0.8125rem;
  color: #475569 !important;
}

.footer-report-builder footer a {
  color: #0ea5e9;
}

.footer-report-builder footer a:hover {
  color: #0284c7;
}

@media (max-width: 767px) {
  .footer-report-builder footer > div {
    padding: 1rem 1rem 1.25rem !important;
  }

  .footer-report-builder footer .text-sm,
  .footer-report-builder footer .font-semibold.text-gray-900 {
    font-size: 0.875rem !important;
  }

  .footer-report-builder footer .space-y-1 p {
    line-height: 1.5;
  }

  .footer-report-builder footer a.inline-flex {
    min-height: 44px;
    padding: 0.5rem 0;
    align-items: center;
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .billing-main.pf-main {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

.pricing-main.pf-main {
  padding-bottom: 6rem;
}