/* =============================================================
   Staff PIN gate (js/gate.js) — quotation.html + invoice.html
   ============================================================= */

/* Until unlocked, nothing but the gate is shown. */
html.rmw-locked body > :not(#rmwGate) { display: none !important; }
html.rmw-locked,
html.rmw-locked body { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: var(--em-950);
  background-image: var(--marble-deep);
  background-size: cover;
  background-position: center;
  overflow-y: auto;
}

.gate-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 40px 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
  color: var(--ink);
}

.gate-mark { width: 148px; height: auto; margin-bottom: 28px; }

.gate-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gate-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 8px 0 28px;
}

.gate-input {
  width: 100%;
  max-width: 240px;
  height: 64px;
  padding: 0 0 0 0.6em; /* balances the trailing letter-spacing */
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--em-50);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.6em;
  text-align: center;
  color: var(--em-950);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gate-input:focus {
  outline: none;
  border-color: var(--em-900);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(3, 51, 35, 0.1);
}

.gate-error {
  min-height: 22px;
  margin: 10px 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
}

.gate-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 8px;
  background: var(--em-900);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}
.gate-btn:hover { background: var(--em-800); }

.gate-back {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.gate-back:hover { color: var(--em-900); }

.gate-card.is-error .gate-input { border-color: var(--danger); }
.gate-card.is-error { animation: gate-shake .4s ease; }

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@media print {
  .gate { display: none !important; }
}
