/* =====================================================================
 * WeddingFit — 디자인 시스템
 * 아이보리 · 블러쉬 · 샴페인 골드 / Cormorant Garamond + Pretendard
 * ===================================================================== */

:root {
  --wf-bg:        #FDFBF9;
  --wf-surface:   #FFFFFF;
  --wf-ink:       #241C22;
  --wf-body:      #5C5058;
  --wf-muted:     #8E8189;
  --wf-line:      #EFE6E0;
  --wf-line-soft: #F6EFEA;

  --wf-blush-50:  #FCF6F4;
  --wf-blush-100: #F8EBE7;
  --wf-blush-200: #EFD6D0;
  --wf-rose:      #C0797B;
  --wf-rose-dark: #A25E62;
  --wf-gold:      #B99457;
  --wf-gold-soft: #E8D9BE;

  --wf-radius:    18px;
  --wf-shadow:    0 10px 30px -12px rgba(72, 44, 52, .18);
  --wf-shadow-lg: 0 24px 60px -20px rgba(72, 44, 52, .28);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; color-scheme: light; }

body {
  background: var(--wf-bg);
  color: var(--wf-body);
  font-family: Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.wf-serif { font-family: 'Cormorant Garamond', 'Noto Serif KR', serif; }

h1, h2, h3, h4, .wf-display {
  color: var(--wf-ink);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wf-display {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
}

.wf-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--wf-gold);
}

/* ── 버튼 ─────────────────────────────────────────────────────────── */
.wf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 999px; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 14px 24px; transition: all .18s ease; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.wf-btn-primary { background: var(--wf-rose); color: #fff; box-shadow: 0 10px 24px -12px rgba(162, 94, 98, .8); }
.wf-btn-primary:hover { background: var(--wf-rose-dark); transform: translateY(-1px); }
.wf-btn-ghost { background: #fff; color: var(--wf-ink); border-color: var(--wf-line); }
.wf-btn-ghost:hover { border-color: var(--wf-blush-200); background: var(--wf-blush-50); }
.wf-btn-dark { background: var(--wf-ink); color: #fff; }
.wf-btn-dark:hover { background: #3a2d35; }
.wf-btn-gold { background: linear-gradient(135deg, #C9A76B, #A9823F); color: #fff; }
.wf-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.wf-btn-sm { padding: 9px 16px; font-size: 13px; }
.wf-btn-lg { padding: 17px 32px; font-size: 15px; }
.wf-btn-block { width: 100%; }

/* ── 카드 ─────────────────────────────────────────────────────────── */
.wf-card {
  background: var(--wf-surface);
  border: 1px solid var(--wf-line);
  border-radius: var(--wf-radius);
  overflow: hidden;
}
.wf-card-hover { transition: box-shadow .2s ease, transform .2s ease; }
.wf-card-hover:hover { box-shadow: var(--wf-shadow); transform: translateY(-3px); }

/* ── 칩 / 태그 ────────────────────────────────────────────────────── */
.wf-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--wf-line); color: var(--wf-body); background: #fff;
  cursor: pointer; transition: all .15s ease; user-select: none;
}
.wf-chip:hover { border-color: var(--wf-blush-200); background: var(--wf-blush-50); }
.wf-chip.is-on { background: var(--wf-ink); border-color: var(--wf-ink); color: #fff; }
.wf-chip-sm { padding: 5px 10px; font-size: 11.5px; }

.wf-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: var(--wf-blush-100); color: var(--wf-rose-dark);
}
.wf-tag-gold { background: #F7EFE1; color: #8A6A2E; }
.wf-tag-ink  { background: #F1EDEF; color: var(--wf-ink); }

/* ── 입력 ─────────────────────────────────────────────────────────── */
.wf-input, .wf-select, .wf-textarea {
  width: 100%; background: #fff; border: 1px solid var(--wf-line);
  border-radius: 12px; padding: 13px 15px; font-size: 14px; color: var(--wf-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wf-input:focus, .wf-select:focus, .wf-textarea:focus {
  outline: none; border-color: var(--wf-rose);
  box-shadow: 0 0 0 3px rgba(192, 121, 123, .12);
}
.wf-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--wf-ink); margin-bottom: 7px; }
.wf-help  { font-size: 12px; color: var(--wf-muted); margin-top: 6px; }

/* ── 매치 점수 ────────────────────────────────────────────────────── */
.wf-match {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600;
  color: var(--wf-rose-dark); line-height: 1;
}
.wf-match small { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--wf-muted); }

.wf-bar { height: 6px; border-radius: 999px; background: var(--wf-blush-100); overflow: hidden; }
.wf-bar > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--wf-blush-200), var(--wf-rose)); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ── 드레스 카드 이미지 영역 ──────────────────────────────────────── */
.wf-dress-img {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: linear-gradient(160deg, #FCF8F6 0%, #F4EAE6 100%);
  display: flex; align-items: flex-end; justify-content: center;
}
.wf-dress-img svg { width: 100%; height: 100%; }
.wf-dress-img img { width: 100%; height: 100%; object-fit: cover; }

.wf-heart {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border-radius: 999px; background: rgba(255,255,255,.9); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  border: 1px solid rgba(255,255,255,.6); cursor: pointer; transition: transform .15s ease;
  color: #C9A6A8;
}
.wf-heart:hover { transform: scale(1.1); }
.wf-heart.is-on { color: #D5555C; background: #fff; }

/* ── 스텝 인디케이터 ──────────────────────────────────────────────── */
.wf-steps { display: flex; align-items: center; gap: 6px; }
.wf-step {
  flex: 1; height: 3px; border-radius: 999px; background: var(--wf-line);
  position: relative; transition: background .3s ease;
}
.wf-step.is-done, .wf-step.is-now { background: var(--wf-rose); }
.wf-step-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--wf-muted); }

/* ── 스켈레톤 ─────────────────────────────────────────────────────── */
.wf-skeleton {
  background: linear-gradient(90deg, #F5EEEA 25%, #FBF6F3 37%, #F5EEEA 63%);
  background-size: 400% 100%; animation: wf-shimmer 1.3s ease infinite; border-radius: 12px;
}
@keyframes wf-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── 토스트 ───────────────────────────────────────────────────────── */
#wf-toast-wrap {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 420px);
}
.wf-toast {
  background: rgba(36, 28, 34, .95); color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 12px 18px; border-radius: 999px; box-shadow: var(--wf-shadow);
  animation: wf-toast-in .25s ease; max-width: 100%;
}
.wf-toast.is-error { background: #9C3B44; }
@keyframes wf-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── 모달 ─────────────────────────────────────────────────────────── */
.wf-modal-bg {
  position: fixed; inset: 0; background: rgba(36, 28, 34, .45); backdrop-filter: blur(3px);
  z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: wf-fade .2s ease;
}
@media (min-width: 640px) { .wf-modal-bg { align-items: center; padding: 24px; } }
.wf-modal {
  background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; box-shadow: var(--wf-shadow-lg); animation: wf-up .28s cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 640px) { .wf-modal { border-radius: 22px; } }
@keyframes wf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wf-up { from { transform: translateY(24px); opacity: .5; } to { transform: none; opacity: 1; } }

/* ── 헤더 / 하단 탭 ───────────────────────────────────────────────── */
.wf-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(253, 251, 249, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wf-line-soft);
}
.wf-nav-link { font-size: 13.5px; font-weight: 500; color: var(--wf-body); transition: color .15s ease; }
.wf-nav-link:hover, .wf-nav-link.is-active { color: var(--wf-rose-dark); }

.wf-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--wf-line-soft);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) { .wf-tabbar { display: none; } }
.wf-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; font-size: 10.5px; color: var(--wf-muted); font-weight: 500;
}
.wf-tab.is-active { color: var(--wf-rose-dark); }
.wf-tab svg { width: 20px; height: 20px; }

/* ── 섹션 유틸 ────────────────────────────────────────────────────── */
.wf-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.wf-section { padding: 56px 0; }
@media (min-width: 768px) { .wf-section { padding: 84px 0; } }
.wf-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--wf-line), transparent); }

.wf-scroll-x { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.wf-scroll-x > * { scroll-snap-align: start; flex: 0 0 auto; }
.wf-scroll-x::-webkit-scrollbar { height: 0; }

/* ── Before / After 슬라이더 ──────────────────────────────────────── */
.wf-ba { position: relative; overflow: hidden; border-radius: 16px; background: #F4EAE6; touch-action: pan-y; }
.wf-ba img, .wf-ba canvas, .wf-ba svg { display: block; width: 100%; }
.wf-ba-after { position: absolute; inset: 0; overflow: hidden; }
.wf-ba-after > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wf-ba-handle {
  position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.9);
  box-shadow: 0 0 12px rgba(0,0,0,.25); cursor: ew-resize;
}
.wf-ba-handle::after {
  content: '↔'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 999px; background: #fff; color: var(--wf-ink);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* ── 로딩(AI 분석) 애니메이션 ─────────────────────────────────────── */
.wf-orbit { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.wf-orbit::before, .wf-orbit::after {
  content: ''; position: absolute; inset: 0; border-radius: 999px;
  border: 1px solid var(--wf-blush-200); animation: wf-pulse 2.4s ease-out infinite;
}
.wf-orbit::after { animation-delay: 1.2s; }
@keyframes wf-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }

.wf-fade-in { animation: wf-fade-up .5s ease both; }
@keyframes wf-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 접근성 */
:focus-visible { outline: 2px solid var(--wf-rose); outline-offset: 2px; }
.wf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* =====================================================================
 * 관리자 콘솔 — 좌측 사이드바 레이아웃
 * ===================================================================== */
.wf-admin { display: flex; min-height: 100vh; background: var(--wf-bg); }

.wf-side {
  width: 236px; flex: 0 0 236px; position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  background: linear-gradient(180deg, #2C2027 0%, #241C22 60%, #1E161B 100%);
  color: rgba(255,255,255,.8); overflow-y: auto;
}
.wf-side::-webkit-scrollbar { width: 6px; }
.wf-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 3px; }

.wf-side-brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.wf-side-nav { padding: 10px 12px 30px; }
.wf-side-group {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.34); padding: 16px 12px 7px;
}
.wf-side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  font-size: 13.5px; color: rgba(255,255,255,.74); transition: background .15s ease, color .15s ease;
}
.wf-side-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.wf-side-link.is-active { background: var(--wf-rose); color: #fff; font-weight: 600; }
.wf-side-link .wf-side-ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }
.wf-side-badge {
  margin-left: auto; background: rgba(255,255,255,.16); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
}
.wf-side-link.is-active .wf-side-badge { background: rgba(255,255,255,.26); }

.wf-main { flex: 1; min-width: 0; margin-left: 236px; }
.wf-topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(253,251,249,.94);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--wf-line);
}
.wf-side-backdrop { position: fixed; inset: 0; background: rgba(30,20,26,.45); z-index: 55; }

@media (max-width: 1024px) {
  .wf-side { transform: translateX(-100%); transition: transform .24s cubic-bezier(.2,.8,.3,1); }
  .wf-side.is-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .wf-main { margin-left: 0; }
}

/* 테이블 */
.wf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wf-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--wf-muted);
  padding: 11px 12px; border-bottom: 1px solid var(--wf-line); white-space: nowrap;
}
.wf-table td { padding: 12px; border-bottom: 1px solid var(--wf-line-soft); }
.wf-table tbody tr:hover td { background: var(--wf-blush-50); }
.wf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wf-table-wrap { overflow-x: auto; }

/* 상태 배지 */
.wf-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.wf-badge-ok   { background: #E8F1EA; color: #3F7A55; }
.wf-badge-warn { background: #FBF0DF; color: #97701F; }
.wf-badge-off  { background: #F1EDEF; color: #7A6D76; }
.wf-badge-err  { background: #F8E7E9; color: #A4545C; }
.wf-badge-rose { background: var(--wf-blush-100); color: var(--wf-rose-dark); }

/* 미니 막대 차트 */
.wf-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.wf-chart > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.wf-chart i {
  display: block; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--wf-blush-200), var(--wf-rose));
}
