/* static/theme.css - 디자인 토큰 단일 소스 (SSOT) */

/* 1. 폰트 불러오기 (프로젝트 공통 Pretendard) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');

: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);
  /* Auth 레이아웃 그리드 비율 (단일 소스: .auth-layout, .auth-page 공통) */
  --auth-grid-cols: 1.15fr 0.85fr;
}

/* 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);
}

/* 버튼 (.pf-btn 공통, .pf-btn-primary는 width만 차이) */
.pf-btn,
.pf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: var(--pf-radius-pill);
  background: var(--pf-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.pf-btn { width: 100%; }
.pf-btn-primary { width: auto; }
.pf-btn:hover,
.pf-btn-primary:hover { background: var(--pf-primary-d); }
.pf-btn:disabled,
.pf-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

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

/* 카드 박스 */
.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; }

/* Auth Layout (비율은 :root --auth-grid-cols 에서만 조정) */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: var(--auth-grid-cols); }
.auth-side {
  background: var(--pf-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 40px; text-align: center;
}
.auth-content {
  display: flex; align-items: center; justify-content: center; padding: 20px; background: #fff;
}
.auth-hero-title { font-size: 36px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.auth-hero-desc { font-size: 18px; line-height: 1.6; opacity: 0.95; white-space: pre-line; }
.auth-form-card { width: 100%; max-width: 380px; }
.auth-title { font-size: 26px; font-weight: 800; margin-bottom: 24px; text-align: center; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--pf-text-sub); }
.auth-link { color: var(--pf-primary); font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* 하단 토스트 알림 스타일 ("편집하기" 버튼 테마 적용) */
.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;
}

/* ==========================================================================
   [Auth Layout] 로그인 / 회원가입 / 계정찾기 공통 레이아웃
   그리드 비율은 :root --auth-grid-cols 에서만 조정 (.auth-layout / .auth-page 공통)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--auth-grid-cols);
  width: 100%;
  background: #fff;
}

/* 왼쪽 브랜딩 영역 (파란색) */
.auth-left {
  background: var(--pf-primary); /* #2563EB or defined color */
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  text-align: center;
  position: relative;
}

.auth-hero { max-width: 540px; width: 100%; }
.auth-brand { 
  font-size: 20px; 
  font-weight: 700; 
  opacity: 0.9; 
  margin-bottom: 24px; 
  letter-spacing: -0.2px; 
  text-transform: uppercase;
}
.auth-title { 
  font-size: 36px; 
  font-weight: 800; 
  line-height: 1.35; 
  margin-bottom: 20px; 
  word-break: keep-all; 
}
.auth-desc { 
  font-size: 17px; 
  font-weight: 400; 
  opacity: 0.85; 
  line-height: 1.6; 
}
.auth-copy { 
  position: absolute; 
  bottom: 30px; 
  font-size: 13px; 
  opacity: 0.5; 
}

/* 오른쪽 입력 폼 영역 (흰색) */
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

/* 폼 컨테이너 */
.auth-box { 
  width: 100%; 
  max-width: 400px; /* 폼 최대 너비 제한 */
}

/* Auth 전용 타이틀/서브텍스트 */
.auth-box-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--pf-text-main);
  margin-bottom: 12px;
}
.auth-box-desc {
  font-size: 14px;
  color: var(--pf-text-sub);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* 반응형: 태블릿/모바일 */
@media (max-width: 960px) {
  .auth-page { display: flex; flex-direction: column; }
  .auth-left { display: none; } /* 모바일에서 왼쪽 숨김 */
  .auth-right { padding: 40px 20px; min-height: 100vh; }
  .auth-box { max-width: 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; }
}