/* ── Zawadi Platform Console — Login Overlay ─────────────────────────────
   Glass-morphism overlay rendered over the blurred dashboard shell.
   Matches the main Zawadi SMS brand tokens exactly.
   ────────────────────────────────────────────────────────────────────────── */

/* Blur the entire shell when unauthenticated */
.shell.auth-locked {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

/* Full-viewport overlay */
#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 30, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#login-overlay.hidden {
  display: none;
}

/* Glass card */
.login-glass {
  width: 360px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

/* Card header */
.lg-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
}

.lg-mark {
  width: 34px;
  height: 34px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lg-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.lg-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

/* Card body */
.lg-body {
  padding: 22px 24px;
}

.lg-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.48);
  margin-bottom: 6px;
}

.lg-row {
  margin-bottom: 16px;
}

.lg-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.17);
  padding: 9px 13px;
  font-size: 13px;
  color: #fff;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.lg-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.lg-input:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
}

.lg-password-wrap {
  position: relative;
}

.lg-password-wrap .lg-input {
  padding-right: 44px;
}

.lg-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.lg-password-toggle:hover,
.lg-password-toggle:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.lg-password-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lg-password-toggle .icon-eye-off {
  display: none;
}

.lg-password-toggle.is-visible .icon-eye {
  display: none;
}

.lg-password-toggle.is-visible .icon-eye-off {
  display: block;
}

/* Role toggle */
.lg-roles {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.lg-role-btn {
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s;
}

.lg-role-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
}

.lg-role-btn.active {
  background: var(--brand);
  border-color: var(--brand-bright);
  color: #fff;
}

/* Sign-in button */
.lg-submit {
  width: 100%;
  background: var(--brand);
  border: 1px solid var(--brand-bright);
  color: #fff;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
  letter-spacing: 0.02em;
  transition: background 0.15s;
}

.lg-submit:hover {
  background: var(--brand-dark);
}

.lg-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Error message */
.lg-error {
  font-size: 12px;
  color: #fca5a5;
  margin-bottom: 14px;
  display: none;
  padding: 8px 10px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.lg-error.show {
  display: block;
}

/* Session expiry — amber tone to distinguish from a wrong-password error */
.lg-error.session-expired {
  color: #fcd34d;
  background: rgba(180, 120, 0, 0.18);
  border-color: rgba(251, 191, 36, 0.35);
}

/* Footer */
.lg-footer {
  padding: 12px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

.lg-footer-link {
  color: var(--teal);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* Logged-in user chip in topbar */
#user-chip {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px 12px;
  cursor: default;
}

#user-chip.visible {
  display: flex;
}

.user-role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

#btn-logout {
  display: none;
}

#btn-logout.visible {
  display: inline-block;
}

/* Section fully locked — used as defence-in-depth for restricted roles */
.access-locked {
  opacity: 0.35;
  pointer-events: none;
  position: relative;
}
