/* 두아즈 기술 세미나 · 공통 토큰과 부품 */
@font-face {
  font-family: "Pretendard";
  src: url("/static/fonts/pretendard.woff2") format("woff2-variations"),
       url("/static/fonts/pretendard.woff2") format("woff2");
  font-weight: 45 930;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/static/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1A1D24;
  --text: #333333;
  --text-2: #4A505C;
  --text-3: #6A707C;
  --line: #EBEBEB;
  --line-2: #E0DFDB;
  --line-strong: #CECDCD;
  --paper: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #F5F4F0;
  --surface-3: #EFEEEA;
  --hover: rgba(26, 29, 36, .045);

  --blue-900: #1B41B9;
  --blue-800: #17389F;
  --blue-600: #3661EA;
  --blue-100: #E0E9FC;
  --blue-50: #F1F5FE;
  --cyan-600: #29AFE6;
  --cyan-100: #E0F5FD;
  --cyan-text: #0B5F80;

  --ok: #2A7351;      --ok-bg: #E4F1E9;
  --warn: #9A6A16;    --warn-bg: #FAF0DC;   --warn-text: #7A5310;
  --err: #B23A2B;     --err-bg: #FBE8E5;
  --hold: #5C6676;    --hold-bg: #EDEFF2;

  --brand: var(--blue-600);

  --r-card: 16px;
  --r-ctl: 10px;
  --r-pill: 999px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: 150ms;
  --ring: 0 0 0 3px rgba(54, 97, 234, .32);
  --pop: 0 16px 40px -16px rgba(26, 29, 36, .28), 0 2px 8px rgba(26, 29, 36, .06);

  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss06";
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue-900); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--blue-100); color: var(--ink); }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--text-3); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--blue-900); letter-spacing: 0; }

/* ---------- 아이콘 */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
     stroke-linecap: round; stroke-linejoin: round; }
.i-16 { width: 16px; height: 16px; }
.i-18 { width: 18px; height: 18px; }

/* ---------- 버튼 */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none !important; user-select: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active:not([disabled]):not([aria-disabled="true"]) { transform: translateY(1px); }
.btn:focus-visible { border-radius: var(--r-pill); }
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--blue-900); color: #fff; }
.btn-primary:hover { background: var(--blue-800); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); border-color: #BDBCBA; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #9B3023; }
.btn-danger-ghost { background: transparent; color: var(--err); }
.btn-danger-ghost:hover { background: var(--err-bg); }
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--blue-100); color: var(--blue-600); border-color: transparent; cursor: not-allowed;
}
.btn-secondary[disabled], .btn-ghost[disabled] { background: var(--surface-2); color: var(--text-3); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-sm .i { width: 16px; height: 16px; }
.btn-lg { --h: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: .55; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

kbd, .kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
}

/* ---------- 입력 */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.label .opt { font-weight: 500; color: var(--text-3); margin-left: 4px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  font-size: 14px; color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #9A9EA6; }
.input:hover, .select:hover, .textarea:hover { border-color: #B6B5B2; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue-600); box-shadow: var(--ring); outline: none; border-radius: var(--r-ctl); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(178, 58, 43, .22); }
.select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236A707C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.help { font-size: 12.5px; color: var(--text-3); }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--err); font-weight: 500; }
.field-error .i { width: 16px; height: 16px; margin-top: 2px; }
.input-mono { font-family: var(--mono); letter-spacing: .06em; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue-900); margin: 0; }

/* 스위치 */
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track {
  width: 100%; height: 100%; border-radius: 999px; background: var(--line-strong);
  transition: background-color var(--dur) var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* 세그먼트 */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-pill); }
.seg button, .seg label {
  height: 30px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.seg label { position: relative; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg button:hover, .seg label:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg label:has(input:checked) {
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(26,29,36,.08), 0 0 0 1px rgba(26,29,36,.04);
}
.seg label:has(input:focus-visible) { box-shadow: var(--ring); }
.seg .count { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* ---------- 상태 표시 */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.no-dot::before { display: none; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn-text); }
.pill-warn::before { background: var(--warn); }
.pill-err { background: var(--err-bg); color: var(--err); }
.pill-hold { background: var(--hold-bg); color: var(--hold); }
.pill-blue { background: var(--blue-100); color: var(--blue-900); }
.pill-cyan { background: var(--cyan-100); color: var(--cyan-text); }
.pill-cyan::before { background: var(--cyan-600); }
.pill-line { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }

.dday {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em;
  background: var(--blue-900); color: #fff;
}
.dday.is-today { background: var(--cyan-600); color: var(--ink); }
.dday.is-past { background: var(--surface-3); color: var(--text-2); }

/* ---------- 카드 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }

/* ---------- 알림 띠 */
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; background: var(--blue-50); color: var(--blue-900);
}
.notice .i { margin-top: 1px; }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); }
.notice-err { background: var(--err-bg); color: var(--err); }
.notice-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- 스켈레톤 */
.sk {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3) 0%, #F7F6F3 45%, var(--surface-3) 90%);
  background-size: 220% 100%;
  animation: sk 1.3s linear infinite;
}
@keyframes sk { from { background-position: 120% 0; } to { background-position: -100% 0; } }

/* ---------- 토스트 */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--pop);
  pointer-events: auto; animation: toast-in 220ms var(--ease);
}
.toast .i { width: 18px; height: 18px; }
.toast-ok .i { color: #7FD3A8; }
.toast-err .i { color: #FF9C8F; }
.toast.is-leaving { animation: toast-out 160ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- 빈 상태 */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--blue-50); color: var(--blue-900); margin-bottom: 4px;
}
.empty h3 { font-size: 16px; font-weight: 700; }
.empty p { font-size: 14px; color: var(--text-3); max-width: 40ch; }
.empty .btn { margin-top: 8px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important;
  }
  .sk { animation: none; }
  .spinner { animation: spin 1.6s linear infinite !important; animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}
