/* =========================================================
   빌리브세웅병원 QPS·감염관리실 — 회원 인증(로그인·승인) 스타일
   ========================================================= */

/* ---------------- 페이지 가드 오버레이 ---------------- */
.auth-guard {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 247, 250, .94);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.auth-guard[hidden] { display: none !important; }

.auth-guard-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 30px 26px;
  text-align: center;
  margin: auto;
}
.auth-guard-card strong { display: block; font-size: 1.06rem; margin-bottom: 6px; }
.auth-guard-card p { color: var(--c-text-muted); font-size: .89rem; margin: 0 0 16px; }
.auth-guard-card .guard-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 16px;
  border: 3px solid var(--c-primary-light);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.guard-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 14px; display: block; }

/* ---------------- 로그인 / 회원가입 페이지 ---------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, #073d5d, #0b5c8a 48%, #0e9384);
}
.auth-page .auth-topbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.auth-page .auth-topbar a.back { color: #d7ecf5; font-size: .86rem; font-weight: 600; }
.auth-page .auth-topbar .brand-text strong { color: #fff; }
.auth-page .auth-topbar .brand-text small { color: #9fc3d4; }

.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 10px 20px 48px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}

.auth-card h1 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-card .auth-sub { font-size: .86rem; color: var(--c-text-muted); margin-bottom: 20px; }

.auth-tabs {
  display: flex;
  gap: 6px;
  background: #eef2f6;
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: var(--c-text-muted);
  cursor: pointer;
}
.auth-tabs button.active { background: #fff; color: var(--c-primary-dark); box-shadow: var(--shadow-sm); }

.auth-panel[hidden] { display: none !important; }

.auth-note {
  font-size: .79rem;
  color: var(--c-text-muted);
  background: #f7fafc;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 16px;
  line-height: 1.6;
  text-align: left;
}

.auth-alert {
  display: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.55;
}
.auth-alert.show { display: block; }
.auth-alert.is-error { background: var(--c-danger-light); color: #b42318; }
.auth-alert.is-warn { background: var(--c-accent-light); color: #8a5200; }
.auth-alert.is-ok { background: var(--c-success-light); color: #087443; }
.auth-alert.is-info { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* 승인 대기 상태 카드 */
.pending-card {
  text-align: center;
  padding: 8px 0 4px;
}
.pending-card .pending-icon { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.pending-card h2 { font-size: 1.16rem; margin-bottom: 8px; }
.pending-card p { color: var(--c-text-muted); font-size: .89rem; }
.pending-meta {
  text-align: left;
  background: #f7fafc;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: .86rem;
}
.pending-meta div { display: flex; gap: 10px; padding: 4px 0; }
.pending-meta div span:first-child { width: 78px; color: var(--c-text-muted); flex-shrink: 0; font-weight: 600; }
.pending-meta div span:last-child { font-weight: 700; }

.auth-side {
  width: 100%;
  max-width: 340px;
  color: #dff0f7;
  font-size: .87rem;
  padding-top: 8px;
}
.auth-side h3 { color: #fff; font-size: 1rem; }
.auth-side ol { padding-left: 20px; line-height: 1.9; }
.auth-side .auth-side-box {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

/* ---------------- 헤더 회원 정보 ---------------- */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--c-border);
  flex-shrink: 0;
}
.header-user .hu-info { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.header-user .hu-name { font-size: .85rem; font-weight: 800; color: var(--c-text); }
.header-user .hu-dept { font-size: .72rem; color: var(--c-text-muted); font-weight: 600; }
.header-user .hu-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-teal));
  color: #fff; display: grid; place-items: center;
  font-size: .85rem; font-weight: 800;
}

@media (max-width: 1000px) {
  .header-user {
    margin-left: auto;
    order: 3;
    border-left: 0;
    padding-left: 0;
  }
  .header-user .hu-info { display: none; }
}

@media (max-width: 720px) {
  .auth-card { padding: 24px 20px; }
  .auth-side { max-width: 460px; }
  .auth-main { padding: 6px 16px 40px; }
}
