/* ============================================================================
   메인 로그인 페이지 — Centered Card (s2) + 다크/라이트 토글
   POST /auth/login, JSON {userID, userPW}
   ============================================================================ */

:root {
  --bg-page: #f9fafb;
  --bg-card: #ffffff;
  --text: #111827;
  --text-strong: #0f172a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-focus: #6366f1;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-ring: rgba(99,102,241,.12);
  --shadow-card: 0 4px 24px rgba(15,23,42,.06);
  --danger: #ef4444;
  --success: #10b981;
}

html.dark {
  --bg-page: #0f0f10;
  --bg-card: #18181b;
  --text: #e5e7eb;
  --text-strong: #fafafa;
  --text-muted: #9ca3af;
  --border: #2c2c30;
  --border-strong: #3f3f46;
  --border-focus: #818cf8;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-ring: rgba(129,140,248,.18);
  --shadow-card: 0 8px 32px rgba(0,0,0,.5);
  --danger: #f87171;
  --success: #34d399;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
  background: var(--bg-page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard',
               'Apple SD Gothic Neo', Roboto, sans-serif;
  line-height: 1.5;
  transition: background-color .2s, color .2s;
}

.login-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.brand-logo {
  font-size: 26px; font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 24px;
  color: var(--text-strong);
}
.brand-logo span { color: var(--accent); }

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  transition: background-color .2s, border-color .2s;
}
.login-card h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-strong);
}
.login-card .muted {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-card label {
  display: block;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .2s;
}
.login-card input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.login-card input::placeholder { color: var(--text-muted); }

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
}
.row-between .cb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  cursor: pointer;
}
.row-between .cb input { accent-color: var(--accent); }
.row-between .link {
  color: var(--accent);
  text-decoration: none;
}
.row-between .link:hover { text-decoration: underline; }

button.primary {
  width: 100%;
  padding: 11px 16px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
}

.msg {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
}
.msg.error { color: var(--danger); }
.msg.ok { color: var(--success); }

.help {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-muted);
}
.help a {
  color: var(--accent);
  text-decoration: none;
}
.help a:hover { text-decoration: underline; }

.copyright {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .04em;
}

/* 테마 토글 버튼 (우상단) */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, color .15s, border-color .15s;
  z-index: 50;
}
.theme-toggle:hover { background: var(--accent-ring); color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }

@media (max-width: 480px) {
  .login-card { padding: 28px 22px; }
  .brand-logo { font-size: 22px; }
}
