/* ==================== 프리랜서 친화 디자인 시스템 ==================== */

/* 폰트 임포트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;600&display=swap');

/* CSS 변수 - 브랜드 컬러 시스템 */
:root {
  /* Primary - 신뢰/전문 */
  --midnight-navy: #0D1B2A;
  --deep-green: #102D29;
  
  /* Secondary - 편안/친숙 */
  --cream-white: #FAF9F6;
  --sand-beige: #EDE9E3;
  --soft-fog: #F4F4F4;
  
  /* Accent - 핵심 CTA */
  --clear-mint: #25C2A0;
  --clear-mint-hover: #1FA890;
  --amber-audit: #F8A10F;
  --coral-trust: #F26B5F;
  
  /* 그라데이션 */
  --gradient-trust: linear-gradient(135deg, var(--clear-mint) 0%, #1FA890 100%);
  --gradient-warm: linear-gradient(135deg, var(--amber-audit) 0%, #E89C0F 100%);
  
  /* 텍스트 컬러 */
  --text-primary: #1A1A1A;
  --text-secondary: #5A5A5A;
  --text-tertiary: #8A8A8A;
  --text-inverse: #FFFFFF;
  
  /* 폰트 패밀리 */
  --font-headline: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Noto Sans KR', -apple-system, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  /* 간격 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  
  /* 그림자 */
  --shadow-sm: 0 2px 8px rgba(13, 27, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(13, 27, 42, 0.12);
  --shadow-lg: 0 8px 32px rgba(13, 27, 42, 0.16);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream-white);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 헤드라인 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

/* 숫자/금액은 Mono 폰트 */
.amount, .number, .price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==================== 레이아웃 ==================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-12) 0;
}

/* ==================== 버튼 시스템 ==================== */

.btn {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1rem;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary CTA - Clear Mint */
.btn-primary {
  background: var(--clear-mint);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--clear-mint-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Secondary - 검토/주의 */
.btn-secondary {
  background: var(--amber-audit);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: #E89C0F;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--clear-mint);
  border: 2px solid var(--clear-mint);
}

.btn-outline:hover:not(:disabled) {
  background: var(--clear-mint);
  color: var(--text-inverse);
}

/* Ghost */
.btn-ghost {
  background: var(--soft-fog);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--sand-beige);
}

/* ==================== 카드 시스템 ==================== */

.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-beige {
  background: var(--sand-beige);
}

.card-fog {
  background: var(--soft-fog);
}

/* ==================== 위험도 게이지 ==================== */

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
}

.risk-low {
  background: #E8F5F1;
  color: var(--clear-mint);
}

.risk-mid {
  background: #FFF4E6;
  color: var(--amber-audit);
}

.risk-high {
  background: #FFE8E6;
  color: var(--coral-trust);
}

/* ==================== 메시지 톤 ==================== */

.message-box {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
}

.message-reassure {
  background: #E8F5F1;
  color: var(--deep-green);
  border-left: 4px solid var(--clear-mint);
}

.message-caution {
  background: #FFF4E6;
  color: #8B5A00;
  border-left: 4px solid var(--amber-audit);
}

.message-info {
  background: var(--soft-fog);
  color: var(--text-secondary);
  border-left: 4px solid var(--text-tertiary);
}

/* ==================== 폼 요소 ==================== */

input[type="file"] {
  display: none;
}

.file-upload-area {
  border: 3px dashed var(--clear-mint);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all 0.3s ease;
  background: white;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--clear-mint-hover);
  background: var(--soft-fog);
}

.file-upload-area.active {
  border-style: solid;
  background: #E8F5F1;
}

/* ==================== 선택 버튼 (3개 제한) ==================== */

.choice-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  max-width: 600px;
  margin: var(--space-4) auto;
}

.choice-btn {
  padding: var(--space-4);
  border: 2px solid var(--soft-fog);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-weight: 600;
}

.choice-btn:hover {
  border-color: var(--clear-mint);
  background: #E8F5F1;
}

.choice-btn.selected {
  border-color: var(--clear-mint);
  background: var(--clear-mint);
  color: white;
}

/* ==================== 애니메이션 ==================== */

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

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

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

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ==================== 챗봇 스타일 ==================== */

#chatbotIcon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 128px;  /* 100% 확대: 64px → 128px */
  height: 128px;
  background: linear-gradient(135deg, #FF8C42 0%, #FF6B35 100%);  /* 주황색 그라데이션 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 56px;  /* 100% 확대: 28px → 56px */
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
  z-index: 9999;
  transition: all 0.3s ease;
}

#chatbotIcon:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 48px rgba(255, 107, 53, 0.6);
}

#chatbotWindow {
  position: fixed;
  bottom: 170px;  /* 아이콘 크기 증가로 조정 */
  right: 24px;
  width: 480px;  /* 넓이 증가 */
  max-height: 700px;  /* 높이 증가 */
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-header {
  background: linear-gradient(135deg, #FF8C42 0%, #FF6B35 100%);  /* 주황색 */
  color: white;
  padding: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  background: var(--cream-white);
}

/* 언어 드롭다운 스타일 추가 */
.lang-option:hover {
  background: var(--soft-fog) !important;
}

.lang-option.active {
  background: #E8F5F1 !important;
  color: var(--clear-mint) !important;
}

/* FAQ 그리드 레이아웃 (9개씩) */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.faq-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.faq-card:hover {
  border-color: #FF8C42;
  background: #FFF5F0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.faq-card-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FF8C42;
  margin-bottom: var(--space-2);
}

.faq-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* FAQ 상세 모달 */
.faq-detail {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}

.faq-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--space-4);
}

.faq-detail-question {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--midnight-navy);
  line-height: 1.4;
  flex: 1;
}

.faq-detail-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 1.5rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.faq-detail-close:hover {
  background: var(--soft-fog);
  color: var(--text-primary);
}

.faq-detail-answer {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-back-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: white;
  border: 2px solid #FF8C42;
  border-radius: var(--radius-full);
  color: #FF8C42;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: var(--space-4);
}

.faq-back-button:hover {
  background: #FF8C42;
  color: white;
}

/* ==================== 반응형 디자인 시스템 ==================== */

/* 모바일 우선(Mobile First) - 320~767px */
@media (max-width: 767px) {
  /* 네비게이션 최적화 */
  nav .container {
    height: 56px !important;
    padding: 0 8px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  
  nav > .container > div {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
  }
  
  nav > .container > div:first-child {
    gap: 6px !important;
  }
  
  nav > .container > div:nth-child(2) {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
  }
  
  nav i.fa-receipt {
    font-size: 20px !important;
  }
  
  #navTitle {
    font-size: 11px !important;
    white-space: nowrap;
    letter-spacing: -0.3px;
  }
  
  /* 공지, 로그인 가로 배치 강제 */
  #navNotice, #navLogin {
    display: inline-block !important;
    font-size: 10px !important;
    padding: 0 4px !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }
  
  #navSignup {
    padding: 4px 8px !important;
    font-size: 10px !important;
    white-space: nowrap;
  }
  
  #langDropdownBtn {
    padding: 4px 6px !important;
    min-width: auto !important;
    gap: 2px !important;
  }
  
  #currentLangFlag {
    font-size: 1rem !important;
  }
  
  #langDropdownBtn i.fa-chevron-down {
    font-size: 0.6rem !important;
  }
  
  nav > .container > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
  }
  
  /* 타이포그래피 - 1줄로 표시 */
  h1 {
    font-size: 1.25rem !important; /* 20px - 1줄 표시 */
    line-height: 1.2 !important;
  }
  
  #heroTitle {
    font-size: 1.25rem !important;
    white-space: nowrap;
    overflow: visible;
  }
  
  h2 {
    font-size: 1.375rem; /* 22px */
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.125rem; /* 18px */
  }
  
  body {
    font-size: 0.875rem; /* 14px */
    line-height: 1.6;
  }
  
  /* 레이아웃 */
  .container {
    padding: 0 var(--space-3);
  }
  
  .section {
    padding: var(--space-8) 0;
  }
  
  /* 버튼 - 터치 최적화 (최소 44px 높이) */
  .btn {
    width: 100%;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
  }
  
  /* 선택 버튼 - 세로 스택 */
  .choice-group {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .choice-btn {
    min-height: 52px;
    padding: var(--space-4);
    font-size: 1rem;
  }
  
  /* 카드 */
  .card {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }
  
  /* 챗봇 */
  #chatbotIcon {
    width: 64px;
    height: 64px;
    font-size: 32px;
    bottom: 16px;
    right: 16px;
  }
  
  #chatbotWindow {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 90px;
    max-height: 65vh;
  }
  
  /* FAQ 그리드 */
  .faq-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .faq-card {
    min-height: 80px;
    padding: var(--space-3);
  }
  
  .faq-card-number {
    font-size: 1.25rem;
  }
  
  .faq-card-title {
    font-size: 0.875rem;
  }
  
  /* 파일 업로드 영역 */
  .file-upload-area {
    padding: var(--space-6);
  }
  
  /* 메시지 박스 */
  .message-box {
    padding: var(--space-3);
    font-size: 0.875rem;
  }
  
  /* 위험도 배지 */
  .risk-badge {
    font-size: 0.75rem;
    padding: 4px var(--space-2);
  }
}

/* 태블릿 (768px ~ 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  /* 타이포그래피 */
  h1 {
    font-size: 2.25rem; /* 36px */
  }
  
  h2 {
    font-size: 1.75rem; /* 28px */
  }
  
  body {
    font-size: 1rem; /* 16px */
  }
  
  /* 레이아웃 */
  .container {
    padding: 0 var(--space-6);
  }
  
  /* 버튼 */
  .btn {
    min-height: 48px;
  }
  
  /* 선택 버튼 - 2열 */
  .choice-group {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  
  /* FAQ 그리드 - 2열 */
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  /* 챗봇 */
  #chatbotWindow {
    width: 420px;
    max-height: 650px;
  }
}

/* 데스크톱 (1024px 이상) */
@media (min-width: 1024px) {
  /* 타이포그래피 */
  h1 {
    font-size: 2.5rem; /* 40px */
    line-height: 1.2;
  }
  
  h2 {
    font-size: 2rem; /* 32px */
  }
  
  h3 {
    font-size: 1.5rem; /* 24px */
  }
  
  body {
    font-size: 1.125rem; /* 18px */
    line-height: 1.7;
  }
  
  /* 레이아웃 - 넓은 여백 */
  .container {
    max-width: 1200px;
    padding: 0 var(--space-8);
  }
  
  .section {
    padding: var(--space-12) 0;
  }
  
  /* 버튼 - 마우스 최적화 */
  .btn {
    width: auto;
    min-width: 160px;
    padding: var(--space-4) var(--space-8);
    font-size: 1.125rem;
  }
  
  .btn:hover {
    transform: translateY(-2px);
  }
  
  /* 선택 버튼 - 3열 유지 */
  .choice-group {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 800px;
  }
  
  .choice-btn {
    min-height: 120px;
    padding: var(--space-6);
  }
  
  .choice-btn:hover {
    transform: translateY(-3px);
  }
  
  /* 카드 - 호버 효과 강화 */
  .card {
    padding: var(--space-8);
  }
  
  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }
  
  /* FAQ 그리드 - 3열 */
  .faq-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
  
  .faq-card {
    min-height: 120px;
  }
  
  .faq-card:hover {
    transform: translateY(-3px);
  }
  
  /* 챗봇 */
  #chatbotIcon {
    width: 80px;
    height: 80px;
    font-size: 40px;
  }
  
  #chatbotIcon:hover {
    transform: scale(1.15);
  }
  
  #chatbotWindow {
    width: 480px;
    max-height: 700px;
  }
  
  /* 파일 업로드 - 넓은 영역 */
  .file-upload-area {
    padding: var(--space-12);
  }
  
  /* 그리드 레이아웃 지원 */
  .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  
  .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
  
  .grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

/* 초대형 화면 (1440px 이상) */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  h1 {
    font-size: 3rem; /* 48px */
  }
  
  h2 {
    font-size: 2.25rem; /* 36px */
  }
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
  /* 터치 영역 최소 44x44px */
  .btn, .choice-btn, .faq-card {
    min-height: 44px;
  }
  
  /* 호버 효과 제거 */
  .btn:hover, .card:hover, .choice-btn:hover, .faq-card:hover {
    transform: none;
  }
  
  /* 활성 상태 시각 피드백 */
  .btn:active {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* ==================== 유틸리티 클래스 ==================== */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-mint {
  color: var(--clear-mint);
}

.bg-cream {
  background-color: var(--cream-white);
}

.bg-beige {
  background-color: var(--sand-beige);
}

.bg-fog {
  background-color: var(--soft-fog);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.p-4 {
  padding: var(--space-4);
}

.rounded {
  border-radius: var(--radius-md);
}

.shadow {
  box-shadow: var(--shadow-md);
}

/* ==================== 로딩 스피너 ==================== */

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--soft-fog);
  border-top-color: var(--clear-mint);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== 토스트 메시지 ==================== */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--midnight-navy);
  color: white;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  animation: slideUp 0.3s ease-out;
}

/* ==================== 모드 전환 ==================== */

.mode-section {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-section.active {
  animation: fadeIn 0.5s ease-out;
}

/* ==================== 로딩 스피너 ==================== */

.loader {
  position: fixed;
  inset: 0;
  background: var(--cream-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--midnight-navy);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 9999;
}

.loader.show {
  opacity: 1;
  pointer-events: auto;
}

.loader:after {
  content: "로딩 중...";
  animation: pulse 1.5s ease-in-out infinite;
}
