/* DZKeyboard — kiosk on-screen keyboard · text + PIN · v2
   Physical keycap depth: each key rests on a 3px shadow shelf.
   Press = key drops 3px flush (shadow collapses, translateY(3px)).
   Dark navy · Barlow · brand green #00e843 accent. */

.dzk-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(2, 5, 10, .60); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .20s ease;
  font-family: 'Barlow', system-ui, sans-serif;
}
.dzk-overlay.show { opacity: 1; pointer-events: auto; }

/* Panel */
.dzk-panel {
  background: #0b1420;
  border-top: 2px solid rgba(0, 232, 67, .18);
  box-shadow: 0 -24px 60px rgba(0, 0, 0, .65);
  padding: 16px clamp(10px, 2.2vw, 32px) calc(20px + env(safe-area-inset-bottom, 0));
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform .24s cubic-bezier(.22, .61, .36, 1);
}
.dzk-overlay.show .dzk-panel { transform: translateY(0); }

/* ── Header (title + preview / dots) ── */
.dzk-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
}
.dzk-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 1.8px;
  color: rgba(0, 232, 67, .6); white-space: nowrap;
}

/* Preview field */
.dzk-preview {
  flex: 1; min-width: 0;
  height: 50px;
  display: flex; align-items: center;
  padding: 0 18px;
  border-radius: 12px;
  background: #060d18;
  border: 1.5px solid rgba(255, 255, 255, .07);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35);
  font-size: 22px; font-weight: 700; color: #e8edf4;
  letter-spacing: .4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color .15s;
}
.dzk-overlay.show .dzk-preview { border-color: rgba(0, 232, 67, .22); }
.dzk-preview .dzk-caret {
  display: inline-block; width: 2px; height: 26px;
  margin-left: 3px; background: #00e843;
  animation: dzk-blink 1s step-end infinite;
  vertical-align: middle;
}
.dzk-preview.empty { color: #2a3a4a; }
@keyframes dzk-blink { 50% { opacity: 0; } }

/* PIN dots row */
.dzk-dots {
  flex: 1; display: flex; align-items: center;
  justify-content: center; gap: 20px; height: 50px;
}
.dzk-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  transition: background .14s ease, border-color .14s ease, transform .14s ease,
              box-shadow .14s ease;
}
.dzk-dot.filled {
  background: #00e843; border-color: #00e843;
  box-shadow: 0 0 14px rgba(0, 232, 67, .55);
  transform: scale(1.12);
  animation: dzk-dot-pop .18s ease-out;
}
@keyframes dzk-dot-pop {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.30); }
  100% { transform: scale(1.12); }
}
.dzk-dot.err { background: #ef4444; border-color: #ef4444; animation: dzk-shake .35s; }
@keyframes dzk-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-7px); }
  75%       { transform: translateX(7px); }
}

/* ── Key rows ── */
.dzk-rows { display: flex; flex-direction: column; gap: clamp(7px, 1vh, 11px); }
.dzk-row  { display: flex; gap: clamp(5px, .65vw, 9px); justify-content: center; }

/* Base key — the shelf shadow creates the physical depth */
.dzk-key {
  flex: 1 1 0; min-width: 0;
  height: clamp(46px, 7.2vh, 66px);
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 11px; cursor: pointer;
  background: #1d2c3f;
  color: #dde4ee;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: clamp(17px, 2.1vh, 22px); font-weight: 700;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* shelf: bottom shadow + top glint */
  box-shadow: 0 3px 0 #09111e, inset 0 1px 0 rgba(255, 255, 255, .055);
  transition: transform .06s ease, box-shadow .06s ease, background .10s ease, color .10s ease;
  touch-action: manipulation;
}
/* Press: key drops into the shelf */
.dzk-key:active,
.dzk-key.dzk-press {
  transform: translateY(3px);
  box-shadow: 0 0 0 #09111e, inset 0 1px 0 rgba(255, 255, 255, .02);
  background: #152233; color: #fff;
}

/* Number row — slightly darker band */
.dzk-row:first-child .dzk-key {
  background: #151f2e;
  box-shadow: 0 3px 0 #080f1a, inset 0 1px 0 rgba(255, 255, 255, .04);
  font-size: clamp(15px, 1.9vh, 20px);
}
.dzk-row:first-child .dzk-key:active,
.dzk-row:first-child .dzk-key.dzk-press {
  transform: translateY(3px);
  box-shadow: 0 0 0 #080f1a;
  background: #0e1927;
}

/* Fn keys: Caps, Del, Space, symbols */
.dzk-key.dzk-fn {
  background: #111927;
  color: #7b8a9a;
  font-size: clamp(12px, 1.6vh, 16px); font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  box-shadow: 0 3px 0 #070d17, inset 0 1px 0 rgba(255, 255, 255, .03);
}
.dzk-key.dzk-fn:active,
.dzk-key.dzk-fn.dzk-press {
  transform: translateY(3px);
  box-shadow: 0 0 0 #070d17;
  background: #1a2638; color: #c8d0db;
}

/* Caps: active state — lit green */
.dzk-key.dzk-caps.on {
  background: rgba(0, 232, 67, .10);
  color: #00e843;
  box-shadow: 0 3px 0 #030e07,
              inset 0 0 0 1.5px rgba(0, 232, 67, .50),
              inset 0 1px 0 rgba(255, 255, 255, .03);
}
.dzk-key.dzk-caps.on:active,
.dzk-key.dzk-caps.on.dzk-press {
  transform: translateY(3px);
  box-shadow: 0 0 0 #030e07, inset 0 0 0 1.5px rgba(0, 232, 67, .40);
  background: rgba(0, 232, 67, .06);
}

/* Space bar */
.dzk-key.dzk-space { flex: 5 1 0; }

/* Delete key */
.dzk-key.dzk-del {
  background: #111927; color: #f87171;
  box-shadow: 0 3px 0 #070d17, inset 0 1px 0 rgba(255, 255, 255, .03);
}
.dzk-key.dzk-del:active,
.dzk-key.dzk-del.dzk-press {
  transform: translateY(3px); box-shadow: 0 0 0 #070d17;
  background: #1c1220;
}

/* Submit key — dark green with brand text */
.dzk-key.dzk-submit {
  flex: 2 1 0;
  background: #004d35; color: #00e843;
  font-weight: 900; font-size: clamp(13px, 1.7vh, 17px);
  text-transform: uppercase; letter-spacing: 1.2px;
  box-shadow: 0 3px 0 #002b1d, inset 0 1px 0 rgba(0, 232, 67, .12);
}
.dzk-key.dzk-submit:active,
.dzk-key.dzk-submit.dzk-press {
  transform: translateY(3px);
  box-shadow: 0 0 0 #002b1d;
  background: #003d2a; color: #33ff6e;
}
.dzk-key.dzk-submit:disabled {
  background: #0f1a24; color: #2a3f30;
  box-shadow: 0 3px 0 #070d10, inset 0 1px 0 rgba(255, 255, 255, .02);
  cursor: default;
}
.dzk-key.dzk-submit:disabled:active { transform: none; }

/* ── PIN pad sizing ── */
.dzk-pad .dzk-key {
  height: clamp(56px, 9.2vh, 80px);
  font-size: clamp(24px, 3.2vh, 32px); font-weight: 700;
}
.dzk-pad .dzk-row { gap: clamp(9px, 1.1vw, 15px); }
