/* Lorapok Secure NFC — Firebase Integrated PIN Security Gate */
#secure-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(circle at 50% 25%, rgba(18, 38, 30, 0.98) 0%, rgba(6, 11, 10, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#secure-gate-overlay.gate-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  width: 400px;
  max-width: 100%;
  background: linear-gradient(160deg, #14221c 0%, #0a1311 100%);
  border: 1px solid #335342;
  border-radius: 24px;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.85), 0 0 60px rgba(192, 247, 125, 0.08);
  padding: 34px 28px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c0f77d, transparent);
}

.gate-shield-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  background: #193124;
  border: 1px solid #487254;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--lime, #c0f77d);
  box-shadow: 0 0 25px rgba(192, 247, 125, 0.15);
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: #172b20;
  border: 1px solid #365e43;
  color: #a4e88b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.gate-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ef398;
  box-shadow: 0 0 6px #9ef398;
}

.gate-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: #f0f8f2;
  margin: 0 0 6px;
}

.gate-subtitle {
  font-size: 11px;
  color: #92aba0;
  letter-spacing: 0.8px;
  margin: 0 0 22px;
  line-height: 1.5;
}

.gate-dots-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.gate-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #334d40;
  background: #121c18;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gate-dot.filled {
  background: #c0f77d;
  border-color: #c0f77d;
  box-shadow: 0 0 12px rgba(192, 247, 125, 0.6);
  transform: scale(1.15);
}

.gate-status-msg {
  min-height: 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #8fa69a;
  margin-bottom: 20px;
  transition: color 0.2s ease;
}

.gate-status-msg.error {
  color: #ff8989;
}

.gate-status-msg.success {
  color: #c0f77d;
}

.gate-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto 18px;
}

.gate-key {
  height: 52px;
  border-radius: 12px;
  background: #13221c;
  border: 1px solid #284134;
  color: #eaf5ee;
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.gate-key:hover {
  background: #1a3227;
  border-color: #4b7359;
  color: #c0f77d;
  transform: translateY(-1px);
}

.gate-key:active {
  transform: translateY(1px);
  background: #254737;
}

.gate-key.action-key {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #92ada0;
}

.gate-key.action-key:hover {
  color: #f0f8f2;
}

.gate-footer-note {
  font-size: 9px;
  letter-spacing: 1px;
  color: #5d756a;
  border-top: 1px solid #1c2b24;
  padding-top: 14px;
}

/* Shake animation on invalid PIN */
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.gate-card.shake {
  animation: gateShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #ff8989;
}

/* Topbar Lock/Unlock Trigger */
.gate-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  border: 1px solid #4a6d54;
  background: #162a1e;
  color: #c0f77d;
  transition: all 0.2s ease;
}

.gate-lock-btn:hover {
  background: #244431;
  border-color: #6da27c;
  transform: translateY(-1px);
}

.gate-lock-btn.locked {
  border-color: #7a3c3c;
  background: #2a1616;
  color: #ff9d9d;
}

.gate-lock-btn.locked:hover {
  background: #3b1d1d;
}
