/* ===== 전 페이지 공통: 디자인 토큰 · 리셋 · 공용 컴포넌트 ===== */
:root {
  --bg: #e7f0ff;
  --surface: #ffffff;
  --topbar: #1e4ed8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;

  --text: #0f172a;
  --text-soft: #1e3a8a;
  --text-muted: #4b6aa3;
  --line: #c7dbf7;

  --violet: #2563eb;
  --green: #12a565;
  --green-soft: #e7f8ef;
  --orange: #f08a24;
  --amber-bg: #fff7e6;
  --red: #e04443;

  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(37, 99, 235, .06), 0 8px 22px rgba(37, 99, 235, .08);
  --shadow-md: 0 10px 28px rgba(37, 99, 235, .12);
  --shadow-lg: 0 16px 36px rgba(37, 99, 235, .16);

  --topbar-h: 52px;
  --sidebar-w: 252px;
}

* { box-sizing: border-box; }

@font-face {
  font-family: "App Fallback";
  src: local("Malgun Gothic"), local("맑은 고딕"), local("Apple SD Gothic Neo");
  size-adjust: 103%;
  ascent-override: 85%;
  descent-override: 15%;
  line-gap-override: 0%;
}

/* display를 지정한 클래스가 hidden 속성을 덮어쓰지 못하도록 */
[hidden] { display: none !important; }

html {
  height: 100%;
  overflow: hidden;
}
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, "App Fallback", -apple-system, BlinkMacSystemFont,
    "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  word-break: keep-all;
}
/* 로그인·회원가입처럼 사이드바가 없는 화면만 문서 스크롤 */
html:has(body.auth-page),
body.auth-page,
body:not(:has(.layout)) {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: top .16s;
}
.skip-link:focus { top: 10px; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== 공용 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn--sm { height: 30px; padding: 0 14px; font-size: 12.5px; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }

.btn--soft { background: #eef0f5; color: var(--text-soft); }
.btn--soft:hover { background: #e3e6ee; color: var(--text); }

.btn--outline {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-soft);
}
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ===== 토스트 ===== */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 60;
  transform: translate(-50%, 16px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(23, 29, 43, .93);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
