/* 복사본 — 원본은 design/fds.css 이다. 토큰·컴포넌트를 고칠 때는 원본을 먼저 고치고 여기에 다시 복사한다.
   (앱 전용 덧칠은 app.css 에 둔다. 이 파일은 손대지 않는다.) */

/* FDS (Field Design System) v0.2 — 디자인-시트.md 의 토큰과 컴포넌트를 코드로 옮긴 것.
   세 시안(sample / landing / console)이 같이 쓴다. 토스의 문법(단순함·숫자 위계·바텀시트·눌림 반응)을 따르되, 현장용으로 크게. */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  /* 색 */
  --brand: #2B5EE6; --brand-strong: #2150CC; --brand-weak: #EAF0FD; --brand-weak-strong: #D5E1FB; /* 말끔 파랑 = 도배판다·로고와 같은 #2B5EE6 (2026-10-22) */
  --grey-50: #F9FAFB; --grey-100: #F2F4F6; --grey-150: #ECEEF1; --grey-200: #E5E8EB; --grey-300: #D1D6DB; --grey-400: #B0B8C1;
  --grey-500: #8B95A1; --grey-600: #6B7684; --grey-700: #4E5968; --grey-800: #333D4B; --grey-900: #191F28;
  --red: #E5484D; --red-weak: #FDEDEE; --orange: #F27B00; --orange-weak: #FFF3E5;
  --green: #0A9F5A; --green-weak: #E6F7EE; --purple: #7B5CF0; --purple-weak: #F0ECFF; --teal: #0E9AA7; --teal-weak: #E2F6F7;
  --white: #FFFFFF; --dim: rgba(0, 12, 30, .48);

  /* 글자 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --tight: -0.02em;

  /* 간격·모양 */
  --gutter: 20px; --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 28px;

  /* 움직임 */
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  --d1: 80ms; --d2: 140ms; --d3: 180ms;
  --shadow-1: 0 1px 2px rgba(0, 20, 50, .04), 0 2px 8px rgba(0, 20, 50, .04);
  --shadow-sheet: 0 -8px 40px rgba(0, 20, 50, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--grey-900); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--brand-weak-strong); outline-offset: 2px; border-radius: 8px; }

/* 글자 단계 */
.t-display { font-size: 32px; line-height: 1.3; font-weight: 700; letter-spacing: var(--tight); }
.t-title { font-size: 24px; line-height: 1.38; font-weight: 700; letter-spacing: var(--tight); }
.t-sub { font-size: 19px; line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; }
.t-body { font-size: 17px; line-height: 1.55; }
.t-label { font-size: 15px; line-height: 1.47; }
.t-cap { font-size: 14px; line-height: 1.43; color: var(--grey-600); }
.c-sub { color: var(--grey-600); }
.c-mid { color: var(--grey-700); }

/* 눌림 반응: 토스처럼 살짝 줄어들고 어두워진다 */
.press { transition: transform var(--d1) var(--ease), background-color var(--d1) var(--ease), opacity var(--d1); }
.press:active { transform: scale(.97); }
.press-row { transition: background-color var(--d1) var(--ease); }
.press-row:active { background-color: var(--grey-100); }

/* 버튼 */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 18px; border-radius: var(--r-sm); font-size: 17px; font-weight: 600; white-space: nowrap; transition: transform var(--d1) var(--ease), background-color var(--d1) var(--ease); }
.btn:active { transform: scale(.97); }
.btn-lg { height: 56px; border-radius: var(--r-md); font-size: 18px; font-weight: 700; }
.btn-sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:active { background: var(--brand-strong); }
.btn-weak { background: var(--brand-weak); color: var(--brand); }
.btn-weak:active { background: var(--brand-weak-strong); }
.btn-grey { background: var(--grey-100); color: var(--grey-800); }
.btn-grey:active { background: var(--grey-200); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn .spin { display: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading .spin { display: block; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: var(--white); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 하단 고정 버튼 영역 */
.bottom-cta { flex-shrink: 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg, var(--white)) 70%, transparent); }
.bottom-cta .row { display: flex; gap: 8px; }
.bottom-cta .row .btn-grey { flex: 0 0 34%; }
.bottom-cta .row .btn-primary { flex: 1; }

/* 세그먼트 (토스식: 회색 트랙 위 흰 손잡이가 미끄러진다) */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: var(--grey-100); }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 10px; background: var(--white); box-shadow: 0 1px 3px rgba(0,20,50,.10), 0 2px 8px rgba(0,20,50,.06); transition: transform var(--d3) var(--ease), width var(--d3) var(--ease); }
.seg button { position: relative; z-index: 1; height: 44px; border-radius: 10px; font-size: 16px; font-weight: 600; color: var(--grey-600); text-align: center; transition: color var(--d2); }
.seg button[aria-pressed="true"] { color: var(--grey-900); }

/* 스위치 */
.switch { flex-shrink: 0; width: 52px; height: 32px; border-radius: 999px; background: var(--grey-300); position: relative; transition: background-color var(--d2) var(--ease); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 4px rgba(0,20,50,.18); transition: transform var(--d2) var(--ease); }
[aria-checked="true"] > .switch { background: var(--brand); }
[aria-checked="true"] > .switch::after { transform: translateX(20px); }

/* 리스트 행 (토스 ListRow) */
.row-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px var(--gutter); text-align: left; }
.row-item .body { flex: 1; min-width: 0; }
.row-item .title { display: block; font-size: 17px; line-height: 1.45; font-weight: 500; }
.row-item .desc { display: block; font-size: 14px; line-height: 1.43; color: var(--grey-600); margin-top: 1px; }
.row-item .right { flex-shrink: 0; font-size: 16px; font-weight: 600; color: var(--grey-700); display: flex; align-items: center; gap: 4px; }
.chev { width: 20px; height: 20px; color: var(--grey-400); }

/* 아이콘 타일: 색 배경 위 채운 아이콘 */
.ico { flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.ico svg { width: 24px; height: 24px; }
.ico.blue { background: var(--brand-weak); color: var(--brand); }
.ico.red { background: var(--red-weak); color: var(--red); }
.ico.orange { background: var(--orange-weak); color: var(--orange); }
.ico.green { background: var(--green-weak); color: var(--green); }
.ico.purple { background: var(--purple-weak); color: var(--purple); }
.ico.teal { background: var(--teal-weak); color: var(--teal); }
.ico.grey { background: var(--grey-100); color: var(--grey-600); }

/* 배지 */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.red { background: var(--red-weak); color: var(--red); }
.badge.orange { background: var(--orange-weak); color: var(--orange); }
.badge.green { background: var(--green-weak); color: var(--green); }
.badge.blue { background: var(--brand-weak); color: var(--brand); }
.badge.grey { background: var(--grey-100); color: var(--grey-600); }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* AI 표식: AI가 만든 내용에는 항상 붙인다 */

/* 굵은 구획선 (토스식) */
.band { height: 12px; background: var(--grey-100); }
.hair { height: 1px; background: var(--grey-150); margin: 0 var(--gutter); }

/* 바텀시트 */
.dim { position: absolute; inset: 0; background: var(--dim); opacity: 0; pointer-events: none; transition: opacity var(--d3) var(--ease); z-index: 40; }
.dim.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--white); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 8px 0 calc(12px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-sheet); transform: translateY(105%); transition: transform var(--d3) var(--ease); max-height: 88%; display: flex; flex-direction: column; }
.sheet.on { transform: translateY(0); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--grey-300); margin: 4px auto 16px; flex-shrink: 0; }
.sheet .s-title { font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: var(--tight); padding: 0 var(--gutter); }
.sheet .s-desc { font-size: 16px; color: var(--grey-600); padding: 6px var(--gutter) 0; }
.sheet .s-body { overflow-y: auto; padding-top: 16px; }

/* 토스트 */
.toast { position: absolute; left: 16px; right: 16px; bottom: 96px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 16px; background: rgba(25, 31, 40, .94); color: var(--white); font-size: 16px; font-weight: 600; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--d2) var(--ease), transform var(--d2) var(--ease); }
.toast.on { opacity: 1; transform: translateY(0); }
.toast .ok { width: 22px; height: 22px; border-radius: 50%; background: var(--green); display: grid; place-items: center; flex-shrink: 0; }

/* 스켈레톤 */
.skel { background: linear-gradient(90deg, var(--grey-100) 0%, var(--grey-150) 50%, var(--grey-100) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 들어오기 */
.rise { animation: rise var(--d3) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
