:root {
  --accent: #e60013;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1d24;
  --muted: #6b7280;
  --border: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --card: #1a1d24;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --border: #2d323c;
  }
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.view { display: flex; flex-direction: column; gap: 14px; }
.view[hidden] { display: none; }
.brand { text-align: center; margin-bottom: 8px; }
.logo {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--accent) center/cover no-repeat;
  color: #fff;
  font-size: 26px; font-weight: 700;
  display: grid; place-items: center;
}
/* 로고 이미지가 있을 때 — 색 박스를 없애고 원본 비율 그대로 보여준다.
   어두운 테마에서 검은 글자가 묻히지 않도록 흰 바탕을 깔아둔다. */
.logo.has-image {
  width: 84px; height: 56px;    /* 로고 원본 비율(약 1.48:1)에 맞춘 크기 */
  border-radius: 10px;
  background-color: #fff;       /* 검은 글자가 어두운 테마에서 묻히지 않게 */
  background-size: contain;
  padding: 6px;
}
h1 { font-size: 1.25rem; font-weight: 700; }
.muted { color: var(--muted); font-size: 0.875rem; margin-top: 6px; }
.btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9375rem; font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; }
.btn-row { display: flex; gap: 10px; }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 0.8125rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
form { display: flex; flex-direction: column; gap: 10px; }
input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-error { color: #dc2626; font-size: 0.8125rem; }
.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 10px;
}
.scopes { list-style: none; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; }
.scopes li::before { content: '✓ '; color: var(--accent); font-weight: 700; }
.spinner {
  width: 28px; height: 28px;
  margin: 24px auto 0;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
