/* =====================================================================
   DragDocs — 메인 v0.6 / Vanilla 퍼블리싱
   ===================================================================== */

/* ---------------------------------------------------------------- App shell */
.app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.site-header__actions { display: flex; align-items: center; gap: var(--sp-16); flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  color: inherit;
  transition: background 0.2s ease;
}
.icon-btn:hover { background: var(--grey-96); }
.icon-btn img { width: 22px; height: 22px; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-p3);
}
.hamburger { display: none; }

/* 언어 선택 드롭다운 */
.lang { position: relative; }
.lang-btn { cursor: pointer; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 144px;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: var(--z-modal);
}
.lang.is-open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: var(--fs-p3);
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lang-menu__item:hover { background: var(--grey-96); }
.lang-menu__item.is-active { color: var(--accent-blue); font-weight: 700; }

/* 인라인 SVG UI 아이콘 — currentColor 상속 → 테마별 자동 색 반전 (file:// 호환) */
.ui-svg { display: inline-block; color: inherit; }
.ui-svg--lang { width: 18px; height: 18px; }
.ui-svg--set { width: 22px; height: 22px; }

/* 타이틀/메뉴/아이콘 버튼은 포커스 테두리 제거 (폼 입력 요소는 reset의 :focus-visible 유지) */
.site-header__brand:focus,
.site-header__brand:focus-visible,
.icon-btn:focus,
.icon-btn:focus-visible,
.lang-btn:focus,
.lang-btn:focus-visible,
.lang-btn:focus-visible { outline: none; }

/* 지원 포맷 칩 */
.formats { display: flex; flex-direction: column; gap: var(--sp-8); }
.formats__row { display: flex; flex-wrap: wrap; gap: var(--sp-8); justify-content: center; align-items: center; }
.formats__label { font-size: var(--fs-caption); font-weight: 700; color: var(--text-slate); }
.chip {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-p3);
  line-height: 1.5;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  color: rgba(0, 0, 0, 0.45);
}
.chip--docs { background: rgba(0, 174, 255, 0.05); border-color: rgba(0, 174, 255, 0.2); }
.chip--img { background: rgba(238, 91, 61, 0.08); border-color: rgba(238, 91, 61, 0.2); }
.chip--archive { background: rgba(255, 170, 0, 0.05); border-color: rgba(255, 170, 0, 0.2); }

/* 제품 스크린샷 (Office) */
.hero__shot {
  width: min(1080px, 100%);
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}
.hero__shotwrap { position: relative; width: min(1080px, 100%); }
.hero__shotwrap .hero__shot { width: 100%; }
.hero__watermark {
  position: absolute; right: 14px; bottom: 12px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: rgba(13, 18, 32, 0.75); color: var(--white);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}

/* -------------------------------------------------------------------- Modal */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: var(--sp-24);
}
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px); }
.modal__panel {
  position: relative;
  width: min(820px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-32);
  animation: modal-in 0.22s ease;
}
.modal__panel--wide { width: min(960px, 100%); }
.modal__panel--contact { width: min(820px, 100%); padding: var(--sp-24); }
.modal__panel--contact .form { gap: 8px var(--sp-12); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.modal__panel--contact .form__half { grid-column: span 3; }
.modal__panel--contact .form__third { grid-column: span 2; }
.modal__panel--contact .modal__head { margin-bottom: var(--sp-16); }
.modal__panel--video { padding: 0; background: #000; overflow: hidden; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-16); margin-bottom: var(--sp-24); }
.modal__title { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.5px; }
.modal__close { width: 36px; height: 36px; border-radius: var(--radius-pill); display: grid; place-items: center; font-size: 22px; color: var(--text-slate); }
.modal__close:hover { background: var(--grey-96); }
.modal__panel--video .modal__close { position: absolute; top: 12px; right: 12px; color: #fff; background: rgba(0,0,0,0.4); z-index: 2; }
.modal video { width: 100%; height: auto; display: block; }

/* 도구/외부앱 모달 (iframe 전체화면) */
.modal__panel--tool {
  width: min(1600px, 96vw);
  height: 92vh; max-height: 92vh;
  padding: 0; overflow: hidden; background: var(--white);
  display: flex; flex-direction: column;
}
.modal__titlebar { display: none; } /* 기본: 플로팅 X 모드 (viewer 만 타이틀바 사용) */
.modal__panel--tool.is-titlebar .modal__titlebar {
  flex: 0 0 auto; height: 44px; display: flex; align-items: center;
  gap: 12px; padding: 0 52px 0 16px;
  border-bottom: 1px solid var(--border); background: var(--white);
}
.modal__titlebar-name {
  font-size: var(--fs-body); font-weight: 600; color: var(--text-slate);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modal__toolframe { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; display: block; }
.modal__close--tool {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  color: var(--text-slate); background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
}
.modal__close--tool:hover { background: #fff; }
.modal__panel--tool.is-titlebar .modal__close--tool {
  background: transparent; box-shadow: none;
  width: 28px; height: 28px; font-size: 20px;
  top: 8px; transform: none;   /* 타이틀바(44px) 세로 중앙: (44-28)/2 */
}
.modal__panel--tool.is-titlebar .modal__close--tool:hover { background: var(--grey-96); }
/* 추출기/변환기: 자체 다크 타이틀바(windowbar 40px) 안에 닫기 X 를 녹여 넣는다 */
.modal__panel--tool.is-dark-titlebar .modal__close--tool {
  top: 4px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 8px; font-size: 20px;
  color: #fff; background: transparent; box-shadow: none;
}
.modal__panel--tool.is-dark-titlebar .modal__close--tool:hover { background: rgba(255, 255, 255, 0.14); }

.modal__panel--privacy { width: min(900px, 100%); padding: 0; }
.modal__panel--privacy .modal__head {
  position: sticky; top: 0; z-index: 1;
  margin: 0; padding: 22px 32px;
  background: var(--white); border-bottom: 1px solid #e5e7eb;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.privacy-doc { padding: 18px 32px 32px; font-size: 14px; line-height: 1.75; color: #374151; }
.pp-lead { color: #4b5563; margin-bottom: 4px; }
.pp-art { margin-top: 26px; }
.pp-art__title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 10px; }
.pp-text { margin: 6px 0; }
.pp-list { list-style: decimal; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.pp-list > li { padding-left: 4px; }
.pp-sub { list-style: disc; padding-left: 20px; margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }
.pp-sub--dash { list-style-type: "– "; }
.pp-table-wrap { overflow-x: auto; margin: 11px 0 2px; }
.pp-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; line-height: 1.55; }
.pp-table th, .pp-table td { border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left; vertical-align: top; }
.pp-table th { background: #f9fafb; font-weight: 700; color: #111827; }
.pp-card { margin-top: 9px; padding: 14px 16px; background: #f9fafb; border: 1px solid #eef0f3; border-radius: 10px; }
.pp-card__title { font-weight: 700; color: #111827; margin-bottom: 4px; }
.pp-card p { margin: 2px 0; }
.pp-card a { color: var(--accent-blue); }
.pp-effective { margin-top: 28px; padding-top: 16px; border-top: 1px solid #e5e7eb; color: #6b7280; font-size: 13px; }

/* spec rows (system requirements) */
.spec { display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-16) var(--sp-24); }
.spec dt { font-weight: 700; color: var(--text); }
.spec dd { color: var(--text-paragraph); font-size: var(--fs-p3); line-height: 1.7; }

/* contact form */
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px var(--sp-16);
}
.form__full,
.consent--privacy,
.btn-primary { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-p3); font-weight: 600; }
.field label .req { color: var(--danger); }
.field input,
.field select,
.field textarea {
  border: 1px solid var(--grey-91);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: var(--fs-p3);
  background: var(--grey-98);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field select { height: 48px; cursor: pointer; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent-blue); background: var(--white); }
.field textarea { resize: vertical; min-height: 112px; }
.field input[type="file"] {
  color: var(--text-paragraph);
  cursor: pointer;
  height: 48px;
  padding: 7px 14px;
}
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  background: color-mix(in srgb, var(--accent-blue) 8%, white);
  color: var(--accent-blue);
  font-weight: 700;
  cursor: pointer;
}
.field input[type="file"]::file-selector-button:hover { background: color-mix(in srgb, var(--accent-blue) 14%, white); }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.file-list[hidden] { display: none; }
.file-list__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--grey-91);
  border-radius: var(--radius-md);
  background: var(--grey-98);
  font-size: var(--fs-caption);
}
.file-list__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list__size { flex-shrink: 0; color: var(--text-paragraph); }
.file-list__remove { flex-shrink: 0; border: 0; background: transparent; color: var(--danger); font-weight: 700; font-size: 16px; line-height: 1; cursor: pointer; }
.field__hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-paragraph);
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-12);
  font-size: var(--fs-caption);
  color: var(--text-paragraph);
}
.consent input { margin-top: 2px; }
.consent--privacy {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--grey-91);
  border-radius: var(--radius-md);
  background: var(--grey-98);
}
.consent__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: var(--fs-caption);
  font-weight: 600;
}
.consent__check .req { color: var(--danger); }
.privacy-summary {
  color: var(--text-paragraph);
}
.privacy-summary dl {
  display: grid;
  gap: 5px;
  margin: 0;
}
.privacy-summary dl > div {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.privacy-summary dt {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
}
.privacy-summary dd,
.privacy-summary p {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  word-break: keep-all;
}
.privacy-summary p {
  margin-top: 7px;
  color: #7a8798;
}
.btn-primary {
  margin-top: var(--sp-8);
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--accent-blue);
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-p2);
}
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { cursor: progress; opacity: 0.9; filter: none; }
.btn-spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.form-progress { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--grey-91); overflow: hidden; }
.form-progress[hidden] { display: none; }
.form-progress > span {
  display: block; width: 40%; height: 100%; border-radius: inherit;
  background: var(--accent-blue);
  animation: progress-indeterminate 1.1s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* ==================================================================== Tablet */
/* ==================================================================== Mobile */
@media (max-width: 767px) {
  .site-footer { left: var(--sp-16); }
  .modal__panel { padding: var(--sp-24); }
  .modal__panel--privacy { padding: 0; }
  .modal__panel--privacy .modal__head { padding: 18px 18px; }
  .privacy-doc { padding: 14px 18px 24px; }
  .form { grid-template-columns: 1fr; }
  .file-list { grid-template-columns: 1fr; }
  .consent--privacy { grid-template-columns: 1fr; }
  .privacy-summary { grid-template-columns: 1fr; }
  .spec { grid-template-columns: 1fr; gap: var(--sp-4) 0; }
  .spec dt { margin-top: var(--sp-12); }
}

/* ----------------------------------------------------- Mobile slide-in menu */
.menu {
  position: fixed; inset: 0; z-index: var(--z-modal);
}
.menu[hidden] { display: none; }
.menu__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.menu__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(320px, 84%);
  background: var(--white); color: var(--text);
  padding: var(--sp-24);
  display: flex; flex-direction: column; gap: var(--sp-8);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
  animation: slide-in 0.24s ease;
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
.menu__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-16); }
.menu__head strong { font-family: var(--font-brand); }
.menu__item { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12); border-radius: var(--radius-md); font-weight: 600; }
.menu__item img, .menu__item svg { width: 20px; height: 20px; flex: none; }
.menu__item:hover, .menu__item.is-active { background: var(--grey-96); }
.menu__divider { height: 1px; background: var(--grey-91); margin: var(--sp-8) 0; }
