/* ==========================================================================
   Xearch — login · onboarding · checkout (focused screens without the app shell)
   ========================================================================== */
body.auth { min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); overflow-x: hidden; }
.auth-glow { position: fixed; left: 50%; top: -30vh; width: 120vh; height: 80vh; transform: translateX(-50%); pointer-events: none; background: radial-gradient(closest-side, rgb(var(--ink) / .14), transparent); }
.auth-logo { position: relative; display: block; width: 100px; height: 40px; margin: 20px 24px 0; overflow: hidden; }
.auth-logo img { position: absolute; width: 140px; height: auto; max-width: none; left: -18px; top: -21px; mix-blend-mode: screen; }
:root[data-theme="light"] .auth-logo img { filter: invert(1) contrast(1.25); mix-blend-mode: multiply; }
.btn-block { width: 100%; height: 54px; font-size: 16px; }

/* ---------- Login ---------- */
.login { position: relative; flex: 1; display: grid; align-content: center; justify-items: center; gap: 14px; width: min(420px, 100%); margin: 0 auto; padding: 40px 24px 24px; text-align: center; }
.login h1 { font-size: clamp(28px, 6vw, 36px); line-height: 1.25; letter-spacing: -0.035em; }
.login-sub { margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.login-msg { width: 100%; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; color: var(--text); background: rgb(var(--ink) / .08); box-shadow: inset 0 0 0 1px var(--line-2); }
/* Kakao's own button colours (카카오 로그인 디자인 가이드) */
.kakao-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; border-radius: 14px; font-size: 16.5px; font-weight: 650; color: rgb(0 0 0 / .85); background: #fee500; transition: transform 120ms, filter 160ms; }
.kakao-btn svg { width: 22px; height: 22px; color: #000; }
.kakao-btn:hover { filter: brightness(.97); }
.kakao-btn:active { transform: scale(.98); }
.kakao-btn.busy { opacity: .75; pointer-events: none; }
.login-perks { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 14px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.login-perks li::before { content: "✓ "; color: var(--text); }
.login-legal { margin: 18px 0 0; font-size: 12px; line-height: 1.7; color: var(--dim); }
.login-legal a, .auth-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.auth-foot { position: relative; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 20px 24px calc(20px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--dim); }

/* ---------- Onboarding ---------- */
.onb-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: rgb(var(--paper) / .85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.onb-prog { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-width: 520px; margin: 0 auto; }
.onb-prog i { height: 4px; border-radius: 2px; background: rgb(var(--ink) / .12); transition: background-color 300ms; }
.onb-prog i.done, .onb-prog i.cur { background: var(--text); }
.onb-step { width: 40px; text-align: right; font-size: 13px; color: var(--dim); }
.onb-main { flex: 1; display: grid; justify-items: center; padding: 20px 20px calc(40px + env(safe-area-inset-bottom)); }
.onb-card { display: grid; gap: 14px; align-content: start; width: min(480px, 100%); }
.onb-card h1 { margin-top: 12px; font-size: clamp(24px, 5.6vw, 30px); line-height: 1.3; letter-spacing: -0.035em; }
.onb-lead { margin: -4px 0 10px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.onb-card .field { margin-bottom: 0; }
.onb-card .btn-block { margin-top: 10px; }
.f-l .ok { color: var(--text); font-weight: 700; }
.agree { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; cursor: pointer; }
.agree input, .kchip input { position: absolute; opacity: 0; pointer-events: none; }
.agree > span::before { content: ""; display: inline-grid; width: 22px; height: 22px; margin-right: 12px; vertical-align: -5px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: background-color 140ms, box-shadow 140ms; }
.agree input:checked + span::before { background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4L18 8' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; box-shadow: none; }
:root[data-theme="light"] .agree input:checked + span::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4L18 8' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.agree input:focus-visible + span::before { outline: 2px solid var(--text); outline-offset: 2px; }
.agree.all { padding: 6px 16px; border-radius: 14px; font-weight: 700; background: rgb(var(--ink) / .06); box-shadow: inset 0 0 0 1px var(--line-2); }
.agrees { list-style: none; margin: 0; padding: 0 16px; }
.agrees li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agrees em { font-style: normal; margin-right: 8px; font-size: 13px; font-weight: 700; color: var(--dim); }
.agrees em.req { color: var(--text); }
.sub-h { margin: 8px 0 0; font-size: 14px; font-weight: 650; }
.sub-h span { margin-left: 6px; font-size: 13px; font-weight: 450; color: var(--dim); }
.kchips { display: flex; flex-wrap: wrap; gap: 8px; }
.kchip { position: relative; cursor: pointer; }
.kchip span { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); transition: color 140ms, background-color 140ms; }
.kchip small { font-size: 13px; color: var(--dim); }
.kchip input:checked + span { color: var(--bg); background: var(--text); box-shadow: none; font-weight: 650; }
.kchip input:checked + span small { color: inherit; opacity: .6; }
.kchip input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.onb-count { margin: 4px 0 0; font-size: 13px; color: var(--dim); }
.onb-count b { color: var(--text); }
.done-mark { display: grid; place-items: center; width: 64px; height: 64px; margin-top: 20px; border-radius: 50%; color: var(--bg); background: var(--text); }
.done-mark svg { width: 32px; height: 32px; }
.onb-sum { margin: 0; display: grid; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.onb-sum div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.onb-sum div:first-child { border-top: 0; }
.onb-sum dt { color: var(--dim); }
.onb-sum dd { margin: 0; font-weight: 600; text-align: right; }
.onb .found { margin-top: 4px; }
.onb .found .link-btn { margin-left: auto; }
.kchip input:disabled + span { opacity: .35; cursor: not-allowed; }
.onb-plus { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: var(--muted); background: rgb(var(--ink) / .05); box-shadow: inset 0 0 0 1px var(--line); }
.onb-plus b { color: var(--text); }
.onb-plus small { display: block; color: var(--dim); }
.onb-card .btn-ghost.btn-block { margin-top: 0; }

/* two-line choice buttons (onboarding finish) */
.btn-2l { flex-direction: column; gap: 2px; height: auto; min-height: 62px; padding-block: 10px; line-height: 1.25; }
.btn-2l small { font-size: 13px; font-weight: 600; opacity: .62; }

/* live regions repaint in place; they don't break the card's grid */
.onb-live { display: contents; }
.onb-wait { display: grid; justify-items: center; gap: 12px; padding: 40px 0 12px; text-align: center; }
.onb-wait p { margin: 0; font-size: 15px; color: var(--muted); }
.onb-wait i { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgb(var(--ink) / .15); border-top-color: var(--text); animation: spin 800ms linear infinite; }
.onb-keep { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; color: var(--muted); }
.onb-keep b { color: var(--text); }
.onb-add { display: flex; gap: 8px; }
.onb-add .field { flex: 1; min-width: 0; }
.onb-add .btn { flex: none; height: auto; min-height: 46px; }
.onb-out { justify-self: center; min-height: 44px; margin-top: 4px; padding: 0 12px; font-size: 13px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.onb-out:hover { color: var(--text); }
.onb .link-btn { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
.onb .found small, .onb .ps-hint, .onb .ps-t small, .onb .ps-r, .onb .how, .onb .fine { font-size: 13px; }
.onb-top .icon-btn { width: 44px; height: 44px; }
.onb-plus small, .onb .f-l small { font-size: 13px; }
.onb .ps-clear { right: 4px; width: 44px; height: 44px; margin-top: -22px; }
.onb .found .link-btn { flex: none; white-space: nowrap; }
