/*
 * design.css — MediForm SaaS 디자인 시스템 (인디고 그라데이션 + 노랑 CTA)
 * 담당: ○ 동글이 (2026-05-31 SaaS 전환)
 * 적용: 전 페이지 공통 (변수명 유지, SaaS 값·컴포넌트로 교체)
 */

/* ── 0. 폰트 ── */
/* Pretendard: https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css */
/* Inter: https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap */

/* ── 1. 디자인 토큰 (:root 변수) ──────────────────────────── */
:root {
  /* 캔버스 */
  --canvas:          #F9FAFB;
  --canvas-soft:     #F3F4F6;
  --surface-card:    #FFFFFF;
  --surface-strong:  #F3F4F6;

  /* 잉크 */
  --ink:             #111827;
  --primary:         #4F46E5;
  --body:            #4B5563;
  --muted:           #6B7280;
  --muted-soft:      #9CA3AF;

  /* 헤어라인 */
  --hairline:        #E5E7EB;
  --hairline-soft:   #F3F4F6;
  --hairline-strong: #D1D5DB;

  /* 온-컬러 */
  --on-primary:      #FFFFFF;

  /* 다크면 */
  --surface-dark:    #111827;
  --on-dark:         #FFFFFF;

  /* Pastel orb 장식 (인디고/보라/시안 계열) */
  --orb-mint:        #a5b4fc;
  --orb-peach:       #c4b5fd;
  --orb-lavender:    #818cf8;
  --orb-sky:         #67e8f9;
  --orb-rose:        #a78bfa;

  /* Semantic */
  --error:           #DC2626;
  --success:         #16A34A;

  /* SaaS 확장 토큰 */
  --primary-hover:   #4338CA;
  --secondary:       #06B6D4;
  --accent:          #F59E0B;
  --cta:             #FDE68A;
  --cta-ink:         #111827;

  --gradient:        linear-gradient(135deg, #6366F1, #8B5CF6);
  --gradient-btn:    linear-gradient(90deg, #4F46E5, #6366F1);

  --shadow-sm:       0 1px 2px rgba(17,24,39,.06);
  --shadow-md:       0 4px 12px rgba(17,24,39,.08);
  --shadow-indigo:   0 8px 32px rgba(99,102,241,.30);
  --focus-ring:      rgba(79,70,229,.20);

  /* Radius */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-xxl:  24px;
  --r-pill: 9999px;

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-12: 48px;
  --sp-section: 96px;

  /* 타이포 */
  --font-body: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont,
               'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --font-size-caption-up: 12px;
  --font-size-caption:    14px;
  --font-size-body:       16px;
  --font-size-btn:        15px;
  --lh-body: 1.5;
}

/* ── 2. 리셋 베이스 ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--lh-body);
  color: var(--body);
  background: var(--canvas);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* ── 3. 타이포 클래스 ────────────────────────────────────── */

/* Display — SaaS Bold 헤드라인 */
.ds-display {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

/* 섹션 제목 */
.ds-heading {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

/* Caption uppercase */
.ds-caption-up {
  font-size: var(--font-size-caption-up);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Body text */
.ds-body {
  font-size: var(--font-size-body);
  line-height: var(--lh-body);
  color: var(--body);
}
.ds-caption {
  font-size: var(--font-size-caption);
  line-height: 1.5;
  color: var(--muted);
}

/* ── 4. 레이아웃 ─────────────────────────────────────────── */
.ds-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
  width: 100%;
}
.ds-section {
  padding: var(--sp-section) 0;
}

/* ── 5. Gradient Orb 배경 장식 (인디고/보라 톤) ───────────── */
.ds-orb-wrap {
  position: relative;
  overflow: hidden;
}
.ds-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.ds-orb--mint {
  background: radial-gradient(circle, rgba(165,180,252,0.35) 0%, transparent 70%);
}
.ds-orb--peach {
  background: radial-gradient(circle, rgba(196,181,253,0.30) 0%, transparent 70%);
}
.ds-orb--lavender {
  background: radial-gradient(circle, rgba(129,140,248,0.28) 0%, transparent 70%);
}
.ds-orb--sky {
  background: radial-gradient(circle, rgba(103,232,249,0.25) 0%, transparent 70%);
}
.ds-orb--rose {
  background: radial-gradient(circle, rgba(167,139,250,0.25) 0%, transparent 70%);
}

/* ── 6. 버튼 ─────────────────────────────────────────────── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--font-size-btn);
  font-weight: 500;
  height: 40px;
  padding: 0 var(--sp-5);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  border: none;
  text-decoration: none;
}

/* Primary — 인디고 그라데이션 */
.ds-btn--primary {
  background: var(--gradient-btn);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-indigo);
  padding: 14px 28px;
  height: auto;
}
.ds-btn--primary:hover {
  background: linear-gradient(90deg, #4338CA, #4F46E5);
  box-shadow: 0 12px 40px rgba(99,102,241,.40);
}

/* CTA — 노랑 강조 버튼 ("무료 시작 / 데모") */
.ds-btn--cta {
  background: var(--accent);
  color: var(--cta-ink);
  font-weight: 700;
  border-radius: var(--r-xl);
  box-shadow: 0 4px 16px rgba(245,158,11,.30);
  padding: 14px 28px;
  height: auto;
}
.ds-btn--cta:hover {
  background: #FBBF24;
  box-shadow: 0 8px 24px rgba(245,158,11,.40);
}

/* Outline */
.ds-btn--outline {
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
}
.ds-btn--outline:hover {
  background: var(--surface-strong);
  border-color: var(--hairline-strong);
}

/* 큰 버튼 변형 */
.ds-btn--lg {
  height: auto;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
}

/* 다크 배경에서 아웃라인 */
.ds-btn--outline-dark {
  background: transparent;
  color: var(--on-dark);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--r-xl);
}
.ds-btn--outline-dark:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
}

/* ── 7. 카드 ─────────────────────────────────────────────── */
.ds-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
}

/* ── 8. 인풋 ─────────────────────────────────────────────── */
.ds-input {
  width: 100%;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  height: 44px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ds-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.ds-input::placeholder {
  color: var(--muted-soft);
}

/* ── 9. Badge / Pill ─────────────────────────────────────── */
.ds-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(79,70,229,.10);
  color: var(--primary);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: var(--font-size-caption-up);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── 10. 네비게이션 ──────────────────────────────────────── */
.ds-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-8);
  border-bottom: 1px solid var(--hairline);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.ds-nav-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ds-nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.ds-nav-link {
  font-size: var(--font-size-caption);
  font-weight: 500;
  color: var(--muted);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  transition: color 0.12s, background 0.12s;
}
.ds-nav-link:hover {
  color: var(--ink);
  background: var(--canvas-soft);
}

/* ── 11. 구분선 ──────────────────────────────────────────── */
.ds-divider {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: var(--sp-5) 0;
}
.ds-divider-label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--muted-soft);
  font-size: var(--font-size-caption);
}
.ds-divider-label::before,
.ds-divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ── 12. 알림 배너 ───────────────────────────────────────── */
.ds-alert-error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fca5a5;
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--font-size-caption);
}

/* ── 13. 폼 래퍼 ─────────────────────────────────────────── */
.ds-form-group {
  margin-bottom: var(--sp-4);
}
.ds-label {
  display: block;
  font-size: var(--font-size-caption);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--sp-2);
}
.ds-hint {
  font-size: var(--font-size-caption);
  color: var(--muted-soft);
  margin-top: var(--sp-1);
}

/* ── 14. 히어로/CTA 밴드 ─────────────────────────────────── */
.ds-hero-gradient {
  background: var(--gradient);
  color: #FFFFFF;
  padding: 64px 0 80px;
  position: relative;
  overflow: hidden;
}

/* ── 15. 푸터 ────────────────────────────────────────────── */
.ds-footer {
  background: var(--surface-dark);
  color: rgba(255,255,255,0.45);
  padding: var(--sp-8) var(--sp-8);
  font-size: var(--font-size-caption);
  text-align: center;
}
.ds-footer a {
  color: rgba(255,255,255,0.6);
  transition: color 0.12s;
}
.ds-footer a:hover {
  color: var(--on-dark);
}
.ds-footer-links {
  display: flex;
  gap: var(--sp-6);
  justify-content: center;
  margin-bottom: var(--sp-3);
}

/* ── 16. 반응형 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .ds-container {
    padding: 0 var(--sp-5);
  }
  .ds-nav {
    padding: var(--sp-3) var(--sp-5);
  }
  .ds-section {
    padding: 64px 0;
  }
  .ds-footer {
    padding: var(--sp-6) var(--sp-5);
  }
}
@media (max-width: 480px) {
  .ds-container {
    padding: 0 var(--sp-4);
  }
  .ds-nav {
    padding: var(--sp-3) var(--sp-4);
  }
  .ds-card {
    padding: var(--sp-5);
  }
}

/* ── 17-A. 인쇄·리포트 전용 토큰 ───────────────────────── */
@media print {
  /* 인쇄 시 색상 보존 */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 인쇄 시 앱 쉘 숨김 */
  .app-side,
  .app-topbar,
  .app-overlay,
  nav,
  .rr-no-print { display: none !important; }

  /* 인쇄 시 콘텐츠 full-width */
  .app-content { margin-left: 0 !important; min-width: 100% !important; }
  .app-wrap    { display: block !important; }
  .app-main    { padding: 0 !important; }

  /* 버튼·배지 링크 색 제거 */
  a[href]::after { content: none !important; }

  body {
    background: #fff !important;
    font-size: 11pt;
  }

  /* A4 page margin */
  @page {
    size: A4 portrait;
    margin: 16mm 14mm;
  }
}

/* ── 17. RTL 지원 ────────────────────────────────────────── */
[dir="rtl"] .ds-nav {
  flex-direction: row-reverse;
}
[dir="rtl"] .ds-nav-links {
  flex-direction: row-reverse;
}
[dir="rtl"] .ds-footer-links {
  flex-direction: row-reverse;
}
