/* 로그인 화면(login.html: 로그인, 가입, 비밀번호 찾기) — 디자인 팀 시안(2026-11-11 'Login-System' 'Signup' 'Reset' .dc.html)을 옮긴 것.
   시안의 main[data-theme] 선택자는 앱과 같은 html[data-theme]로 (login-theme.js가 저장값 또는 OS 설정으로 늘 정한다, 값이 없으면 어두운 테마),
   글꼴은 앱 안 파일(Paperlogy, Pretendard, 일본어는 시스템 글꼴). 시안 클래스 이름(ctl-*, sg-*)은 그대로 두어 시안과 맞춰 보기 쉽게 했다.
   배경 그림(static/img/login-bg.svg)은 login.js가 그린 뒤에 받아 #lg-bg에 넣는다: 아래 '배경' 규칙이 그 안을 움직이고 어두운 테마 색으로 바꾼다.
   예전 모양(app.css .login-*, design.css)은 이 화면에서 더는 읽지 않는다 */

/* ---- 색 (시안 값. 어두운 테마는 시안이 나중에 덮어쓴 값까지 합쳤다) ---- */
:root {
  --bg: #050716; --bg-rgb: 5,7,22; --paper: #050716;
  --card: #183450; --field: #0B1828; --line: rgba(220,228,238,0.24);
  --ink: #F2F5F9; --ink2: #DCE4EE; --muted: #8A9DB3; --hline: rgba(122,144,168,0.5);
  --point: #F07A92;          /* 시안 #E15B77은 카드(#183450) 위 13px 오류 글에서 3.6:1 → 4.5:1을 넘게 조금 밝게 */
  --accent-ink: #F07A92;     /* 빨강을 글자로 쓸 때 (단계 번호, 플랜). 어두운 카드 위 #D00F37은 2.3:1 */
  --tagbg: rgba(208,15,55,0.22);
  --c-bg2-rgb: 5,7,22; --c-hbtn: #122131; --c-hbtn-ink: #DCE4EE; --c-hline-rgb: 122,144,168; --c-muted: #7A90A8; --c-ink: #F2F5F9; --c-opt-sel: #1E2D40;
  --c-shadow: 0 10px 28px rgba(4,20,35,.55), 0 3px 8px rgba(4,20,35,.35);
  --f-ui: 'Pretendard Variable', 'Pretendard', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
  --f-title: 'Paperlogy', 'Pretendard Variable', 'Pretendard', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
  color-scheme: dark;
  background: #050716;
}
html[data-theme="light"] {
  --bg: #F7F5F0; --bg-rgb: 247,245,240; --paper: #FAF8F5;
  --card: #FFFFFF; --field: #FBFAF7; --line: #D6D3D1;
  --ink: #2F2B28; --ink2: #45403B; --muted: #655D56; --hline: rgba(120,113,108,0.5);
  --point: #C10E33; --accent-ink: #D00F37; --tagbg: rgba(208,15,55,0.10);
  --c-bg2-rgb: 247,245,240; --c-hbtn: #FFFFFF; --c-hbtn-ink: #2F2B28; --c-hline-rgb: 120,113,108;
  --c-muted: #6E665F;        /* 랜딩과 같게: 시안 #7A726B는 바탕 위 4.3:1 */
  --c-ink: #2F2B28; --c-opt-sel: #F2F0EA;
  --c-shadow: 0 8px 24px rgba(70,58,46,.12), 0 2px 6px rgba(70,58,46,.06);
  color-scheme: light;
  background: #FAF8F5;
}
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); }
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--ink2); }
a:hover { color: var(--ink); }
button, input { font: inherit; }

/* ---- 틀: 배경 → 머리줄 → 가운데 판 → 바닥글 ---- */
main.lg { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink2); font-family: var(--f-title); word-break: keep-all; overflow-wrap: break-word; }
html[lang="ja"] main.lg { word-break: normal; line-break: strict; }
.lg-bg { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.lg-bg.on { opacity: 1; }
.lg-veil { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 34% 42% at 50% 50%, rgba(var(--bg-rgb),0.55) 0%, rgba(var(--bg-rgb),0) 70%), linear-gradient(180deg, rgba(var(--bg-rgb),0.85) 0%, rgba(var(--bg-rgb),0) 110px); }

/* 머리줄: 첫 화면(랜딩)과 같은 모양 */
.lg-hd { position: relative; z-index: 40; flex: none; height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 48px;
  font-family: var(--f-ui);
  background: linear-gradient(180deg, rgba(var(--c-bg2-rgb),1) 0%, rgba(var(--c-bg2-rgb),0.97) 50%, rgba(var(--c-bg2-rgb),0.82) 72%, rgba(var(--c-bg2-rgb),0.4) 88%, rgba(var(--c-bg2-rgb),0) 100%); }
.lg-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; min-width: 0; transition: opacity .2s ease; }
.lg-logo:hover { opacity: .8; }
.lg-logo svg { display: block; height: 28px; width: auto; }
.lg-ver { font: 500 13px var(--f-ui); color: var(--c-muted); margin-left: -2px; align-self: flex-end; padding-bottom: 3px; }
.lg-logo-sub { display: inline-flex; align-items: center; gap: 10px; }
.lg-logo-sub::before { content: ''; width: 1px; height: 18px; background: #AC3B46; }
.lg-logo-sub span { font: 400 14px var(--f-title); color: var(--c-hbtn-ink); white-space: nowrap; }
html[data-theme="light"] .lg-hd .cti-keep path[fill="#F6F7F9"] { fill: #2A2622; }
html[data-theme="light"] .lg-hd svg:not(.cti-keep) { filter: invert(1) hue-rotate(180deg); }
.lg-hd-r { display: flex; align-items: center; gap: 10px; flex: none; }
.hd-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; background: var(--c-hbtn); border: 1px solid rgba(var(--c-hline-rgb),0.5);
  color: var(--c-hbtn-ink); font: 400 14px var(--f-ui); letter-spacing: 0; text-decoration: none; cursor: pointer; border-radius: 0; }
.hd-btn:hover { color: var(--c-hbtn-ink); }
.hd-btn.hd-pri { background: #D00F37; border-color: #D00F37; color: #FFFFFF; }
.hd-btn.hd-pri:hover { background: #B30D2F; border-color: #B30D2F; color: #FFFFFF; }
.lg-lang-w { position: relative; }
#lg-lang { gap: 10px; padding: 0 12px 0 14px; }
#lg-lang svg { transition: transform .2s ease; }
#lg-lang[aria-expanded="true"] svg { transform: rotate(180deg); }
.lg-lang-short { display: none; }
#lg-langlist { position: absolute; top: 46px; left: 0; min-width: 148px; padding: 4px 0; background: var(--c-hbtn); border: 1px solid rgba(var(--c-hline-rgb),0.5); box-shadow: var(--c-shadow); z-index: 60; }
#lg-langlist:focus { outline: none; }
#lg-langlist button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; height: 38px; padding: 0 14px; border: 0; background: transparent;
  color: var(--c-hbtn-ink); font: 400 14px var(--f-ui); cursor: pointer; text-align: left; }
#lg-langlist button[aria-selected="true"] { background: var(--c-opt-sel); }
#lg-langlist button svg { opacity: 0; }
#lg-langlist button[aria-selected="true"] svg { opacity: 1; }
#lg-langlist button:focus-visible { outline-offset: -3px; }
.lg-theme { display: inline-flex; height: 40px; border: 1px solid rgba(var(--c-hline-rgb),0.5); background: var(--c-hbtn); }
.lg-theme button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer;
  transition: background-color .15s cubic-bezier(.4,0,.2,1); }
.lg-theme button svg { stroke: var(--c-ink); }
.lg-theme button[aria-pressed="true"] { background: var(--c-ink); }
.lg-theme button[aria-pressed="true"] svg { stroke: var(--c-hbtn); }

/* 가운데 판 */
.lg-stage { position: relative; z-index: 4; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 8px 20px 40px; }
.ctl-panel { position: relative; width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); padding: 56px 48px 44px;
  box-shadow: 12px 12px 0 rgba(120,113,108,0.14); }
html:not([data-theme="light"]) .ctl-panel { border-color: rgba(220,228,238,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 28px 70px rgba(0,0,0,0.6), 0 6px 18px rgba(0,0,0,0.4); }
.lg-foot { position: relative; z-index: 5; flex: none; display: flex; flex-wrap: wrap; gap: 4px 0; padding: 16px clamp(20px, 3.4vw, 48px) 18px;
  font: 400 12px var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums;
  background: linear-gradient(0deg, rgba(var(--bg-rgb),0.9) 0%, rgba(var(--bg-rgb),0) 100%); }
.lg-foot span + span::before { content: ''; display: inline-block; width: 1px; height: 10px; margin: 0 10px; vertical-align: -1px; background: var(--hline); }

/* 판 머리: 큰 제목, 설명, 단계 */
.lg-head { margin-bottom: 28px; }
.lg-head h1 { margin: 0 0 10px; font: 600 40px/1.25 var(--f-title); letter-spacing: -0.02em; color: var(--ink); }
.lg-head h1:focus { outline: none; }
.lg-head p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.lg-view { display: flex; flex-direction: column; gap: 18px; font-family: var(--f-ui); }
.lg-view.lg-status { align-items: flex-start; gap: 0; }

/* 입력 칸 */
.sg-f { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sg-l { font-size: 14px; font-weight: 500; color: var(--ink2); }
.ctl-field { width: 100%; height: 52px; padding: 0 16px; background: var(--field); border: 1px solid var(--line); color: var(--ink); font: 400 15px var(--f-ui);
  outline: none; transition: border-color .2s ease, box-shadow .2s ease; border-radius: 0; }
.ctl-field::placeholder { color: var(--muted); opacity: .8; }
.ctl-field:focus { border-color: #D00F37; box-shadow: 0 0 0 3px rgba(208,15,55,0.18); }
.ctl-field[aria-invalid="true"] { border-color: #D00F37; }
.ctl-field.has-eye { padding-right: 52px; }
.lg-pw { position: relative; }
.lg-eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.lg-eye:hover { color: var(--ink); }
.lg-eye .eye-on { display: none; }
.lg-eye[aria-pressed="true"] .eye-on { display: block; }
.lg-eye[aria-pressed="true"] .eye-off { display: none; }
.sg-err { font-size: 13px; line-height: 1.5; color: var(--point); }
.sg-err:empty, .sg-note:empty, .sg-hint:empty { display: none; }
.sg-note { font-size: 13px; color: var(--ink2); }
.sg-hint { font-size: 13px; color: var(--muted); }
.sg-hint.bad { color: var(--point); }
.sg-hint a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.lg-caps { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lg-msg { padding: 12px 14px; border: 1px solid var(--line); border-left: 2px solid #D00F37; background: var(--field); font-size: 14px; line-height: 1.6; color: var(--ink2); }
.lg-msg:empty { display: none; }
.sg-rules { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sg-rule { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); transition: color .2s ease; }
.sg-rule svg { opacity: .45; transition: opacity .2s ease; }
.sg-rule[data-ok="true"] { color: var(--ink2); }
.sg-rule[data-ok="true"] svg { opacity: 1; color: #D00F37; }
.ctl-check { accent-color: #D00F37; width: 18px; height: 18px; margin: 0; flex: none; }
.sg-agree { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.sg-ck { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--ink2); cursor: pointer; }
/* 이용 약관 보기 → 레이어 (11-20 사용자). 화면 가운데 상자, 바깥 · Esc · 닫기로 닫는다 */
.sg-terms-btn { align-self: flex-start; border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; }
.sg-terms-btn:hover { color: var(--ink2); }
.sg-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(var(--bg-rgb), .72); backdrop-filter: blur(2px);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sg-modal-box { width: min(640px, 100%); max-height: min(720px, 100%); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--c-shadow); }
.sg-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.sg-modal-head h2 { margin: 0; font: 600 18px/1.4 var(--f-title); }
.sg-modal-x { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--ink2); cursor: pointer; }
.sg-modal-x:hover { color: var(--ink); background: var(--field); }
.sg-modal-text { flex: 1 1 auto; min-height: 120px; padding: 8px 20px 20px; overflow: auto; font: 14px/1.7 var(--f-ui); color: var(--ink2); background: var(--field); overflow-wrap: anywhere; }
.sg-modal-text:focus-visible { outline: 2px solid var(--point); outline-offset: -2px; }
.sg-modal-text h3 { margin: 12px 0 4px; font: 600 16px/1.5 var(--f-title); color: var(--ink); }
.sg-modal-text h4 { margin: 18px 0 4px; font: 600 14px/1.5 var(--f-ui); color: var(--ink); }
.sg-modal-text p { margin: 4px 0; }
.sg-modal-text p.note { margin: 4px 0 8px; padding: 8px 12px; border-left: 3px solid var(--point); color: var(--muted); font-size: 13px; }
.sg-modal-text ul { margin: 4px 0; padding-left: 20px; }
.sg-modal-text li { margin: 2px 0; }
.sg-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.sg-modal-btn { height: 44px; padding: 0 18px; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; font-size: 15px; }
.sg-modal-btn:hover { background: var(--field); }
.sg-modal-foot .ctl-btn.sg-modal-ok { width: auto; height: 44px; padding: 0 22px; font-size: 15px; }
@media (max-width: 480px) { .sg-modal-foot { flex-direction: column-reverse; } .sg-modal-foot > button, .sg-modal-foot .ctl-btn.sg-modal-ok { width: 100%; } }

/* 단추 */
.ctl-btn { position: relative; overflow: hidden; height: 54px; width: 100%; border: 0; background: #D00F37; color: #FFFFFF; font: 500 16px var(--f-ui); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; transition: background-color .2s ease, transform .15s ease; }
.ctl-btn:hover { background: #B30D2F; color: #FFFFFF; }
.ctl-btn:active { transform: translateY(1px); }
.ctl-btn[disabled] { cursor: progress; }
.ctl-btn .busy { display: none; }
.ctl-btn[aria-busy="true"] .busy { display: inline; }
.ctl-btn[aria-busy="true"] .idle { display: none; }
.ctl-ghost { height: 48px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; border: 1px solid var(--hline); background: transparent;
  color: var(--ink2); font: 500 14px var(--f-ui); text-decoration: none; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.ctl-ghost:hover { border-color: var(--muted); color: var(--ink); }
.ctl-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; margin-top: -4px; }
.ctl-link { color: var(--muted); text-decoration: none; padding: 6px 0; transition: color .2s ease; }
.ctl-link:hover { color: var(--ink); }
.sg-ui { margin: -2px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.sg-a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
.sg-a:hover { color: var(--ink); }
.sg-textbtn { border: 0; background: transparent; padding: 10px 4px; min-height: 44px; font: 500 14px var(--f-ui); color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sg-textbtn[disabled] { color: var(--muted); text-decoration: none; cursor: default; opacity: .7; }
.sg-center { align-self: center; }
/* 소셜 로그인 (api/oauth.py, 시안에는 없다): 설정된 제공자만 */
.lg-or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.lg-or::before, .lg-or::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }
.lg-oauth { display: flex; flex-direction: column; gap: 14px; }
.oauth-btns { display: grid; gap: 8px; }

/* 단계 (가입: 정보 입력 → 이메일 인증 → 승인 대기, 비밀번호 찾기: 링크 요청 → 메일 확인 → 새 비밀번호) */
.sg-steps { list-style: none; margin: 28px 0 0; padding: 0; display: flex; align-items: center; gap: 10px; font-family: var(--f-ui); }
.sg-step { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 13px; color: var(--muted); }
.sg-dot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid var(--hline); font: 600 12px/1 var(--f-ui); color: var(--muted); }
.sg-step[data-st="now"] { color: var(--ink); }
.sg-step[data-st="now"] .sg-dot { border-color: #D00F37; color: var(--accent-ink); }
.sg-step[data-st="done"] { color: var(--ink2); }
.sg-step[data-st="done"] .sg-dot { background: #D00F37; border-color: #D00F37; color: #FFFFFF; }
.sg-bar { flex: 1 1 auto; height: 1px; min-width: 12px; background: var(--line); }
.sg-bar[data-st="now"], .sg-bar[data-st="done"] { background: #D00F37; }

/* 6자리 코드 */
.sg-otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sg-cell { height: 60px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--field); font: 600 24px/1 var(--f-ui);
  color: var(--ink); transition: border-color .15s ease; }
.sg-cell[data-on="true"] { border-color: #D00F37; box-shadow: inset 0 -2px 0 #D00F37; }
.sg-otp[data-err="true"] .sg-cell { border-color: var(--point); }
.sg-otp-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; cursor: text; }
.sg-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.sg-row > span { color: var(--muted); }
.sg-time { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sg-time[data-low="true"] { color: var(--point); }
.sg-lead { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink2); }
.sg-lead strong, .sg-p strong { color: var(--ink); font-weight: 600; word-break: break-all; }

/* 결과 판 (승인 대기, 메일 확인, 비밀번호 바꿈, 가입 닫힘, 로그인됨) */
.sg-tag { display: inline-block; margin-top: 24px; padding: 4px 8px; background: var(--tagbg); color: var(--ink); font: 500 12px var(--f-ui); letter-spacing: .08em; }
.lg-status h2 { margin: 14px 0 10px; font: 600 30px/1.3 var(--f-title); letter-spacing: -0.02em; color: var(--ink); }
.sg-p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--muted); }
.sg-sum { margin: 24px 0 0; width: 100%; padding: 16px 18px; border: 1px solid var(--line); background: var(--field); display: flex; flex-direction: column; gap: 10px; }
.sg-sum div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.sg-sum dt { color: var(--muted); }
.sg-sum dd { margin: 0; color: var(--ink); text-align: right; word-break: break-all; }
p.sg-sum { margin-top: 20px; font-size: 13.5px; line-height: 1.6; color: var(--muted); display: block; }
.sg-plan { display: inline-block; padding: 2px 8px; border: 1px solid #D00F37; color: var(--accent-ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.lg-status .ctl-btn { margin-top: 28px; }
.lg-status .sg-row { width: 100%; margin-top: 20px; }
.lg-status .sg-row + .ctl-btn { margin-top: 16px; }
.lg-status .sg-note { margin-top: 14px; }
.lg-bar { margin-top: 28px; width: 100%; height: 2px; background: var(--line); }
.lg-bar > div { height: 100%; background: #D00F37; transform-origin: left center; animation: ctl-grow 2.2s cubic-bezier(.4,0,.2,1) both; }

/* 키보드 초점 */
main.lg a:focus-visible, main.lg button:focus-visible, main.lg summary:focus-visible, .ctl-check:focus-visible { outline: 2px solid #FF2A4F; outline-offset: 2px; }
.sg-otp:focus-within .sg-cell[data-on="true"] { outline: 2px solid #FF2A4F; outline-offset: 1px; }

/* ---- 움직임 (시안 값) ---- */
@keyframes ctl-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ctl-soft { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ctl-draw { from { stroke-dashoffset: 320; } to { stroke-dashoffset: 0; } }
@keyframes ctl-ok { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes ctl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ctl-up { opacity: 0; animation: ctl-up .8s cubic-bezier(.2,.7,.2,1) .24s forwards; }
.ctl-panel.soft { animation: ctl-soft .38s cubic-bezier(.2,.7,.2,1) both; opacity: 1; }
.ctl-draw { stroke-dasharray: 320; animation: ctl-draw 1.2s cubic-bezier(.4,0,.2,1) both; }
.ctl-okpath { stroke-dasharray: 40; animation: ctl-ok .6s .2s cubic-bezier(.4,0,.2,1) both; }

/* ---- 배경 그림 (static/img/login-bg.svg, 시안 규칙 중 이 그림에 쓰이는 것만. 같은 이름 keyframes는 시안이 나중에 '차분하게' 덮어쓴 값) ---- */
.ctl-bgsvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: .8; }
.ctl-bgsvg .bg-pk { offset-rotate: 0deg; animation: bg-move var(--d,8s) linear infinite, bg-fade var(--d,8s) ease-in-out infinite; }
.ctl-bgsvg .bg-pk-rev { animation-direction: reverse, normal; }
@keyframes bg-move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }
@keyframes bg-fade { 0% { opacity: 0; } 14% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.ctl-bgsvg .bg-bob { animation: bg-bob 4.2s ease-in-out infinite; }
.ctl-bgsvg .bg-bob-s { animation-duration: 3.4s; }
.ctl-bgsvg .bg-bob { animation-duration: 5s; }
@keyframes bg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ctl-bgsvg .bg-glow { animation: bg-glow 3.2s ease-in-out infinite; }
@keyframes bg-glow { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
.ctl-bgsvg .bg-led { animation: bg-led 2.8s steps(1,end) infinite; }
@keyframes bg-led { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .5; } }
.ctl-bgsvg .bg-node { animation: bg-node 2.4s ease-in-out infinite; }
@keyframes bg-node { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.ctl-bgsvg .bg-bar { animation: bg-bar 2.6s ease-in-out infinite; }
@keyframes bg-bar { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
.ctl-bgsvg .bg-route { animation: bg-route 3s linear infinite; }
@keyframes bg-route { 0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; } }
.ctl-bgsvg .bg-mapdot { animation: bg-glow 2.6s ease-in-out infinite; }
.ctl-bgsvg .bg-blip { transform-box: fill-box; transform-origin: center; animation: bg-blip 4.2s ease-in-out infinite; }
@keyframes bg-blip { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.ctl-bgsvg .bg-ring { transform-box: fill-box; transform-origin: center; animation: bg-ring 3.2s ease-out infinite; stroke-width: .8; }
@keyframes bg-ring { 0% { transform: scale(.7); opacity: .55; } 100% { transform: scale(2.4); opacity: 0; } }
.ctl-bgsvg .bg-reveal .bg-rv-hl { animation: bg-rv-hl 7s ease-in-out infinite; animation-delay: inherit; }
@keyframes bg-rv-hl { 0%, 26% { opacity: 0; } 36%, 80% { opacity: 1; } 90%, 100% { opacity: 0; } }
/* 어두운 테마: 밝은 그림의 색을 바꾼다 (시안 값) */
html:not([data-theme="light"]) .ctl-bgsvg .bg-paper, html:not([data-theme="light"]) .ctl-bgsvg .bg-paper[fill] { fill: #050716; }
html:not([data-theme="light"]) .ctl-bgsvg [fill="white"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#FAF8F5"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#FCFCFC"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#FBFBFC"] { fill: #12263B; }
html:not([data-theme="light"]) .ctl-bgsvg .bg-paper[fill] { fill: #050716; }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#EDECE9"] { fill: #0D1D2F; }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#E1DFDC"] { fill: #091626; }
html:not([data-theme="light"]) .ctl-bgsvg [stroke="#CBC5BE"], html:not([data-theme="light"]) .ctl-bgsvg [stroke="#D0CAC4"], html:not([data-theme="light"]) .ctl-bgsvg [stroke="#9B978C"], html:not([data-theme="light"]) .ctl-bgsvg [stroke="#B5B1A7"] { stroke: rgba(186,200,216,0.4); }
html:not([data-theme="light"]) .ctl-bgsvg [stroke="white"] { stroke: #12263B; }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#CBC5BE"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#D0CAC4"] { fill: rgba(186,200,216,0.55); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#9B978C"] { fill: rgba(186,200,216,0.6); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#ABA49C"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#AFAFAF"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#B3B3B3"] { fill: #3A5370; }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#C2BEB8"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#CFC9C2"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#D2D2D2"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#D9D9D9"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#EAEAEA"] { fill: #233A54; }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#6B6B6B"] { fill: #8FA1B6; }
html:not([data-theme="light"]) .ctl-bgsvg [stop-color="white"] { stop-color: rgba(186,200,216,0.35); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#FDF3F5"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#FDF5F7"] { fill: rgba(208,15,55,0.12); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#F7DFE3"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#F6D2DA"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#F6CFD7"] { fill: rgba(208,15,55,0.2); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#F5CBD0"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#F2CCD1"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#F1B5C1"] { fill: rgba(208,15,55,0.32); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#EC9FAF"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#E8879B"] { fill: rgba(208,15,55,0.5); }
html:not([data-theme="light"]) .ctl-bgsvg [stroke="#EC9FAF"], html:not([data-theme="light"]) .ctl-bgsvg [stroke="#E8879B"] { stroke: rgba(208,15,55,0.5); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#E9778E"], html:not([data-theme="light"]) .ctl-bgsvg [fill="#E36F87"] { fill: rgba(208,15,55,0.65); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#D93F5F"] { fill: rgba(208,15,55,0.85); }
html:not([data-theme="light"]) .ctl-bgsvg [fill="#D00E37"] { fill: #D00F37; }
html:not([data-theme="light"]) .ctl-bgsvg [stroke="#D00E37"] { stroke: #D00F37; }
html:not([data-theme="light"]) .ctl-bgsvg .bg-pk > g > polygon:nth-child(1) { fill: #2E5378; }
html:not([data-theme="light"]) .ctl-bgsvg .bg-pk > g > polygon:nth-child(2) { fill: #1D3A58; }
html:not([data-theme="light"]) .ctl-bgsvg .bg-pk > g > polygon { stroke: #FF2A4F; stroke-width: .7; }
html:not([data-theme="light"]) .ctl-bgsvg .bg-pk > g > polygon:nth-child(3) { fill: #FF2A4F; }
html:not([data-theme="light"]) .ctl-bgsvg .bg-pk > g { filter: drop-shadow(0 0 5px rgba(255,42,79,.55)); }
html:not([data-theme="light"]) .ctl-bgsvg .bg-road, html:not([data-theme="light"]) .ctl-bgsvg .bg-road > path { fill: #24415F; }
html:not([data-theme="light"]) .ctl-bgsvg mask [fill="white"] { fill: white; }
html:not([data-theme="light"]) .ctl-bgsvg mask [fill="black"] { fill: black; }
html:not([data-theme="light"]) .ctl-bgsvg mask [stroke="white"] { stroke: white; }
html:not([data-theme="light"]) .ctl-bgsvg mask [stroke="black"] { stroke: black; }

/* ---- 좁은 화면 ---- */
@media (max-width: 860px) { .lg-logo-sub { display: none; } }
/* 휴대폰: 배경 그림은 받지도 그리지도 않는다(login.js도 같은 폭으로 본다), 머리줄은 랜딩처럼 줄이고 가입하기 단추는 판 안 링크로 */
@media (max-width: 720px) { .lg-bg { display: none; } }
@media (max-width: 640px) {
  .lg-hd { height: auto; min-height: 64px; padding: 14px 16px; gap: 6px; }
  .lg-hd-r { gap: 6px; }
  .lg-logo svg { height: 18px; }
  .lg-ver, .lg-hd-signup { display: none; }
  #lg-lang { gap: 4px; padding: 0 6px 0 10px; height: 36px; }
  #lg-lang > [data-t="lang_label"] { display: none; }
  .lg-lang-short { display: inline; }
  #lg-langlist { left: auto; right: 0; top: 42px; }
  .lg-theme { height: 36px; }
  .lg-theme button { width: 32px; }
  .hd-btn.hd-pri { height: 36px; padding: 0 12px; }
  .lg-stage { padding: 4px 16px 24px; align-items: flex-start; }
  .lg-foot { gap: 2px 14px; padding: 16px; }
  .lg-foot span + span::before { display: none; }   /* 줄이 바뀌면 구분선이 줄 앞에 남는다 */
  .ctl-panel { padding: 36px 22px 30px; box-shadow: 6px 6px 0 rgba(120,113,108,0.14); }
  .lg-head h1 { font-size: 32px; }
  .lg-status h2 { font-size: 26px; }
  .sg-cell { height: 52px; font-size: 22px; }
  .sg-otp { gap: 6px; }
}
@media (max-width: 520px) { .sg-step:not([data-st="now"]) .sg-sl { display: none; } }
@media (max-width: 359px) { .lg-theme { display: none; } }

/* 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
  .ctl-up { opacity: 1; animation: none; }
  .ctl-panel.soft, .ctl-draw, .ctl-okpath, .lg-bar > div { animation: none; }
  .ctl-bgsvg * { animation: none !important; }
  .ctl-bgsvg .bg-pk { offset-distance: 40%; }
  .lg-bg { transition: none; }
}
