/* Operator PIN overlay + nav chip. Loaded on every authenticated page.
   Uses the shared design tokens from /design-system/colors_and_type.css. */

html.op-locked { overflow: hidden; }

/* ─── Overlay shell ─────────────────────────────────────────────────────────── */
.op-overlay {
  position: fixed; inset: 0;
  /* Bind to the viewport, not the (possibly overflowing) document. A fixed
     element with inset:0 resolves its width against the initial containing
     block, which expands if any page content scrolls sideways — that would
     stretch this lock screen and shove the card off-centre. Pinning the width
     to 100vw + clipping keeps the PIN pad screen-width no matter what's behind. */
  width: 100vw; max-width: 100vw;
  overflow: hidden;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.op-overlay.show { display: flex; }

.op-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(183,155,88,0.18), transparent 60%),
    linear-gradient(160deg, #0c0c0d 0%, #161617 60%, #0a0a0a 100%);
}

.op-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.98);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-elevated, 0 12px 48px rgba(0,0,0,0.4));
  padding: 32px clamp(20px, 5vw, 40px) 28px;
  text-align: center;
  animation: op-pop var(--dur-base, 0.4s) var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
}
@keyframes op-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.op-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
}
.op-mark { width: 30px; height: 30px; }
.op-brand-word {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500; font-size: 19px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--near-black, #0A0A0A);
}

.op-loading { padding: 40px 0; color: var(--fg-muted, #575760); }

/* ─── Headings ──────────────────────────────────────────────────────────────── */
.op-eyebrow {
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold, #B79B58);
  margin-bottom: 10px;
}
.op-title {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500; font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1; letter-spacing: -0.02em;
  color: var(--near-black, #0A0A0A);
  margin: 0 0 8px;
}
.op-title em { font-style: italic; color: var(--gold, #B79B58); font-weight: 400; }
.op-sub {
  font-size: 13.5px; line-height: 1.5;
  color: var(--fg-muted, #575760);
  margin: 0 auto 20px; max-width: 320px;
}

/* ─── PIN dots ──────────────────────────────────────────────────────────────── */
.op-dots {
  display: flex; justify-content: center; gap: 16px;
  margin: 4px 0 14px;
}
.op-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-strong, rgba(0,0,0,0.18));
  background: transparent;
  transition: background var(--dur-fast,0.2s) var(--ease-out), border-color var(--dur-fast,0.2s);
}
.op-dots span.filled {
  background: var(--gold, #B79B58);
  border-color: var(--gold, #B79B58);
}
.op-dots.shake { animation: op-shake 0.4s; }
@keyframes op-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.op-error {
  min-height: 18px;
  font-size: 12.5px; font-weight: 500;
  color: #B91C1C;
  margin-bottom: 8px;
}
.op-error:empty { margin-bottom: 0; }

/* ─── Keypad ────────────────────────────────────────────────────────────────── */
.op-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 300px;
  margin: 0 auto 14px;
}
.op-key {
  font-family: var(--font-body, sans-serif);
  font-size: 26px; font-weight: 500;
  color: var(--near-black, #0A0A0A);
  background: var(--bg-soft, #FAF9F7);
  border: 1.5px solid var(--border, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 8px);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform var(--dur-fast,0.15s) var(--ease-out), background var(--dur-fast,0.15s), border-color var(--dur-fast,0.15s);
}
.op-key:active:not(:disabled) {
  transform: scale(0.95);
  background: var(--gold-subtle, rgba(183,155,88,0.1));
  border-color: var(--gold, #B79B58);
}
.op-key:disabled { opacity: 0.4; cursor: default; }
.op-key-empty { background: transparent; border: none; cursor: default; }
.op-key-back { font-size: 22px; color: var(--fg-muted, #575760); }

/* ─── Links / submit ──────────────────────────────────────────────────────────── */
.op-link {
  background: none; border: none;
  font-family: var(--font-body, sans-serif);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-dark, #9A8145);
  cursor: pointer;
  padding: 8px 12px;
  transition: color var(--dur-fast,0.2s);
}
.op-link:hover { color: var(--gold, #B79B58); text-decoration: underline; }

.op-submit {
  width: 100%;
  margin-top: 4px;
  padding: 13px 22px;
  background: var(--gold, #B79B58);
  color: #fff; border: none;
  border-radius: var(--radius-full, 9999px);
  font-weight: 600; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-fast,0.2s), transform var(--dur-fast,0.2s);
}
.op-submit:hover:not(:disabled) { background: var(--gold-dark, #9A8145); transform: translateY(-1px); }
.op-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Login form ───────────────────────────────────────────────────────────────── */
.op-form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-bottom: 12px; }
.op-field { display: flex; flex-direction: column; gap: 6px; }
.op-field span {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 600; color: var(--fg-faint, #888);
}
.op-field input {
  font-family: var(--font-body, sans-serif);
  font-size: 15px; padding: 12px 14px;
  border: 1.5px solid var(--border-strong, rgba(0,0,0,0.12));
  border-radius: var(--radius-md, 8px);
  background: var(--bg-soft, #FAF9F7);
  color: var(--near-black, #0A0A0A);
  transition: border-color var(--dur-fast,0.2s);
}
.op-field input:focus { outline: none; border-color: var(--gold, #B79B58); background: #fff; }

/* ─── Roster circles ─────────────────────────────────────────────────────────────── */
.op-circles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 10px;
  margin: 4px 0 16px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px;
}
.op-circle {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 6px 2px;
  -webkit-tap-highlight-color: transparent;
}
.op-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body, sans-serif);
  font-size: 20px; font-weight: 600;
  color: #fff;
  background: linear-gradient(150deg, var(--gold-light,#CDBA82), var(--gold-dark,#9A8145));
  box-shadow: var(--shadow-subtle, 0 1px 3px rgba(0,0,0,0.1));
  transition: transform var(--dur-fast,0.18s) var(--ease-out), box-shadow var(--dur-fast,0.18s);
}
.op-circle:active .op-avatar { transform: scale(0.93); }
.op-circle:hover .op-avatar { box-shadow: var(--shadow-gold, 0 8px 24px rgba(183,155,88,0.3)); }
.op-avatar-add {
  background: transparent;
  color: var(--gold-dark, #9A8145);
  border: 2px dashed var(--gold, #B79B58);
  font-size: 28px; font-weight: 400;
}
.op-circle-name {
  font-size: 12px; font-weight: 500;
  color: var(--fg, #222);
  max-width: 88px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── Nav chip (active operator) ──────────────────────────────────────────────────── */
.op-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px;
  background: var(--gold-subtle, rgba(183,155,88,0.1));
  border: 1px solid var(--gold, #B79B58);
  border-radius: var(--radius-full, 9999px);
}
.op-chip-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(150deg, var(--gold-light,#CDBA82), var(--gold-dark,#9A8145));
}
.op-chip-name {
  font-size: 13px; font-weight: 600;
  color: var(--fg-strong, #0A0A0A);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.op-chip-switch {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body, sans-serif);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold-dark, #9A8145);
  padding: 4px 8px;
}
.op-chip-switch:hover { color: var(--gold, #B79B58); }

/* ─── Phone ─────────────────────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .op-overlay { padding: 14px; }
  .op-card { padding: 26px 20px 22px; }
}
