/* ── Password Gate Overlay ─────────────────────────────────────────── */

#pw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2744 0%, #1a3a5c 50%, #0f2744 100%);
  padding: 20px;
}

/* ── Card Box ── */
.pw-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

/* ── Emblem / Lock Icon ── */
.pw-emblem {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.pw-emblem svg {
  width: 40px;
  height: 40px;
}

/* ── Heading ── */
.pw-box h2 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

/* ── Panel shared text ── */
#login-panel p,
#forgot-panel p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── Password field wrapper ── */
.pw-field-wrap {
  position: relative;
  margin-bottom: 12px;
}

.pw-field-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 44px 11px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.pw-field-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.pw-field-wrap input:focus {
  border-color: #60a5fa;
}

#pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  color: #fff;
}

#pw-toggle:hover {
  opacity: 1;
}

/* ── Email input (forgot panel) ── */
#forgot-email {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

#forgot-email::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

#forgot-email:focus {
  border-color: #60a5fa;
}

/* ── Primary buttons ── */
#pw-btn,
#forgot-submit {
  width: 100%;
  padding: 12px;
  background: #1d6fbf;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 12px;
}

#pw-btn:hover,
#forgot-submit:hover {
  background: #2563eb;
}

#pw-btn:active,
#forgot-submit:active {
  transform: scale(0.98);
}

#forgot-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Error message ── */
#pw-error {
  display: none;
  color: #f87171;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

/* ── Forgot password link ── */
.pw-forgot {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
}

.pw-forgot:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Back button ── */
.back-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
  display: block;
  margin-top: 4px;
}

.back-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Forgot message ── */
#forgot-msg {
  display: none;
  font-size: 0.82rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ── Footer ── */
.pw-footer {
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

/* ── Forgot panel hidden by default ── */
#forgot-panel {
  display: none;
}

/* ── Shake animation for wrong password ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .pw-box {
    padding: 32px 24px 24px;
  }

  .pw-box h2 {
    font-size: 1.3rem;
  }
}
