/* K AI 연구소 로그인·처음 설정 화면 — 12/03 대표님 «로그인페이지부터 uiux 디자인 신경 좀 써라» → 다시 디자인.
   PC: 왼쪽 짙은 파랑 브랜드 면 + 오른쪽 입력 · 폰: 위에 브랜드 띠 + 아래 입력 카드 · 어두운 화면 설정이면 저절로 어둡게.
   ★보안 정책상 스크립트·style 속성·바깥 그림을 못 쓴다 — 모양은 이 파일에서만 만든다. */
@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("/__gate/pretendard.woff2") format("woff2-variations");
}
:root {
  --ink: #0f1a2b; --sub: #566173; --faint: #8a94a6; --line: #e2e7ef; --page: #f4f6fa; --panel: #ffffff;
  --blue: #2462e8; --blue-2: #1a4fcf; --blue-soft: #eaf0fe; --focus: rgba(36, 98, 232, .18);
  --ok: #1f7a45; --ok-bg: #eefaf3; --ok-line: #bfe3cc; --err: #c53030; --err-bg: #fff4f4; --err-line: #f3c6c6;
  --field: #ffffff; --field-line: #d3dae5; --field-hover: #b6c0d0; --icon: #8a94a6;
  --brand-a: #0a1a40; --brand-b: #12357f; --brand-c: #1f56d6;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, "D2Coding", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebf1; --sub: #a3acba; --faint: #7b8494; --line: #262b34; --page: #0e1014; --panel: #13161c;
    --blue: #4c82f0; --blue-2: #3a6fe0; --blue-soft: #1a2846; --focus: rgba(76, 130, 240, .3);
    --ok: #6fd39b; --ok-bg: #11271b; --ok-line: #23523a; --err: #f29a9a; --err-bg: #2b1616; --err-line: #582828;
    --field: #181c23; --field-line: #2d3440; --field-hover: #3b4453; --icon: #7b8494;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.gate {
  min-height: 100vh; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 46%) 1fr; }

/* ── 브랜드 면(PC) ── */
.brandside {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 56px; color: #fff;
  background:
    radial-gradient(900px 520px at -15% -10%, rgba(91, 141, 255, .55), transparent 62%),
    radial-gradient(700px 480px at 115% 115%, rgba(56, 189, 248, .34), transparent 60%),
    linear-gradient(158deg, var(--brand-a) 0%, var(--brand-b) 52%, var(--brand-c) 100%);
}
.brandside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 28% 42%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse at 28% 42%, #000 25%, transparent 72%);
}
.brandside::after {
  content: ""; position: absolute; width: 560px; height: 560px; right: -190px; bottom: -210px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16); pointer-events: none;
  box-shadow: 0 0 0 64px rgba(255, 255, 255, .035), 0 0 0 150px rgba(255, 255, 255, .025);
}
.brandtop, .brandmid, .brandfoot { position: relative; z-index: 1; }
.brandtop { display: flex; align-items: center; gap: 12px; font-weight: 760; font-size: 18px; letter-spacing: -.2px; }
.brandtop img { border-radius: 11px; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.brandmid { max-width: 460px; }
.brandmid h2 { margin: 0 0 16px; font-size: 40px; line-height: 1.24; font-weight: 820; letter-spacing: -1.2px; }
.brandmid p { margin: 0; font-size: 15.5px; line-height: 1.75; color: rgba(255, 255, 255, .8); }
.points { margin: 30px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: rgba(255, 255, 255, .9); }
.points .pi {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); color: #9fdcff;
}
.points svg { width: 16px; height: 16px; }
.brandfoot { font-size: 12.5px; color: rgba(255, 255, 255, .55); }

/* ── 입력 면 ── */
.panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--panel); }
.formwrap { width: 100%; max-width: 400px; }
.formwrap.wide { max-width: 470px; }
.mbrand { display: none; }
h1 { margin: 0 0 8px; font-size: 30px; font-weight: 820; letter-spacing: -.9px; line-height: 1.25; }
.sub { margin: 0 0 26px; color: var(--sub); line-height: 1.7; font-size: 15px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 13.5px; font-weight: 720; color: var(--ink); }
.control { position: relative; display: block; }
.control svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  color: var(--icon); pointer-events: none; transition: color .15s;
}
.control input {
  width: 100%; height: 54px; padding: 0 16px 0 48px; font: inherit; font-size: 16px; font-weight: 500; color: var(--ink);
  background: var(--field); border: 1.5px solid var(--field-line); border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.control input:hover { border-color: var(--field-hover); }
.control input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--focus); }
.control:focus-within svg { color: var(--blue); }
.control input::placeholder { color: var(--faint); font-weight: 400; }
.control.otp input { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: 9px; font-variant-numeric: tabular-nums; }
.control.otp input::placeholder { font-family: var(--font); font-size: 15px; font-weight: 400; letter-spacing: 0; }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.5; }

/* 30일 유지 스위치 — 진짜 체크칸을 숨기고 모양만 바꾼다(키보드·읽어 주기 그대로) */
.switch { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--field-line); transition: background .18s; }
.thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s;
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--focus); }
.switch-text { font-size: 14px; color: var(--sub); }

/* 단추 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 54px; margin-top: 4px;
  border: 0; border-radius: 12px; background: linear-gradient(180deg, #3170f2, var(--blue-2)); color: #fff;
  font: inherit; font-size: 16px; font-weight: 760; letter-spacing: -.2px; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 22px rgba(36, 98, 232, .26), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 12px 28px rgba(36, 98, 232, .32), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .key summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--field-line); box-shadow: none; }
.btn.ghost:hover { background: var(--blue-soft); filter: none; }

/* 알림 — 틀렸을 때는 한 문장만(어느 칸이 틀렸는지는 알려 주지 않는다) */
.note { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin: 0 0 18px; font-size: 14px; line-height: 1.6; border: 1px solid; }
.note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.note.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.note.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }

/* 처음 설정 */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.steps span {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 720; padding: 6px 12px; border-radius: 999px;
  background: var(--page); color: var(--faint); border: 1px solid var(--line);
}
.steps span.on { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.steps span.done { color: var(--ok); }
.steps i { width: 20px; height: 1px; background: var(--line); }
.howto { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.howto li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; }
.howto li::before {
  content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  background: var(--blue-soft); color: var(--blue); font-size: 12.5px; font-weight: 800;
}
.qr { display: flex; justify-content: center; margin: 4px 0 18px; }
.qr svg { width: 224px; height: 224px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px rgba(15, 26, 43, .08); }
.key { margin: 0 0 20px; font-size: 13.5px; color: var(--sub); line-height: 1.6; }
.key summary { cursor: pointer; color: var(--blue); font-weight: 720; }
.key code {
  display: block; margin-top: 8px; padding: 12px 14px; background: var(--page); border: 1px dashed var(--field-line); border-radius: 10px;
  color: var(--ink); font-family: var(--mono); font-size: 15px; letter-spacing: 1.5px; word-break: break-all; user-select: all;
}
.small { font-size: 12.5px; color: var(--faint); margin: 16px 0 0; }
.badge { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px; }
.badge svg { width: 30px; height: 30px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.wait { background: var(--blue-soft); color: var(--blue); }

/* ── 폰 ── */
@media (max-width: 900px) {
  .shell { display: block; }
  .brandside { display: none; }
  .panel { display: block; padding: 0; background: var(--page); }
  .formwrap, .formwrap.wide { max-width: none; }
  .mbrand {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 30px 22px 70px;
    color: #fff; font-weight: 760; font-size: 18px; letter-spacing: -.2px;
    background:
      radial-gradient(500px 300px at -10% -20%, rgba(91, 141, 255, .55), transparent 62%),
      linear-gradient(158deg, var(--brand-a) 0%, var(--brand-b) 55%, var(--brand-c) 100%);
  }
  .mbrand::after {
    content: ""; position: absolute; width: 300px; height: 300px; right: -110px; top: -130px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 0 0 44px rgba(255, 255, 255, .03);
  }
  .mbrand img { border-radius: 10px; position: relative; z-index: 1; }
  .mbrand span { position: relative; z-index: 1; }
  .mcard {
    position: relative; margin: -44px 14px 28px; padding: 26px 20px 22px; background: var(--panel);
    border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 32px rgba(15, 26, 43, .10);
  }
  h1 { font-size: 25px; }
  .sub { margin-bottom: 22px; }
}
