/* SignPen 계정 화면 (로그인 · 가입 · 인증 · 비밀번호 · 초대) — ui.css 다음에 읽는다 */

.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 0.9fr) 1.1fr; }

/* 왼쪽 브랜드 패널 */
.auth-brand { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--ink); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; }
.auth-brand::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 70% at 0% 0%, rgba(228, 87, 46, 0.18), transparent 55%), radial-gradient(90% 60% at 100% 100%, rgba(255, 255, 255, 0.06), transparent 60%); pointer-events: none; }
.auth-brand > * { position: relative; }
.auth-brand .logo { color: #fff; }
.auth-brand .logo small { color: #aab3c7; }
.auth-brand .logo img { box-sizing: content-box; width: 28px !important; height: 28px !important; padding: 4px; background: #fff; border-radius: 10px; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.45); }
.auth-brand-body { margin: auto 0; max-width: 420px; padding: 48px 0; }
.auth-brand .kicker { color: #ff8a65; font-weight: 700; font-size: 13px; letter-spacing: 0.08em; }
.auth-brand h2 { margin-top: 14px; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.28; letter-spacing: -0.03em; font-weight: 800; }
.auth-brand h2 em { font-style: normal; color: #ff8a65; }
.auth-brand ul { list-style: none; margin-top: 32px; display: grid; gap: 16px; }
.auth-brand li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: 15px; color: #d5dae6; }
.auth-brand li b { display: block; color: #fff; font-weight: 700; font-size: 15.5px; margin-bottom: 2px; }
.auth-brand li .ic { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.auth-brand li .ic img { width: 44px; height: 44px; object-fit: contain; }
.auth-brand ul li { grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.auth-sign { margin-top: 40px; width: 88px; height: 88px; border-radius: 22px; background: #fff; display: grid; place-items: center; box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.5); transform: rotate(-4deg); animation: authPop 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) 0.2s both; }
.auth-sign img { width: 84px; height: 84px; object-fit: contain; }
@keyframes authPop { from { opacity: 0; transform: rotate(-14deg) scale(0.8); } }
.auth-sign-cap { margin-top: 14px; font-size: 12.5px; color: #8b94a8; letter-spacing: 0.02em; }
.auth-brand-foot { font-size: 12.5px; color: #8b94a8; }

/* 오른쪽 폼 */
.auth-main { display: flex; flex-direction: column; padding: 28px 24px; min-width: 0; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; font-size: 14px; color: var(--muted); }
.auth-top .logo { visibility: hidden; }
.auth-top a.link { color: var(--ink); font-weight: 700; text-decoration: none; }
.auth-top a.link:hover { color: var(--accent); }
.auth-center { flex: 1; display: grid; place-items: center; padding: 32px 0; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 28px; line-height: 1.3; letter-spacing: -0.03em; font-weight: 800; }
.auth-card .sub { margin-top: 8px; color: var(--muted); font-size: 15px; }
.auth-card .sub b { color: var(--ink); font-weight: 700; word-break: break-all; }
.auth-form { margin-top: 28px; }
.auth-form .btn-lg { margin-top: 22px; }
.auth-alt { margin-top: 22px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-alt a { color: var(--ink); font-weight: 700; text-decoration: none; margin-left: 4px; }
.auth-alt a:hover { color: var(--accent); }
.auth-legal { margin-top: 18px; font-size: 12px; color: var(--faint); text-align: center; }
.auth-legal a { color: var(--muted); }
.auth-copy { text-align: center; font-size: 12px; color: var(--faint); }

/* 라벨 줄 (오른쪽 링크) */
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row a { font-size: 13px; color: var(--muted); text-decoration: none; font-weight: 600; }
.label-row a:hover { color: var(--accent); }

/* 비밀번호 보기 */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 10px; border: 0; background: none; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: var(--line-2); }

/* 필드 오류 (자리를 미리 잡아 레이아웃이 흔들리지 않게) */
.f-err { min-height: 18px; font-size: 12.5px; color: var(--bad); line-height: 18px; }
.field .f-err:empty { min-height: 0; }
.field.has-err .input { border-color: var(--bad); }

/* 비밀번호 규칙 */
.pw-rules { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); min-height: 18px; }
.pw-rules span { display: inline-flex; align-items: center; gap: 5px; transition: color 0.15s; }
.pw-rules span::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.pw-rules span.ok { color: var(--good); }
.pw-rules span::before { display: inline-grid; place-items: center; font-size: 9px; font-weight: 800; line-height: 1; }
.pw-rules span.ok::before { content: '✓'; border: 0; background: var(--good); color: #fff; }

/* 폼 상단 알림 */
.form-alert { margin-bottom: 18px; }
.form-alert .alert { display: grid; gap: 8px; }
.form-alert .alert .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.alert a:not(.btn) { color: inherit; font-weight: 700; }

/* 동의 */
.consent { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.consent .check { padding: 12px 14px; }
.consent .check + .check { border-top: 1px solid var(--line-2); }
.consent .check.all { font-weight: 700; background: #fcfbf9; border-radius: 12px 12px 0 0; }
.consent .check a { color: var(--ink-2); font-weight: 600; }
.consent .opt { color: var(--faint); font-weight: 500; }
.consent .req { color: var(--accent); font-weight: 700; }

/* 초대 배너 */
.invite-banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: #8f3216; font-size: 14px; margin-bottom: 22px; }
.invite-banner .av { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.invite-banner b { color: var(--ink); }

/* 인증번호 6칸 */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.otp input { width: 100%; min-width: 0; height: 58px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); text-align: center; font-family: var(--mono); font-size: 24px; font-weight: 700; caret-color: var(--accent); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.otp input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(43, 58, 92, 0.12); }
.otp input.filled { background: #fcfbf9; border-color: #c9cfdb; }
.otp.bad input { border-color: var(--bad); animation: shake 0.35s; }
.otp.ok input { border-color: var(--good); background: var(--good-soft); color: var(--good); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* 상태 아이콘 (메일 · 완료 · 오류) */
.state-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 22px; }
.state-ic img { width: 60px; height: 60px; object-fit: contain; }
.state-ic .glyph { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid currentColor; display: grid; place-items: center; font-weight: 800; font-size: 17px; line-height: 1; font-family: var(--font); }
.state-ic.mail { background: var(--accent-soft); color: var(--accent); }
.state-ic.good { background: var(--good-soft); color: var(--good); }
.state-ic.bad { background: var(--bad-soft); color: var(--bad); }
.state-ic.info { background: var(--info-soft); color: var(--info); }
.state-ic.good img { animation: authPop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) 0.1s both; }

.tip { margin-top: 24px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); font-size: 13.5px; color: var(--muted); line-height: 1.65; }
.tip b { color: var(--ink-2); }
.tip a { color: var(--ink); font-weight: 600; }
.resend-row { margin-top: 18px; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.resend-row .btn-text { height: 30px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.resend-row .btn-text:disabled { color: var(--faint); text-decoration: none; opacity: 1; }

.loading-line { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; }
.loading-line .spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.7s linear infinite; }

.stack-btns { display: grid; gap: 10px; margin-top: 26px; }
.stack-btns .btn, .form-alert .btn { white-space: normal; text-align: center; line-height: 1.35; }
.stack-btns .btn-lg { height: auto; min-height: 50px; padding-top: 12px; padding-bottom: 12px; }
.auth-card { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 920px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-top .logo { visibility: visible; }
  .auth-main { padding: 18px 16px 24px; }
  .auth-center { place-items: start center; padding: 28px 0 32px; }
}
@media (max-width: 400px) {
  .auth-card h1 { font-size: 24px; }
  .otp { gap: 6px; }
  .otp input { height: 52px; font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-sign, .state-ic.good img { animation: none; }
}
