/* ================================================
   CryptoTax.cloud — 공통 스타일시트
   파일명: style.css (루트에 저장)
   모든 페이지 <head>에 아래 한 줄 추가:
   <link rel="stylesheet" href="/style.css">
   ================================================ */

/* ── 1. 폰트 ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

/* ── 2. 컬러 변수 (라이트 모드) ── */
:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --primary: #FF7A00;
  --primary-hover: #FF5500;
  --text: #111827;
  --subtext: #6B7280;

  --font-main: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

  /* 배경 */
  --bg-primary:    #ffffff;
  --bg-secondary:  #f8fafc;
  --bg-card:       #ffffff;

  /* 텍스트 */
  --text-primary:  #111827;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;

  /* 브랜드 */
  --accent:        #f97316;
  --accent-hover:  #ea6c0a;
  --accent-light:  #fff7ed;
  --accent-gradient: linear-gradient(135deg, #f97316, #f59e0b);

  /* 컬러 */
  --blue:#3b82f6;
  --green:#10b981;
  --purple:#8b5cf6;
  --red:#ef4444;
  --yellow:#f59e0b;

  /* 테두리 */
  --border:#e5e7eb;
  --border-light:#f3f4f6;

  /* 그림자 */
  --shadow-sm:0 1px 3px rgba(0,0,0,.08);
  --shadow-md:0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:0 12px 32px rgba(0,0,0,.12);
  --shadow-accent:0 4px 16px rgba(249,115,22,.30);

  /* 반경 */
  --radius-sm:8px;
  --radius-md:12px;
  --radius-lg:16px;
  --radius-xl:24px;
  --radius-full:9999px;

  /* 애니메이션 */
  --transition:0.2s ease;
}

  /* 보조 컬러 */
  --blue:    #3b82f6;
  --green:   #10b981;
  --purple:  #8b5cf6;
  --red:     #ef4444;
  --yellow:  #f59e0b;
  --cyan:    #06b6d4;
  --indigo:  #6366f1;

  /* 테두리 */
  --border:        #e5e7eb;
  --border-light:  #f3f4f6;

  /* 그림자 */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.12);
  --shadow-accent: 0 4px 16px rgba(249,115,22,.30);

  /* 반경 */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* 전환 */
  --transition: 0.2s ease;
}

/* ── 3. 컬러 변수 (다크 모드) ── */
[data-theme="dark"] {
  --bg-primary:    #0f172a;
  --bg-secondary:  #1e293b;
  --bg-card:       #1e293b;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;

  --accent-light:  #1c1008;
  --border:        #334155;
  --border-light:  #1e293b;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-main); cursor: pointer; }

/* ── 5. 공통 레이아웃 ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 64px 0;
}

.section-sm {
  padding: 40px 0;
}

/* ── 6. 헤더 / 네비게이션 ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  transition: background var(--transition);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo span { color: var(--accent); }

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

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.nav-links a.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-cta {
  background: var(--accent-gradient) !important;
  color: #fff !important;
  border-radius: var(--radius-full) !important;
  padding: 8px 18px !important;
  box-shadow: var(--shadow-accent);
}

.nav-cta:hover {
  background: var(--accent-gradient) !important;
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── 7. 테마 토글 버튼 ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: all var(--transition);
  margin-left: 8px;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 8. 티커 바 ── */
.ticker-wrap {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  gap: 32px;
  animation: ticker 30s linear infinite;
}

.ticker-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.ticker-item .up   { color: var(--green); }
.ticker-item .down { color: var(--red);   }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── 9. 브레드크럼 ── */
.breadcrumb {
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.breadcrumb a:hover { color: var(--accent); }

/* ── 10. 히어로 섹션 ── */
.hero {
  text-align: center;
  padding: 56px 20px 48px;
  background: var(--bg-primary);
}

.hero-badge {
  display: inline-block;
  background: var(--accent-gradient);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero h1 .accent { color: var(--accent); }

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta span { display: flex; align-items: center; gap: 4px; }

/* ── 11. 카드 ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card {
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,122,0,.08), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.card:hover::before {
  opacity: 1;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-featured {
  border-color: var(--accent);
  border-width: 2px;
}

.card-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

.card-link:hover { gap: 8px; }

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: #fff;
}

/* ── 12. 그리드 ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ── 13. 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(249,115,22,.45);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.1rem;
}

/* ── 14. 계산기 입력 폼 ── */
.calc-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

/* ── 15. 결과 박스 ── */
.result-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.result-row:last-child { border-bottom: none; }

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

.result-row .value {
  font-weight: 700;
  color: var(--text-primary);
}

.result-total {
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

/* ── 16. FAQ 아코디언 ── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover { border-color: var(--accent); }

.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-card);
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.faq-question:hover { background: var(--bg-secondary); }

.faq-question .arrow {
  font-size: 0.8rem;
  transition: transform var(--transition);
  color: var(--text-muted);
}

.faq-item.open .arrow { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 20px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg-card);
}

.faq-item.open .faq-answer { display: block; }

/* ── 17. 섹션 헤더 ── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ── 18. 광고 슬롯 ── */
.ad-slot {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 24px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 19. 배지 ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-orange  { background: var(--accent);  color: #fff; }
.badge-green   { background: var(--green);   color: #fff; }
.badge-blue    { background: var(--blue);    color: #fff; }
.badge-purple  { background: var(--purple);  color: #fff; }
.badge-red     { background: var(--red);     color: #fff; }

/* ── 25. 모바일 전용 최적화 (아이폰·갤럭시) ── */
@media (max-width: 480px) {
  /* 전체 폰트 */
  body { font-size: 15px; line-height: 1.65; }

  /* 컨테이너 좌우 여백 */
  .container { padding: 0 16px; }

  /* 섹션 간격 */
  .section { padding: 32px 0; }
  .section-sm { padding: 24px 0; }

  /* 섹션 헤더 */
  .section-header { margin-bottom: 24px; }
  .section-header h2 { font-size: 1.35rem; }
  .section-header p { font-size: 0.88rem; }

  /* 히어로 */
  .hero { padding: 32px 16px 28px; }
  .hero h1 { font-size: 1.65rem; line-height: 1.3; margin-bottom: 12px; }
  .hero p { font-size: 0.92rem; margin-bottom: 20px; }
  .hero-badge { font-size: 0.75rem; padding: 5px 13px; }

  /* 버튼 */
  .btn { padding: 13px 22px; font-size: 0.95rem; }
  .btn-lg { padding: 14px 26px; font-size: 1rem; width: 100%; justify-content: center; }

  /* 카드 */
  .card { padding: 18px 16px; }

  /* 계산기 폼 */
  .calc-box { padding: 18px 16px; border-radius: var(--radius-lg); }
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 0.88rem; }
  .form-group input,
  .form-group select { padding: 12px 14px; font-size: 0.97rem; }

  /* 결과 박스 */
  .result-box { padding: 16px; }
  .result-row { font-size: 0.88rem; padding: 9px 0; }
  .result-total { font-size: 1rem; padding: 14px 16px; }

  /* 그리드 */
  .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2,1fr); gap: 10px; }

  /* 푸터 */
  .footer { padding: 32px 16px 20px; margin-top: 48px; }
  .footer-grid { gap: 20px; }
  .footer-bottom { font-size: 0.76rem; flex-direction: column; text-align: center; }
  .footer-bottom a { margin-left: 0; }

  /* 네비 */
  .nav { padding: 0 16px; }
  .nav-inner { height: 54px; }
  .nav-logo { font-size: 1.05rem; }

  /* FAQ */
  .faq-question { font-size: 0.9rem; padding: 14px 16px; }
  .faq-answer { font-size: 0.86rem; padding: 0 16px 14px; }

  /* 광고 슬롯 */
  .ad-slot { min-height: 70px; padding: 12px; }
}

/* ── 26. 태블릿 최적화 (아이패드) ── */
@media (min-width: 481px) and (max-width: 1024px) {
  .container { padding: 0 24px; }
  .section { padding: 48px 0; }
  .section-header { margin-bottom: 32px; }
  .hero { padding: 48px 24px 40px; }
  .grid-4 { grid-template-columns: repeat(2,1fr); gap: 14px; }
  .grid-3 { gap: 16px; }
  .calc-box { padding: 28px; }
}

/* ── 27. 데스크톱 최적화 ── */
@media (min-width: 1025px) {
  .container { padding: 0 40px; }
  .section { padding: 72px 0; }
  .section-header { margin-bottom: 48px; }
  .hero { padding: 72px 40px 60px; }
  .hero h1 { letter-spacing: -0.03em; }
  .card { padding: 28px; }
}


/* ── 20. 통계 바 ── */
.stat-bar-wrap {
  background: var(--border);
  border-radius: var(--radius-full);
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 1s ease;
}

/* ── 21. 도구 링크 바 ── */
.tools-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.tools-nav a {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.tools-nav a:hover,
.tools-nav a.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 22. 푸터 ── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 20px 24px;
  margin-top: 80px;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-muted);
  margin-left: 12px;
  transition: color var(--transition);
}

.footer-bottom a:hover { color: var(--accent); }

/* ── 23. 반응형 모바일 ── */
@media (max-width: 768px) {
  .nav-links .hide-mobile { display: none; }
  .hero { padding: 40px 16px 32px; }
  .calc-box { padding: 20px; }
  .section { padding: 48px 0; }
  .footer-grid { gap: 24px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .btn-lg { padding: 14px 28px; font-size: 1rem; }
}

/* ── 24. 유틸리티 ── */
.text-center  { text-align: center; }
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-muted   { color: var(--text-muted); }
.fw-700       { font-weight: 700; }
.fw-800       { font-weight: 800; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
