/* Extracted legacy auth rules. Keep source order; existing screen overrides load later. */
@layer legacy {
.auth-card, .setup-card, .pending-card {
  width: min(calc(100% - 18px), 390px);
  border-radius: var(--r-xl);
  padding: 24px 20px 24px;
  box-shadow: var(--shadow-modal);
}
.auth-card h2, .setup-card h2, .pending-card h2 {
  font-size: var(--fs-headline);
  line-height: 1.15;
  letter-spacing: 0;
  margin-bottom: 10px;
}
.auth-card .hint, .setup-card .hint, .pending-card .hint {
  margin: 0 0 20px;
  line-height: 1.45;
}
.auth-fields {
  display: grid;
  gap: 10px;
}
.auth-signup-fields {
  display: grid;
  gap: 10px;
}
.auth-fields label,
.setup-card label {
  margin: 0;
  font-size: var(--fs-label);
  line-height: 1;
}
.auth-fields input,
.auth-fields select,
.setup-card input {
  height: 48px;
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: var(--fs-title);
}
.auth-card .two-buttons {
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 10px;
  margin-top: 18px;
}
.auth-card .secondary-btn {
  white-space: nowrap;
}
/* Provider buttons follow each provider's sign-in guidelines, so they keep their brand colors in both themes. */
.auth-providers { display: grid; gap: 10px; margin-top: 18px; }
.auth-provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px; padding: 0 16px;
  border-radius: var(--r-md); font: 700 var(--fs-title) var(--font-ui); cursor: pointer;
}
.auth-provider svg { width: 20px; height: 20px; flex: none; }
/* 로그인 버튼은 Google·카카오·Apple 브랜드 지침 색을 그대로 쓴다(토큰 예외). */
.auth-provider--google { border: 1px solid #747775; background: #fff; color: #1f1f1f; }
/* Google's own dark-theme button, so it stays apart from the white Apple button in dark mode. */
html[data-theme="dark"] .auth-provider--google, body[data-theme="dark"] .auth-provider--google { border-color: #8E918F; background: #131314; color: #E3E3E3; }
.auth-provider--kakao { border: 0; background: #FEE500; color: rgba(0, 0, 0, .85); }
.auth-provider--kakao svg { fill: #000; }
/* 네이버 로그인 버튼 가이드: 네이버 녹색 면, 흰 N과 글자 */
.auth-provider--naver { border: 0; background: #03C75A; color: #fff; }
.auth-provider--naver svg { fill: #fff; }
.auth-provider[hidden] { display: none; }
/* Sign in with Apple (ready for later): black on light, white on dark, same size as the others (Apple HIG). */
.auth-provider--apple { border: 0; background: #000; color: #fff; }
.auth-provider--apple svg { fill: currentColor; }
html[data-theme="dark"] .auth-provider--apple, body[data-theme="dark"] .auth-provider--apple { background: #fff; color: #000; }
.auth-provider:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.auth-provider:disabled { opacity: .6; cursor: progress; }
/* Sign-in is a full screen, not a dialog over an empty app. */
#authOverlay { padding: 0; background: var(--bg); align-items: stretch; overflow-y: auto; }
#authOverlay .auth-card {
  width: min(100%, 420px);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(48px, calc(env(safe-area-inset-top) + 32px)) 20px max(20px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.auth-step { display: flex; flex-direction: column; }
.auth-step[hidden] { display: none; }
#authOverlay .auth-card h2:focus { outline: none; }
#authOverlay .auth-card .hint { margin: 0 0 10px; font-size: var(--fs-body-l); line-height: 1.55; }
#authOverlay .auth-card .full-btn { width: 100%; }
/* Welcome screen (Apple): the app sits in the middle, sign-in under the thumb,
   the coworker path as a quiet text link. Brand button colours follow Google and Kakao rules. */
#authOverlay .auth-card h2 { font-size: var(--fs-display-m); font-weight: 800; line-height: 1.3; letter-spacing: -0.022em; }
.auth-step[data-auth-step="start"] { flex: 1; }
.auth-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0 28px; text-align: center; }
.auth-app-icon { width: 72px; height: 72px; margin: 0 0 16px; border-radius: 22.5%; }
.auth-app-name { margin: 0 0 6px; color: var(--muted); font-size: var(--fs-body); font-weight: 600; }
#authOverlay .auth-hero h2 { margin: 0; }
.auth-actions { display: grid; gap: 10px; }
.auth-actions .auth-providers { margin-top: 0; }
#authOverlay .auth-actions .hint { margin: 2px 0 0; text-align: center; font-size: var(--fs-body); }
#authOverlay .auth-actions .error-text:empty { display: none; }
.auth-join {
  justify-self: center; min-height: 44px; padding: 0 12px; border: 0; background: transparent;
  color: var(--gold); font: 600 var(--fs-body-l) var(--font-ui); cursor: pointer;
}
.auth-join:active { opacity: .6; }
.auth-join:focus-visible, .auth-back:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.auth-back {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 36px; margin: -8px 0 18px -6px; padding: 0 8px 0 2px;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font: 600 var(--fs-body) var(--font-ui); cursor: pointer;
}
.auth-back svg { width: 20px; height: 20px; }
.auth-join-steps { display: grid; gap: 14px; margin: 10px 0 24px; padding: 0; list-style: none; counter-reset: auth-join; }
.auth-join-steps li { position: relative; padding-left: 32px; font-size: var(--fs-body-l); line-height: 1.55; counter-increment: auth-join; }
.auth-join-steps li::before {
  content: counter(auth-join); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: var(--r-full);
  display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold);
  font: 700 var(--fs-label) var(--font-numeric); font-variant-numeric: tabular-nums;
}
.auth-join-steps b { font-weight: 700; }
.auth-links { display: flex; justify-content: center; gap: 8px; margin: auto 0 0; padding-top: 28px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--gold); }
.auth-card .error-text,
.setup-card .error-text {
  margin: 10px 0 0;
}
}
