/* ================================================
   ZioYou ERP - 로그인 & 인증 스타일
   ================================================ */

/* ===== 로그인 페이지 전체 레이아웃 ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a2a5e 0%, #0057b8 45%, #0088d1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans KR', sans-serif;
  position: relative;
  overflow: hidden;
}

/* 배경 도형 */
.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -100px; right: -100px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -80px; left: -80px;
  pointer-events: none;
}

/* ===== 로그인 카드 ===== */
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 440px;
  padding: 48px 44px 40px;
  position: relative;
  z-index: 10;
  animation: loginSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes loginSlideUp {
  from { opacity:0; transform:translateY(32px) scale(0.96); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

/* ===== 로고 영역 ===== */
.login-logo-area {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-area img {
  height: 44px;
  object-fit: contain;
}
.login-erp-label {
  display: block;
  font-size: 13px;
  color: #0066CC;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 8px;
}
.login-subtitle {
  display: block;
  font-size: 11px;
  color: #8899aa;
  margin-top: 2px;
}

/* ===== 폼 제목 ===== */
.login-form-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a2740;
  margin-bottom: 24px;
  text-align: center;
}

/* ===== 입력 그룹 ===== */
.login-field {
  margin-bottom: 18px;
}
.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #445566;
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.login-input-wrap {
  position: relative;
}
.login-input-wrap .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #aabbcc;
  font-size: 14px;
  pointer-events: none;
  transition: color 0.2s;
}
.login-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1.5px solid #dde4ef;
  border-radius: 10px;
  font-size: 14px;
  color: #1a2740;
  font-family: inherit;
  outline: none;
  background: #f8faff;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.login-input-wrap input:focus {
  border-color: #0066CC;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}
.login-input-wrap input:focus + .field-icon-right,
.login-input-wrap input:focus ~ .field-icon { color: #0066CC; }
.login-input-wrap .field-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #aabbcc;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.login-input-wrap .field-icon-right:hover { color: #0066CC; }

/* 오류 상태 */
.login-input-wrap.error input {
  border-color: #e53935;
  background: #fff8f8;
}
.login-field .field-error {
  font-size: 11px;
  color: #e53935;
  margin-top: 5px;
  display: none;
}
.login-field.has-error .field-error { display: block; }

/* ===== 옵션 행 ===== */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #556677;
  cursor: pointer;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  accent-color: #0066CC;
  width: 15px; height: 15px;
  cursor: pointer;
}
.login-forgot {
  font-size: 12px;
  color: #0066CC;
  text-decoration: none;
  cursor: pointer;
}
.login-forgot:hover { text-decoration: underline; }

/* ===== 로그인 버튼 ===== */
.btn-login {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #0057b8, #0088d1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 6px 20px rgba(0,102,204,0.35);
}
.btn-login:hover  { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,102,204,0.45); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-login .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-login.loading .spinner { display: block; }
.btn-login.loading .btn-text { display: none; }

/* ===== 오류 배너 ===== */
.login-alert {
  background: #fff3f3;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #c62828;
  margin-bottom: 16px;
  display: none;
  align-items: flex-start;
  gap: 8px;
}
.login-alert.show { display: flex; }
.login-alert i { margin-top: 1px; flex-shrink: 0; }

/* ===== 성공 배너 ===== */
.login-success {
  background: #f0faf4;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #2e7d32;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.login-success.show { display: flex; }

/* ===== 하단 시스템 정보 ===== */
.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 11px;
  color: #889aaa;
  line-height: 1.7;
}
.login-footer strong { color: #0066CC; }

/* ===== 잠금 화면 안내 ===== */
.login-locked-bar {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #e65100;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.login-locked-bar.show { display: flex; }

/* ===== 비밀번호 강도 바 ===== */
.pw-strength-bar {
  height: 4px;
  background: #eee;
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s, background 0.3s;
  width: 0%;
}
.pw-strength-fill.weak   { width: 33%; background: #e53935; }
.pw-strength-fill.medium { width: 66%; background: #fb8c00; }
.pw-strength-fill.strong { width: 100%; background: #43a047; }
.pw-strength-hint {
  font-size: 10px;
  margin-top: 3px;
  color: #8899aa;
}
.pw-strength-hint.weak   { color: #e53935; }
.pw-strength-hint.medium { color: #fb8c00; }
.pw-strength-hint.strong { color: #43a047; }

/* ===== 비밀번호 변경 패널 ===== */
.change-pw-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 440px;
  padding: 40px 44px;
  position: relative;
  z-index: 10;
  animation: loginSlideUp 0.4s ease;
  display: none;
}
.change-pw-card.visible { display: block; }

/* ===== 환경설정 / 사용자 관리 내 스타일 ===== */

/* 사용자 역할 배지 */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* 보안 정책 폼 */
.policy-section {
  margin-bottom: 28px;
}
.policy-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #0066CC;
  border-bottom: 1px solid #e0eaf5;
  padding-bottom: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.policy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f5f8;
}
.policy-row:last-child { border-bottom: none; }
.policy-label {
  font-size: 13px;
  color: #334455;
}
.policy-desc {
  font-size: 11px;
  color: #8899aa;
  margin-top: 2px;
}
.policy-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.policy-control input[type="number"] {
  width: 72px;
  height: 32px;
  border: 1.5px solid #dde4ef;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
  text-align: center;
  outline: none;
  font-family: inherit;
}
.policy-control input[type="number"]:focus {
  border-color: #0066CC;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.12);
}
.toggle-switch {
  position: relative;
  width: 44px; height: 24px;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccd5e0;
  border-radius: 24px;
  transition: 0.25s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: #0066CC; }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }

/* 사용자 상태 */
.user-status-active   { color: #2e7d32; font-weight: 600; }
.user-status-inactive { color: #b71c1c; font-weight: 600; }
.user-status-locked   { color: #e65100; font-weight: 600; }

/* 마지막 로그인 */
.last-login-time {
  font-size: 11px;
  color: #778899;
}

/* 세션 타이머 */
.session-timer {
  font-size: 11px;
  color: #778899;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}
.session-timer.warn { color: #e65100; }
.session-timer.danger { color: #c62828; animation: timerPulse 1s infinite; }
@keyframes timerPulse {
  0%,100% { opacity:1; }
  50%      { opacity:0.5; }
}

/* 현재 로그인 사용자 정보 (헤더) */
.user-info-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.user-info-chip:hover { background: rgba(255,255,255,0.2); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088d1, #0044a8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.user-info-role {
  font-size: 10px;
  color: rgba(255,255,255,0.75);
}

/* 드롭다운 메뉴 */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #dde4ef;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: dropDown 0.18s ease;
}
.user-dropdown.open { display: block; }
@keyframes dropDown {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.dropdown-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f3f8;
}
.dropdown-name { font-size: 13px; font-weight: 700; color: #1a2740; }
.dropdown-role { font-size: 11px; color: #0066CC; margin-top: 1px; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: #334455;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.dropdown-item:hover { background: #f5f8ff; }
.dropdown-item i { width: 16px; color: #0066CC; }
.dropdown-item.danger { color: #c62828; }
.dropdown-item.danger i { color: #c62828; }
.dropdown-divider { height: 1px; background: #f0f3f8; margin: 4px 0; }

/* 접근 거부 오버레이 */
.access-denied-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  display: none;
}
.access-denied-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 360px;
}
.access-denied-icon { font-size: 48px; color: #e53935; margin-bottom: 16px; }
.access-denied-title { font-size: 18px; font-weight: 700; color: #1a2740; margin-bottom: 8px; }
.access-denied-desc  { font-size: 13px; color: #667788; }

/* 로딩 스피너 공통 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 반응형 ===== */
@media (max-width: 480px) {
  .login-card, .change-pw-card { padding: 32px 24px; max-width: 100%; margin: 16px; }
}
