/* 회원제 화면 (js/auth.js): 로그인하지 않았을 때의 첫 화면 · 창(모달) · 알림 · 내 정보 메뉴.
   클래스 이름은 모두 au- 로 시작한다 (앱의 .modal .overlay .btn .card .chip 과 겹치지 않게).
   색·글꼴 변수(--bg --surface --ink --accent …)는 app.css 가 정한다. 여기서는 쓰기만 한다. 밝게/어둡게는 변수가 알아서 바뀐다. */

/* ---------- 로그인 전: 앱은 숨기고 첫 화면만 ---------- */
body.is-guest #app { display: none; }
body.is-guest { overflow: hidden; } /* 첫 화면이 화면 전체를 덮고 스스로 스크롤한다 */

.au-guest, .au-guest *, .au-overlay, .au-overlay *, .au-toast, .au-user, .au-user * { box-sizing: border-box; }
.au-guest[hidden], .au-overlay[hidden], .au-toast[hidden], .au-menu[hidden], .au-user[hidden], .au-err[hidden] { display: none; }

.au-guest {
  position: fixed; inset: 0; z-index: 350; overflow: auto;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
}
.au-guest a, .au-overlay a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

/* 맨 위 로그인 줄: 아이디 · 비밀번호 · 로그인 · 로그인 유지 / 회원가입 · 아이디찾기 · 비밀번호찾기 */
.au-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.au-bar-in { width: 100%; max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.au-guest a.au-brand { font-size: 17px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.au-login { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.au-login .au-in { width: 150px; }
.au-keep { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.au-links { display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; }

/* 입력칸 · 버튼 */
.au-in {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px;
}
.au-in::placeholder { color: var(--muted); }
.au-btn {
  height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.au-btn:hover { background: var(--hover-col); }
.au-btn:disabled { opacity: .5; cursor: default; }
.au-btn-primary, .au-btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.au-btn-danger { border-color: var(--neg); color: var(--neg); font-weight: 600; }
.au-big { height: 44px; padding: 0 22px; font-size: 15px; font-weight: 700; }
.au-in:focus, .au-btn:focus-visible, .au-x:focus-visible, .au-menu button:focus-visible,
.au-guest a:focus-visible, .au-overlay a:focus-visible, .au-terms summary:focus-visible,
.au-guest input[type="checkbox"]:focus-visible, .au-overlay input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.au-guest input[type="checkbox"], .au-overlay input[type="checkbox"] { accent-color: var(--accent-strong); margin: 0; }

/* 본문 */
.au-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 56px 20px 40px; }
.au-hero h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); font-weight: 700; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); }
.au-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.au-hint { font-size: 13px; color: var(--muted); }
.au-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.au-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.au-card b { display: block; font-size: 16px; font-weight: 700; color: var(--ink); }
.au-card p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.au-foot { width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 20px 28px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--muted); }
.au-foot p { margin: 4px 0; }

/* ---------- 창(모달): 가입 · 찾기 · 재설정 · 내 정보 ---------- */
.au-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .5); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
}
.au-modal { width: 100%; max-width: 440px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.au-modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 16px; }
.au-x { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.au-x:hover { background: var(--hover-col); }
.au-form { padding: 18px; font-size: 14px; }
.au-form p { margin: 12px 0 0; }
.au-form > :first-child { margin-top: 0; }
.au-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 12px; }
.au-c3 { grid-column: span 3; }
.au-c6 { grid-column: span 6; }
.au-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.au-fld .au-in { font-weight: 400; }
.au-terms { margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.au-terms summary { font-weight: 600; color: var(--ink); cursor: pointer; }
.au-terms :is(ol, ul) { margin: 8px 0 4px; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.au-terms li + li { margin-top: 4px; }
.au-agree { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.au-err { margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--neg); border-radius: 8px; background: var(--surface-2); color: var(--neg); font-weight: 600; }
.au-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.au-notice { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); }
.au-notice.au-ok { background: var(--accent-soft); color: var(--ink); }
.au-notice b { display: block; margin-bottom: 2px; }
/* 2단계 인증 설정 */
.au-steps { margin: 0; padding-left: 20px; }
.au-steps li + li { margin-top: 4px; }
.au-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.au-qr svg { flex: none; border-radius: 8px; }
.au-qr > div { width: 100%; }
.au-qr small { display: block; font-size: 13px; color: var(--muted); }
.au-key { display: block; margin: 8px 0; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; user-select: all; }
.au-in.au-code { font-size: 20px; font-weight: 700; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- 잠깐 보이는 알림 ---------- */
.au-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 500;
  max-width: 90vw; padding: 10px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 1.5;
}
.au-toast-err { border-color: var(--neg); color: var(--neg); }

/* ---------- 로그인한 뒤: 이름 ▾ 메뉴 (#userWrap 안) ---------- */
.au-user { position: relative; display: inline-block; font-family: var(--font); }
.au-user-btn { display: inline-flex; align-items: center; gap: 6px; }
.au-guest-btns { display: inline-flex; gap: 6px; }
.au-login-links { display: flex; gap: 14px; justify-content: center; margin-top: 14px; }
.au-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-menu.au-menu-end { left: auto; right: 0; } /* 오른쪽이 모자랄 때 (js/auth.js 가 붙인다) */
.au-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); text-align: left; }
.au-menu-h { margin-bottom: 4px; padding: 6px 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.au-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-family: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.au-menu button:hover { background: var(--hover-col); }
.au-menu button small { font-size: 12px; color: var(--muted); }
.au-menu button.au-leave { color: var(--muted); }

@media (max-width: 720px) {
  .au-feats { grid-template-columns: 1fr; margin-top: 32px; }
}
@media (max-width: 600px) {
  .au-guest, .au-overlay { font-size: 14px; }
  .au-bar-in { padding: 12px 16px; gap: 10px; }
  .au-login { margin-left: 0; width: 100%; justify-content: flex-start; }
  .au-login .au-in { flex: 1 1 120px; width: auto; min-width: 0; }
  .au-main { padding: 32px 16px 28px; }
  .au-overlay { padding: 12px; }
  .au-modal { max-height: calc(100vh - 24px); }
  .au-grid > .au-c3 { grid-column: span 6; }
}
@media print { .au-guest, .au-overlay, .au-toast, .au-menu { display: none; } }
