/* =====================================================================
   PowerLink AI 관리 웹 — 로그인 첫 화면 (B안 · 포슬린)
   - CSP 준수: 인라인 style 속성 없음, 외부 글꼴 없음, 같은 서버 파일만 사용
   - 모든 클래스는 pl-login- 접두사. 관리 화면의 .workspace 규칙과 섞이지 않음
   - 실제 반영 시: 이 파일을 apps/admin-web/login.css 로 두고 index.html 에서 불러오기
   - 2026-10-07 반영: index.html 이 로그인 뒤 관리 화면에서도 이 파일을 부르므로
     시안의 전체 규칙(* box-sizing, html/body 여백)을 로그인·불러오는 중 범위로 좁혔다.
   ===================================================================== */

:root {
  /* 바탕·면 */
  --pl-login-bg: #F7F7F4;          /* 페이지 바탕. 히어로 이미지 바탕과 정확히 같은 값 (바꾸면 이미지도 다시 만들어야 함) */
  --pl-login-surface: #FFFFFF;     /* 로그인 카드, 스플래시 바탕 */
  --pl-login-line: #E6E6E1;        /* 카드 외곽선, 꼬리말 구분선 */
  --pl-login-line-soft: #EEEEEA;   /* 카드 안 구분선 */
  --pl-login-track: #E3E3DE;       /* 진행 막대 바탕 */

  /* 글자 */
  --pl-login-ink: #111314;         /* 제목·본문 */
  --pl-login-ink-sub: #3C4240;     /* 설명 문장 */
  --pl-login-muted: #5B6260;       /* 보조 글자 (가장 옅은 글자색, #F7F7F4 위 5.82:1) */

  /* 강조 — 앱과 같은 오션 블루 */
  --pl-login-accent: #0D5596;      /* 버튼·「한곳에서」·지금 여기 (흰 글자 대비 7.62:1) */
  --pl-login-accent-hover: #0B4A83;
  --pl-login-accent-soft: #4C9BE0; /* 로고 끝점 (장식 전용, 글자에 쓰지 않음) */

  /* 상태 */
  --pl-login-danger: #B42318;  --pl-login-danger-bg: #FCEBE9;  --pl-login-danger-line: #F2C9C4;
  --pl-login-warn: #B54708;    --pl-login-warn-bg: #FDF0E3;    --pl-login-warn-line: #F1D3B4;
  --pl-login-neutral: #3C4240; --pl-login-neutral-bg: #ECEDEB; --pl-login-neutral-line: #D9DBD7;

  /* 글꼴 — 서버에 글꼴 파일 없음. 사용자 PC 설치 글꼴 사용 */
  --pl-login-font: "Noto Sans CJK KR", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --pl-login-mono: "IBM Plex Mono", Consolas, monospace;

  /* 치수 */
  --pl-login-gutter: clamp(24px, 3.5vw, 64px);
  --pl-login-card-w: 440px;
  --pl-login-btn-h: 56px;
}

.pl-boot, .pl-boot *, body.pl-login-body, body.pl-login-body * { box-sizing: border-box; }
body.pl-login-body { margin: 0; }
/* 관리 화면용 「본문으로 이동」(index.html .skip)은 로그인 화면에서 숨긴다. 로그인 화면은 자기 건너뛰기 링크를 쓴다 */
body.pl-login-body > .skip { display: none; }
body.pl-login-body {
  background: var(--pl-login-bg);
  color: var(--pl-login-ink);
  font-family: var(--pl-login-font);
  /* workspace.css :root(줄 간격 1.55, font-synthesis:none)·redesign.css body(13px)를 시안 기본값으로 되돌림 */
  font-size: 16px; line-height: normal; font-synthesis: weight style small-caps;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 건너뛰기 링크 ---------- */
.pl-login-skip {
  position: absolute; left: 16px; top: -80px; z-index: 50;
  padding: 10px 14px; border-radius: 6px;
  background: var(--pl-login-ink); color: #FFFFFF;
  font-size: 14px; text-decoration: none;
}
.pl-login-skip:focus { top: 12px; }

/* ---------- 초점 표시 (공통) ---------- */
.pl-login-btn:focus-visible,
.pl-login-skip:focus-visible,
.pl-boot-reload:focus-visible {
  outline: 2px solid var(--pl-login-accent);
  outline-offset: 3px;
}

/* =====================================================================
   1. 불러오는 중 (스플래시) — JS 없이 CSS 시간만으로 단계가 바뀜
      0~0.8초: 빈 화면 / 0.8초~: 점 13개 + 로고 / 10초~: 새로고침 안내
   ===================================================================== */
.pl-boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 24px;
  background: var(--pl-login-surface);
}
.pl-boot-dots { display: flex; gap: 7px; }
.pl-boot-dots span {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pl-login-track);
  transform: scale(0);
  animation: plPop .42s cubic-bezier(.3,1.4,.5,1) both;
}
.pl-boot-dots span:nth-child(1)  { animation-delay: .80s; }
.pl-boot-dots span:nth-child(2)  { animation-delay: .87s; }
.pl-boot-dots span:nth-child(3)  { animation-delay: .94s; }
.pl-boot-dots span:nth-child(4)  { animation-delay: 1.01s; }
.pl-boot-dots span:nth-child(5)  { animation-delay: 1.08s; }
.pl-boot-dots span:nth-child(6)  { animation-delay: 1.15s; }
.pl-boot-dots span:nth-child(7)  { animation-delay: 1.22s; }
.pl-boot-dots span:nth-child(8)  { animation-delay: 1.29s; }
.pl-boot-dots span:nth-child(9)  { animation-delay: 1.36s; }
.pl-boot-dots span:nth-child(10) { animation-delay: 1.43s; }
.pl-boot-dots span:nth-child(11) { animation-delay: 1.50s; }
.pl-boot-dots span:nth-child(12) { animation-delay: 1.57s; }
.pl-boot-dots span:nth-child(13) { animation-delay: 1.64s; }
.pl-boot-brand {
  display: flex; align-items: center; gap: 14px;
  opacity: 0; animation: plFade .6s ease-out 1.6s both;
}
.pl-boot-brand img { width: 40px; height: 40px; display: block; }
.pl-boot-brand span { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.pl-boot-slow {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  opacity: 0; visibility: hidden;
  animation: plShow .4s ease-out 10s forwards;
}
.pl-boot-slow p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--pl-login-ink-sub); }
.pl-boot-reload {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 8px;
  border: 1px solid #C9CBC5; background: #FFFFFF; color: var(--pl-login-ink);
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.pl-sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* =====================================================================
   2. 로그인 첫 화면
   ===================================================================== */
.pl-login {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--pl-login-bg); overflow: hidden;
}

/* 머리말 */
.pl-login-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--pl-login-gutter);
  animation: plFade .6s ease-out both;
}
.pl-login-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-login-brand img { width: 30px; height: 30px; display: block; }
.pl-login-brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.pl-login-brand-divider { width: 1px; height: 16px; background: #D6D6D0; }
.pl-login-brand-console { font-size: 14px; color: var(--pl-login-muted); white-space: nowrap; }
.pl-login-company { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; }

/* 본문 배치: 왼쪽 그림(2줄 차지) / 오른쪽 위 제목 / 오른쪽 아래 카드 */
.pl-login-grid {
  flex: 1; width: 100%; max-width: 1760px; margin: 0 auto;
  padding: 20px var(--pl-login-gutter) 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--pl-login-card-w);
  grid-template-areas: "visual head" "visual card";
  column-gap: clamp(40px, 4.5vw, 88px);
  row-gap: 28px;
  align-items: center;
}

/* 그림 영역 */
.pl-login-visual {
  grid-area: visual; margin: 0; min-width: 0;
  display: flex; flex-direction: column; gap: 20px;
  animation: plRise 1s cubic-bezier(.2,.7,.2,1) .05s both;
}
.pl-login-hero { display: block; width: 100%; max-width: 1180px; height: auto; margin: 0 auto; }

.pl-login-path { display: flex; flex-direction: column; gap: 14px; }
.pl-login-path-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pl-login-path-title { font-size: 13px; font-weight: 700; }
.pl-login-path-code { font-family: var(--pl-login-mono); font-size: 12px; color: var(--pl-login-muted); }
.pl-login-path-track { position: relative; height: 2px; border-radius: 2px; background: var(--pl-login-track); overflow: hidden; }
.pl-login-path-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  border-radius: 2px; background: var(--pl-login-accent);
  animation: plProg 4.8s cubic-bezier(.5,0,.3,1) infinite;
}
.pl-login-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
}
.pl-login-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-login-step-idx { font-family: var(--pl-login-mono); font-size: 12px; color: var(--pl-login-muted); }
.pl-login-step-name { font-size: 14px; font-weight: 700; }
.pl-login-step-role { font-size: 12.5px; color: var(--pl-login-muted); }
.pl-login-step--here .pl-login-step-idx,
.pl-login-step--here .pl-login-step-name { color: var(--pl-login-accent); }

/* 제목 영역 */
.pl-login-head {
  grid-area: head; align-self: end;
  display: flex; flex-direction: column; gap: 18px;
  animation: plIn .7s cubic-bezier(.2,.7,.2,1) both;
}
.pl-login-chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--pl-login-track);
  font-size: 13px; font-weight: 500; color: var(--pl-login-ink-sub);
}
.pl-login-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pl-login-accent); }
.pl-login-title {
  margin: 0; font-size: clamp(34px, 4vw, 64px); line-height: 1.12;
  font-weight: 900; letter-spacing: -0.04em; text-wrap: balance;
}
.pl-login-title span { display: block; }
.pl-login-title-accent { color: var(--pl-login-accent); }
.pl-login-lead { margin: 0; font-size: 16px; line-height: 1.75; color: var(--pl-login-ink-sub); text-wrap: pretty; }

/* 로그인 카드 */
.pl-login-card {
  grid-area: card; align-self: start;
  display: flex; flex-direction: column; gap: 20px;
  padding: clamp(26px, 2.8vw, 34px);
  border-radius: 18px; background: var(--pl-login-surface);
  box-shadow: 0 0 0 1px var(--pl-login-line), 0 30px 60px -30px rgba(17,19,20,0.25);
  animation: plIn .7s cubic-bezier(.2,.7,.2,1) .12s both;
}
.pl-login-card-head { display: flex; flex-direction: column; gap: 8px; }
.pl-login-card-title { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; }
.pl-login-card-desc { margin: 0; font-size: 15px; line-height: 1.7; color: var(--pl-login-muted); }

.pl-login-alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 10px; border: 1px solid;
}
.pl-login-alert[hidden] { display: none; }
.pl-login-alert svg { flex: none; margin-top: 2px; }
.pl-login-alert-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-login-alert-title { font-size: 14.5px; line-height: 1.55; }
.pl-login-alert-body { font-size: 14px; line-height: 1.6; color: var(--pl-login-ink-sub); }
.pl-login-alert--danger  { background: var(--pl-login-danger-bg);  border-color: var(--pl-login-danger-line);  color: var(--pl-login-danger); }
.pl-login-alert--warn    { background: var(--pl-login-warn-bg);    border-color: var(--pl-login-warn-line);    color: var(--pl-login-warn); }
.pl-login-alert--neutral { background: var(--pl-login-neutral-bg); border-color: var(--pl-login-neutral-line); color: var(--pl-login-neutral); }

.pl-login-action { display: flex; flex-direction: column; gap: 12px; }
.pl-login-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--pl-login-btn-h); padding: 0 22px; border-radius: 12px;
  background: var(--pl-login-accent); color: #FFFFFF;
  font-size: 16px; font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(13,85,150,0.7);
  transition: background-color .15s ease, transform .15s ease;
}
.pl-login-btn:hover { background: var(--pl-login-accent-hover); }
.pl-login-btn:active { transform: translateY(1px); }
.pl-login-helper { margin: 0; text-align: center; font-size: 13.5px; line-height: 1.6; color: var(--pl-login-muted); }
.pl-login-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding-top: 16px; border-top: 1px solid var(--pl-login-line-soft);
  font-size: 13px; line-height: 1.6; color: var(--pl-login-muted);
}
.pl-login-note svg { flex: none; margin-top: 2px; }

/* 꼬리말 */
.pl-login-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  column-gap: 24px; row-gap: 6px;
  padding: 16px var(--pl-login-gutter);
  border-top: 1px solid var(--pl-login-line);
  font-size: 12px; color: var(--pl-login-muted);
  animation: plFade .6s ease-out both;
}

/* =====================================================================
   3. 로그인 실패 페이지 (서버가 그리는 페이지) — 같은 머리말·꼬리말 + 카드 하나
   ===================================================================== */
.pl-fail-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px var(--pl-login-gutter);
}
.pl-fail-card {
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 20px;
  padding: clamp(26px, 2.8vw, 34px); border-radius: 18px;
  background: var(--pl-login-surface);
  box-shadow: 0 0 0 1px var(--pl-login-line), 0 30px 60px -30px rgba(17,19,20,0.25);
}
.pl-fail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-fail-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; }
.pl-fail-icon--warn { background: var(--pl-login-warn-bg); color: var(--pl-login-warn); }
.pl-fail-icon--neutral { background: var(--pl-login-neutral-bg); color: var(--pl-login-neutral); }
.pl-fail-code { font-family: var(--pl-login-mono); font-size: 12px; color: var(--pl-login-muted); }
.pl-fail-title { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 700; letter-spacing: -0.015em; }
.pl-fail-msg { margin: 0; font-size: 15px; line-height: 1.7; color: var(--pl-login-ink-sub); }

/* =====================================================================
   4. 반응형
   ===================================================================== */
@media (max-width: 1100px) {
  :root { --pl-login-card-w: 380px; }
  .pl-login-grid { padding: 20px 32px 28px; column-gap: 40px; }
}
@media (max-width: 860px) {
  .pl-login-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "card" "visual";
    padding: 20px 20px 32px; row-gap: 22px;
  }
  .pl-login-company, .pl-login-step-role { display: none; }
}

/* =====================================================================
   5. 움직임
   ===================================================================== */
@keyframes plPop  { 0% { transform: scale(0); background: var(--pl-login-track); } 60% { transform: scale(1.15); } 100% { transform: scale(1); background: var(--pl-login-accent); } }
@keyframes plFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes plShow { to { opacity: 1; visibility: visible; } }
@keyframes plIn   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes plRise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes plProg { 0% { width: 0; } 80%, 100% { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .pl-boot-dots span { animation: none; transform: none; background: var(--pl-login-accent); }
  .pl-boot-brand { animation: none; opacity: 1; }
  .pl-login-header, .pl-login-visual, .pl-login-head, .pl-login-card, .pl-login-footer { animation: none; }
  .pl-login-path-fill { animation: none; width: 100%; }
}
