﻿/* ==========================================================================
   SmartLaw Hybrid Web Interface Stylesheet
   - 법무법인(유) 원앤파트너스 스마트 서식 제공 및 안내
   - 원앤파트너스 공식 사이트 컬러 컨셉 반영 (네이비 + 로열 블루)
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", "Malgun Gothic", sans-serif;
  
  /* ─── 원앤파트너스 공식 Color Palette ─── */
  /* 딥 네이비 (헤더·선택·강조) */
  --navy:           #1a3a78;
  --navy-dark:      #142e62;
  --navy-light:     #eef2fb;

  /* 로열 블루 (주요 버튼·링크) */
  --blue:           #1e56c8;
  --blue-hover:     #1848ae;
  --blue-light:     #e8f0fc;
  --blue-lighter:   #f0f5ff;

  /* 배경 */
  --bg-page:        #f5f6f9;
  --bg-shell:       #ffffff;
  --bg-subtle:      #f4f6fb;   /* 옅은 블루-그레이 */
  --bg-card:        #ffffff;
  --bg-hover:       #f7f9fd;
  --bg-selected:    #eef2fb;

  /* 텍스트 */
  --text-primary:   #151c2e;
  --text-secondary: #3a4460;
  --text-muted:     #6b7597;
  --text-light:     #9ba4be;

  /* 보더 */
  --border-light:   #dde3ef;
  --border-subtle:  #e8edf7;
  --border-focus:   #1e56c8;

  /* Primary 버튼 (로열 블루) */
  --primary-btn-bg:           #1e56c8;
  --primary-btn-hover:        #1848ae;
  --primary-btn-text:         #ffffff;
  --primary-btn-disabled-bg:  #c8d4ee;
  --primary-btn-disabled-text:#8fa0c8;

  /* Secondary 버튼 */
  --secondary-btn-bg:     #ffffff;
  --secondary-btn-border: #c8d3e8;
  --secondary-btn-text:   #1a3a78;
  --secondary-btn-hover:  #eef2fb;

  /* Radius */
  --radius-lg: 12px;
  --radius-md: 6px;
  --radius-sm: 4px;

  /* Shadows */
  --shadow-shell:      0 6px 24px rgba(26, 58, 120, 0.08);
  --shadow-card:       0 1px 4px rgba(26, 58, 120, 0.04);
  --shadow-card-hover: 0 4px 16px rgba(26, 58, 120, 0.1);
  --shadow-modal:      0 16px 40px rgba(26, 58, 120, 0.18);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* App Shell (Container) */
.app-shell {
  width: 94%;
  max-width: 1040px;
  margin: 28px auto 40px;
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shell);
  overflow: hidden;
  position: relative;
  transition: transform 0.15s ease-out;
  transform-origin: top center;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* App Shell (Container) */
.app-shell {
  width: 94%;
  max-width: 1040px;
  margin: 28px auto 40px;
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shell);
  overflow: hidden;
  position: relative;
  transition: transform 0.15s ease-out;
  transform-origin: top center;
}

/* Header Bar */
.site-header {
  min-height: 46px;
  padding: 0 24px;
  background-color: var(--navy);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  font-size: 13px;
}

.brand-text {
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-text:hover {
  color: #ffffff;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 2px 4px;
  gap: 4px;
}

.zoom-btn {
  padding: 3px 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  border-radius: 3px;
  transition: background 0.15s;
}

.zoom-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
}

.zoom-level {
  font-size: 12px;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
  color: rgba(255,255,255,0.85);
  user-select: none;
}

.zoom-reset-btn {
  font-size: 12px;
  padding: 3px 10px;
  border-left: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
}

.zoom-reset-btn:hover {
  color: #ffffff;
}

.header-credit {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Main Content Area */
main {
  padding: 36px 42px 48px;
}

/* Title & Logo Unified Row (한줄로 좌우 위치) */
.title-logo-header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.title-area {
  flex: 1;
  min-width: 0;
}

.title-area .page-title {
  margin-bottom: 8px;
}

.title-area .page-subtitle {
  margin-bottom: 0;
}

.firm-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.firm-logo-link:hover {
  opacity: 0.8;
}

.firm-logo-group {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 6px;
}

.firm-logo-img {
  height: 46px;
  width: auto;
  max-width: 230px;
  object-fit: contain;
  display: block;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 22px;
  font-weight: 400;
}

/* Info Bar Banner */
.info-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.info-bar-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-bar-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.info-bar-btn:hover {
  color: var(--blue-hover);
}

/* Action Buttons */
.btn-primary {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
  border: 1px solid var(--primary-btn-bg);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-btn-hover);
  border-color: var(--primary-btn-hover);
}

.btn-primary:disabled {
  background: var(--primary-btn-disabled-bg);
  border-color: var(--primary-btn-disabled-bg);
  color: var(--primary-btn-disabled-text);
}

.btn-secondary {
  background: var(--secondary-btn-bg);
  color: var(--secondary-btn-text);
  border: 1px solid var(--secondary-btn-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--secondary-btn-hover);
  border-color: #a8b8d8;
  color: var(--navy);
}

.btn-compact {
  padding: 9px 18px;
  font-size: 14px;
}

/* Home Screen Specific */
.home-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.home-action-btn {
  padding: 22px 28px;
  font-size: 18px;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-align: center;
}

.usage-steps-section {
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
  margin-top: 24px;
}

.section-head {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.section-head-note {
  font-size: 13px;
  color: var(--text-muted);
}

/* 이용 순서 순서도 가로 3단계 플로우차트 (1단계 파랑, 2단계 주황, 3단계 초록) */

/* 1단계: 블루 (상황 확인) */
.step-flow-wrapper > :nth-child(1),
.step-card-1 {
  border-top-color: #2563eb !important;
}
.step-flow-wrapper > :nth-child(1) .step-badge,
.step-card-1 .step-badge {
  color: #2563eb !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}
.step-flow-wrapper > :nth-child(1):hover,
.step-card-1:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
  border-color: #93c5fd;
  border-top-color: #1d4ed8 !important;
}

/* 2단계: 주황·앰버 (서식 안내) */
.step-flow-wrapper > :nth-child(3),
.step-card-2 {
  border-top-color: #f59e0b !important;
}
.step-flow-wrapper > :nth-child(3) .step-badge,
.step-card-2 .step-badge {
  color: #d97706 !important;
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
.step-flow-wrapper > :nth-child(3):hover,
.step-card-2:hover {
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.14);
  border-color: #fcd34d;
  border-top-color: #d97706 !important;
}

/* 3단계: 초록·에메랄드 (Word/PDF 이용) */
.step-flow-wrapper > :nth-child(5),
.step-card-3 {
  border-top-color: #10b981 !important;
}
.step-flow-wrapper > :nth-child(5) .step-badge,
.step-card-3 .step-badge {
  color: #059669 !important;
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}
.step-flow-wrapper > :nth-child(5):hover,
.step-card-3:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.14);
  border-color: #86efac;
  border-top-color: #059669 !important;
}
.step-flow-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 36px;
}

.step-card {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid var(--blue);
  border-radius: 10px;
  padding: 22px 20px 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
  border-color: #cbd5e1;
}

.step-card-header {
  margin-bottom: 12px;
  text-align: center;
}

.step-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 20px;
  line-height: 1.3;
}

.step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.35;
  letter-spacing: -0.3px;
  text-align: center;
}

.step-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin: 0;
  word-break: keep-all;
  flex: 1;
}

.step-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
  width: 24px;
  user-select: none;
}

.step-flow-arrow svg {
  display: block;
}

@media (max-width: 768px) {
  .step-flow-wrapper {
    flex-direction: column;
    gap: 8px;
  }
  .step-flow-arrow {
    width: 100%;
    height: 24px;
    transform: rotate(90deg);
  }
}

.footer-notes {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.saved-session-banner {
  background: var(--blue-light);
  border: 1px solid #b3c8ef;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--navy-dark);
  font-size: 14px;
  margin-bottom: 24px;
}

.saved-session-banner button {
  background: var(--blue);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

.saved-session-banner button:hover {
  background: var(--blue-hover);
}

/* Question Screen Specific */
.question-nav-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 14px;
}

.question-stage-tag {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.top-nav-buttons button {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}

/* Accordion: 지금까지 선택한 내용 */
.accordion-wrapper {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-top: 14px;
  margin-bottom: 28px;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  position: relative;
}

/* 지금까지 선택한 내용 영역 아래 명확한 구분선 및 여백 */
.accordion-wrapper::after {
  content: "";
  display: block;
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
}

.accordion-header {
  padding: 10px 18px;
  background: #f1f5f9;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  user-select: none;
  border-left: 4px solid #2563eb;
  border-bottom: 1px solid #e2e8f0;
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px 0;
}

.accordion-header {
  white-space: nowrap;
}

.accordion-header-left {
  white-space: nowrap;
}

.accordion-title {
  white-space: nowrap;
}

.accordion-count {
  white-space: nowrap;
}

.accordion-header-left:hover .accordion-title {
  color: #1d4ed8;
}

.accordion-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: -0.3px;
  transition: color 0.15s ease;
}

.accordion-count {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  margin-left: 2px;
}

.accordion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.accordion-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1;
}

.accordion-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.accordion-btn-reset {
  color: #475569;
}

.accordion-btn-reset:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.accordion-btn-catalog {
  color: #1e40af;
  background: #f0f7ff;
  border-color: #bfdbfe;
}

.accordion-btn-catalog:hover {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #e0f2fe;
}

.accordion-arrow {
  font-size: 11px;
  color: #2563eb;
  transition: transform 0.2s ease;
  display: inline-block;
}

.accordion-wrapper.open .accordion-arrow {
  transform: rotate(90deg);
}

.accordion-content {
  display: none;
  padding: 18px 22px;
  background: #ffffff;
}

.accordion-wrapper.open .accordion-content {
  display: block;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-item {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
}

.summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-q {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 38%;
}

.summary-a {
  color: var(--text-primary);
  font-weight: 600;
  flex: 1;
}

.summary-edit-btn {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 4px 12px;
  margin-left: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.summary-edit-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

/* Choices Grid (Cards) */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.choice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 15px 14px;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  user-select: none;
}

.choice-card:hover {
  border-color: var(--blue);
  background-color: var(--bg-hover);
  box-shadow: var(--shadow-card-hover);
}

.choice-card.selected {
  border: 2px solid var(--blue) !important;
  background-color: var(--blue-lighter);
  box-shadow: 0 0 0 1px var(--blue), 0 4px 14px rgba(30, 86, 200, 0.12);
  padding: 14px 13px;
}

.choice-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.choice-check-badge {
  display: none;
  width: 18px;
  height: 18px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-card.selected .choice-check-badge {
  display: inline-flex;
}

.choice-card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.choice-card.selected .choice-card-desc {
  color: var(--text-secondary);
}

/* Bottom Navigation Bar (이전/다음 하단 배치) */
.bottom-nav-container {
  margin-top: 24px;
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bottom-nav-buttons {
  display: flex;
  gap: 12px;
}

.bottom-nav-btn {
  flex: 1;
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.bottom-aux-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.aux-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.aux-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.aux-btn:active {
  transform: translateY(0);
  background: #f1f5f9;
}

.aux-btn-catalog:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}

.aux-btn-reset:hover {
  border-color: #cbd5e1;
  color: #dc2626;
  background: #fef2f2;
}

.bottom-aux-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.bottom-link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bottom-link:hover {
  color: var(--navy);
}

/* Result Screen Specific */
.result-actions-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.result-actions-nav button {
  flex: 1;
  min-height: 46px;
}

.result-section {
  margin-top: 32px;
}

.result-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy-light);
}

/* Matched Form Card */
.form-card {
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  background: #ffffff;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(26, 58, 120, 0.06);
}

.form-card-badge {
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-card-action {
  flex-shrink: 0;
}

/* Pre-check / Verification Section */
.verification-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 32px;
}

.verification-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.verification-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.verification-toggle-details {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.verification-toggle-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.verification-toggle-summary:hover {
  color: var(--navy);
}

.verification-toggle-content {
  margin-top: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Bottom Consultation Card */
.consult-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  background: var(--navy);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
}

.consult-firm-tag {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}

.consult-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.consult-desc {
  font-size: 13.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

.consult-card .btn-secondary {
  background: #ffffff;
  color: var(--navy);
  border-color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}

.consult-card .btn-secondary:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
}

/* Modal Overlay & Dialog */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 17, 21, 0.45);
  backdrop-filter: blur(3px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  font-size: 20px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  background: #f0f1f4;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #fafafc;
}

/* Modal Form Styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea, .form-group select {
  padding: 11px 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 86, 200, 0.12);
}

/* Catalog Page View */
.privacy-group {
  margin-top: 4px;
}

.privacy-textarea {
  height: 120px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
  white-space: pre-wrap;
  font-family: inherit;
}

.privacy-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  margin-top: 6px;
  user-select: none;
}

.privacy-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--blue);
  margin: 0;
}

.captcha-group {
  margin-top: 6px;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.captcha-badge {
  background: #1e293b;
  color: #38bdf8;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 14px;
  border-radius: 6px;
  user-select: none;
  min-width: 95px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.captcha-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.captcha-refresh-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #94a3b8;
}

.captcha-input {
  width: 110px !important;
  text-align: center;
  font-weight: 700;
  font-size: 14.5px !important;
  letter-spacing: 0.5px;
  -moz-appearance: textfield;
}

.captcha-input::-webkit-outer-spin-button,
.captcha-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.catalog-page-view {
  animation: fadeIn 0.2s ease-out;
}

.catalog-search-wrap {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px 14px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.catalog-page-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.catalog-page-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  transition: all 0.15s ease;
}

.catalog-page-item:hover {
  border-color: var(--blue);
  box-shadow: 0 3px 8px rgba(30, 86, 200, 0.08);
}

.catalog-page-item-info {
  flex: 1;
}

.catalog-page-item-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.catalog-page-item-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.catalog-page-item-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.catalog-page-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.catalog-page-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Catalog Search Modal */
.catalog-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.catalog-search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 86, 200, 0.12);
}

.catalog-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.category-chip {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 12.5px;
  background: #f5f6f8;
  color: var(--text-secondary);
  cursor: pointer;
}

.category-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 600;
}

.category-chip:hover:not(.active) {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.catalog-items-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
}

.catalog-item-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #fff;
}

.catalog-item-row:hover {
  background: #fafafc;
  border-color: #dedfe3;
}

.catalog-item-info h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.catalog-item-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive Breakpoints (Hybrid Web Optimization) */
@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  main {
    padding: 24px 20px 36px;
  }

  .site-header {
    padding: 8px 16px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .brand-text {
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .header-tools {
    width: auto;
    justify-content: flex-end;
    flex-shrink: 0;
  }

  .zoom-controls {
    padding: 2px 4px;
    gap: 2px;
  }

  .zoom-btn {
    padding: 2px 6px;
    font-size: 11px;
  }

  .zoom-level {
    font-size: 11px;
    min-width: 36px;
  }

  .zoom-reset-btn {
    font-size: 11px;
    padding: 2px 6px;
  }

  .title-logo-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
  }

  .title-area {
    flex: 1;
    min-width: 0;
  }

  .page-title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.4px;
    margin-bottom: 4px;
    word-break: keep-all;
  }

  .page-subtitle {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
    margin-bottom: 0;
    word-break: keep-all;
  }

  .firm-logo-group {
    flex-shrink: 0;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .firm-logo-img {
    height: 28px;
    max-width: 130px;
    width: auto;
    object-fit: contain;
  }

  .home-actions-grid {
    grid-template-columns: 1fr;
  }

  .choices-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-card-action {
    width: 100%;
  }

  .form-card-action button {
    width: 100%;
  }

  .consult-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .consult-card button {
    width: 100%;
  }

  /* Accordion mobile 1-line optimization */
  .accordion-header {
    padding: 8px 12px;
    gap: 8px;
  }

  .accordion-header-left {
    gap: 6px;
  }

  .accordion-title {
    font-size: 12.5px;
  }

  .accordion-count {
    font-size: 11.5px;
  }

  .accordion-count-suffix {
    display: none;
  }

  .btn-label-desktop {
    display: none;
  }

  .accordion-actions {
    margin-left: 6px;
    gap: 5px;
  }

  .accordion-btn {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
    border-radius: 4px;
  }
    width: 100%;
  }
}



@media (max-width: 480px) {
  .site-header {
    padding: 8px 12px;
  }
  main {
    padding: 18px 14px 32px;
  }
  .page-title {
    font-size: 19px;
  }
  .firm-logo-img {
    height: 25px;
    max-width: 112px;
  }
}

/* ========================================================
   Catalog Master-Detail Layout (좌측 서식 목록, 우측 상세 설명)
   ======================================================== */
.catalog-split-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 680px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Left Sidebar: Form List */
.catalog-sidebar {
  border-right: 1px solid var(--border-light);
  background: #fafafc;
  display: flex;
  flex-direction: column;
  height: 720px;
}

.catalog-sidebar-header {
  padding: 12px 14px;
  background: #f1f3f7;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  justify-content: flex-start;
}

.catalog-sidebar-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-sidebar-item {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f4;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.catalog-sidebar-item:hover {
  background: #eef2f9;
}

.catalog-sidebar-item.active {
  background: #dbe7fa;
  border-left: 4px solid var(--blue);
}

.catalog-item-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 3px;
}

.catalog-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

/* Right Content: Detail View */
.catalog-detail-pane {
  padding: 24px 28px;
  overflow-y: auto;
  height: 720px;
  display: flex;
  flex-direction: column;
}

.detail-badge-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

.detail-main-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
  line-height: 1.3;
}

.detail-usage-box {
  background: #f8fafc;
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 22px;
}

.detail-usage-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.detail-usage-box p {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
}

.detail-section-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 12px;
  padding-left: 10px;
  padding-bottom: 6px;
  display: block;
  letter-spacing: -0.3px;
}

/* 용도: 인디고/슬레이트 블루 테마 */
.detail-section-heading.heading-usage {
  color: #1e293b;
  border-left: 4px solid #3b82f6;
  border-bottom: 1px solid #e2e8f0;
}

.detail-usage-text p {
  font-size: 13.8px;
  color: #334155;
  line-height: 1.65;
  padding-left: 10px;
  margin-bottom: 18px;
}

/* 작성 방법: 블루 테마 */
.detail-section-heading.heading-guide {
  color: #1e3a8a;
  border-left: 4px solid #2563eb;
  border-bottom: 1px solid #dbeafe;
}

/* 주의사항: 웜 오렌지 / 레드 테마 */
.detail-section-heading.heading-warning {
  color: #c2410c;
  border-left: 4px solid #ea580c;
  border-bottom: 1px solid #ffedd5;
}

/* 제출처: 에메랄드 그린 / 청록 테마 */
.detail-section-heading.heading-destination {
  color: #047857;
  border-left: 4px solid #059669;
  border-bottom: 1px solid #d1fae5;
}

.detail-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.detail-bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.6;
}

.detail-bullets li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--blue);
  font-weight: bold;
}

.detail-bullets.warning li::before {
  color: #dc2626;
}

.detail-bullets.destination li::before {
  color: #059669;
}

/* Download Cards Bar */
.detail-download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.detail-dl-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  background: #f8fafc;
}

.detail-dl-card h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-dl-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-dl-btns {
  display: flex;
  gap: 10px;
  width: 100%;
}

.detail-dl-btns a,
.detail-dl-btns button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.btn-file-open {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-file-open:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-file-save {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-file-save:hover {
  background: #1d4ed8;
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

@media (max-width: 768px) {
  .catalog-split-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .catalog-sidebar {
    height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .catalog-detail-pane {
    height: auto;
    padding: 18px;
  }
  .detail-download-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 플로팅 문의하기 버튼 ===== */
.floating-inquiry-btn {
  position: fixed;
  right: 24px;
  bottom: 40px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  line-height: 1;
}

.floating-inquiry-btn:hover {
  background: #1d4ed8;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.floating-inquiry-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.floating-inquiry-icon {
  font-size: 22px;
  line-height: 1;
}

.floating-inquiry-text {
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .floating-inquiry-btn {
    right: 16px;
    bottom: 24px;
    padding: 12px 16px;
  }
}
