:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", sans-serif;
  --background: #101110;
  --surface: #1a1b19;
  --line: #363834;
  --line-strong: #50534d;
  --text: #f4f3ee;
  --muted: #90928b;
  --kakao: #fee500;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: radial-gradient(circle at 50% -20%, rgba(255,255,255,.07), transparent 36%), var(--background);
  color: var(--text);
  font-size: 16px;
}

button, input { font: inherit; }
button { cursor: pointer; }

.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;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.session-check {
  display: none;
  width: min(100%, 420px);
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}

.session-check-logo {
  display: block;
  width: 180px;
  height: 72px;
  margin: 0 auto 22px;
  object-fit: cover;
  object-position: center 54%;
  mix-blend-mode: screen;
}

.auth-checking .session-check { display: block; }
.auth-checking .login-card { display: none; }

.login-card {
  width: min(100%, 420px);
  padding: 44px 42px 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(26, 27, 25, .94);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .34);
}

.logo {
  display: block;
  width: 210px;
  height: 84px;
  margin: 0 auto 54px;
  object-fit: cover;
  object-position: center 54%;
  mix-blend-mode: screen;
}

form { display: grid; }

label {
  margin: 0 0 9px;
  color: #b8bab3;
  font-size: .875rem;
  font-weight: 700;
}

label:not(:first-child) { margin-top: 18px; }

.input-shell {
  display: flex;
  align-items: center;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #131412;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input-shell:focus-within {
  border-color: #9da199;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
}

.phone-shell > span {
  flex: none;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: .9375rem;
}

input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  padding: 0 15px;
  outline: 0;
  background: transparent;
  color: var(--text);
}

input::placeholder { color: #666861; }

.text-button {
  flex: none;
  height: 100%;
  border: 0;
  padding: 0 15px;
  background: transparent;
  color: #aaada5;
  font-size: .8125rem;
  font-weight: 700;
}

.primary-button, .kakao-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  transition: transform .15s ease, filter .15s ease;
}

.primary-button:disabled { cursor: wait; opacity: .65; }

.form-error {
  margin: 14px 2px 0;
  color: #ffaaa2;
  font-size: .8125rem;
  line-height: 1.5;
}

.primary-button {
  margin-top: 24px;
  background: #f1f2ed;
  color: #171916;
}

.kakao-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--kakao);
  color: rgba(0, 0, 0, .85);
}

.kakao-button svg { width: 21px; height: 21px; fill: currentColor; }
.primary-button:hover, .kakao-button:hover { filter: brightness(.94); }
.primary-button:active, .kakao-button:active { transform: translateY(1px); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 25px 0;
  color: #73766f;
  font-size: .75rem;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.notice {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 14px 18px;
  border: 1px solid #4a4d47;
  border-radius: 12px;
  background: #292b27;
  color: #e5e6df;
  box-shadow: 0 16px 40px rgba(0,0,0,.38);
  transform: translateX(-50%);
  font-size: .875rem;
  font-weight: 700;
}

@media (max-width: 560px) {
  .login-screen { align-items: center; padding-left: 14px; padding-right: 14px; }
  .login-card { padding: 38px 24px 32px; border-radius: 18px; }
  .logo { width: 185px; height: 74px; margin-bottom: 44px; }
}

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