/* ═══════════════════════════════════════════════════════
   Saflio Kiosk — Auth screen styles (PIN pad / provision / checking)
   Dedicated global stylesheet so runtime-injected auth HTML is always styled
   (Astro scoped <style> blocks do NOT apply to innerHTML-injected elements).
   Light theme — matches the register's white canvas + orange accent.
   ═══════════════════════════════════════════════════════ */

.kiosk-auth-shell {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(249,115,22,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(249,115,22,0.08), transparent 55%),
    linear-gradient(160deg, #fffaf5 0%, #ffffff 55%, #fdf1e6 100%);
  position: relative;
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
}

.ka-bg-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ka-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  padding: 1rem;
}

.ka-card {
  background: #ffffff;
  border: 1px solid #f3e6d9;
  border-radius: 28px;
  padding: 2.4rem 2.2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(120,60,20,0.10), 0 2px 8px rgba(120,60,20,0.05);
}
.ka-card-compact {
  padding: 2.2rem 1.8rem 1.6rem;
}

.ka-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f97316;
}
.ka-brand .ka-brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f97316, #f97316);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: #fff;
}

.ka-icon {
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.ka-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  color: #1c1917;
}

.ka-desc {
  font-size: 0.9rem;
  color: #78716c;
  line-height: 1.5;
  margin-bottom: 1.4rem;
}

.ka-device-id-box {
  background: #faf7f4;
  border: 1px solid #f0e6db;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.ka-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a8a29e;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ka-device-id {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  color: #f97316;
  word-break: break-all;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  user-select: all;
}

.ka-copy-btn {
  background: rgba(249,115,22,0.10);
  color: #f97316;
  border: 1px solid rgba(249,115,22,0.25);
  border-radius: 8px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.ka-copy-btn:hover {
  background: rgba(249,115,22,0.18);
}

.ka-steps {
  text-align: left;
  margin-bottom: 1.25rem;
}

.ka-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: #57534e;
  line-height: 1.4;
}
.ka-step strong {
  color: #1c1917;
  font-weight: 600;
}
.ka-step:not(:last-child) {
  border-bottom: 1px solid #f5f0ea;
}

.ka-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(249,115,22,0.12);
  color: #f97316;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ka-enroll-box {
  background: #faf7f4;
  border: 1px solid #f0e6db;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.ka-enroll-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #e7e0d8;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #ffffff;
  color: #1c1917;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.ka-enroll-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

.ka-enroll-note {
  margin-top: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.ka-enroll-note.ka-enroll-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.ka-enroll-btn {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.7rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316, #f97316);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(249,115,22,0.25);
}
.ka-enroll-btn:hover { background: linear-gradient(135deg, #f97316, #ea580c); }
.ka-enroll-btn:disabled { opacity: 0.55; }

.ka-enroll-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.ka-enroll-row .ka-secondary-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.ka-enroll-row .ka-secondary-btn:hover { filter: brightness(0.97); }

.ka-refresh-btn,
.ka-bio-btn {
  width: 100%;
  padding: 0.8rem;
  margin-top: 0.5rem;
  border: 1.5px solid rgba(249,115,22,0.55);
  border-radius: 14px;
  background: rgba(249,115,22,0.10);
  color: #fdba74;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.ka-bio-btn:hover { background: rgba(249,115,22,0.2); border-color: #f97316; }
.ka-bio-btn:disabled { opacity: 0.6; cursor: default; }
html[data-theme="light"] .ka-bio-btn { color: #c2410c; border-color: rgba(249,115,22,0.6); background: rgba(249,115,22,0.08); }
.ka-unlock-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316, #f97316);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: 0 6px 18px rgba(249,115,22,0.28);
}
.ka-refresh-btn:hover,
.ka-unlock-btn:hover {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 8px 22px rgba(249,115,22,0.34);
}
.ka-unlock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── PIN Entry ── */

.ka-pin-row {
  margin-bottom: 0.9rem;
}

.ka-pin-input {
  width: 100%;
  max-width: 220px;
  padding: 0.85rem 1rem;
  background: #faf7f4;
  border: 2px solid #ece2d6;
  border-radius: 14px;
  color: #1c1917;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.35em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ka-pin-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249,115,22,0.12);
  background: #ffffff;
}
.ka-pin-input::placeholder {
  color: #d6d0c9;
  letter-spacing: 0.05em;
  font-size: 1rem;
}

.ka-pin-error {
  font-size: 0.82rem;
  color: #dc2626;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: #fef2f2;
  border-radius: 10px;
}

.ka-pin-locked {
  font-size: 0.88rem;
  color: #dc2626;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

/* ── Numpad ── */

.ka-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-width: 280px;
  width: 100%;
}

.ka-num-btn {
  height: 64px;
  border: 1px solid #ece2d6;
  border-radius: 18px;
  background: #ffffff;
  color: #1c1917;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 2px 6px rgba(120,60,20,0.06);
}
.ka-num-btn:hover {
  background: #faf7f4;
  border-color: #f3d9c4;
}
.ka-num-btn:active {
  transform: scale(0.95);
  background: rgba(249,115,22,0.12);
  border-color: #f97316;
}

.ka-num-back {
  font-size: 1.2rem;
  color: #a8a29e;
}

.ka-num-empty {
  height: 64px;
}

.ka-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #f3e6d9;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: ka-spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

.ka-loading-text {
  color: #a8a29e;
  font-size: 0.88rem;
}

@keyframes ka-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  .ka-card {
    padding: 1.6rem 1.25rem;
    border-radius: 22px;
  }
  .ka-card-compact {
    padding: 1.6rem 1rem 1.1rem;
  }
  .ka-icon { font-size: 2.2rem; }
  .ka-title { font-size: 1.3rem; }
  .ka-pin-input { max-width: 190px; font-size: 1.4rem; }
  .ka-num-btn { height: 58px; font-size: 1.25rem; border-radius: 15px; }
  .ka-numpad { max-width: 250px; gap: 0.45rem; }
}

@media (max-height: 700px) {
  .ka-card { padding: 1.3rem 1rem; }
  .ka-icon { font-size: 1.9rem; margin-bottom: 0.35rem; }
  .ka-desc { margin-bottom: 0.8rem; }
  .ka-numpad { gap: 0.4rem; }
  .ka-num-btn { height: 50px; font-size: 1.1rem; border-radius: 12px; }
  .ka-pin-input { padding: 0.6rem 0.75rem; font-size: 1.3rem; }
}

/* ── KIOSK AUTH DARK MODE (shared saflio-theme — matches the rest of Saflio) ── */
html[data-theme="dark"] .kiosk-auth-shell {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(249,115,22,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(249,115,22,0.08), transparent 55%),
    linear-gradient(160deg, #0e0e12 0%, #17171d 55%, #1d1d24 100%);
}
html[data-theme="dark"] .ka-card {
  background: #17171d;
  border-color: #30303a;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .ka-title { color: #f4f4f6; }
html[data-theme="dark"] .ka-desc { color: #b0b0bc; }
html[data-theme="dark"] .ka-device-id-box { background: #26262e; border-color: #30303a; }
html[data-theme="dark"] .ka-label { color: #8f8f9c; }
html[data-theme="dark"] .ka-step { color: #b0b0bc; }
html[data-theme="dark"] .ka-step strong { color: #f4f4f6; }
html[data-theme="dark"] .ka-step:not(:last-child) { border-bottom-color: #26262e; }
html[data-theme="dark"] .ka-enroll-box { background: #26262e; border-color: #30303a; }
html[data-theme="dark"] .ka-enroll-input { background: #0e0e12; border-color: #30303a; color: #f4f4f6; }
html[data-theme="dark"] .ka-enroll-input::placeholder { color: #6b6b78; }
html[data-theme="dark"] .ka-enroll-note { background: rgba(239,68,68,0.12); border-color: #b91c1c; color: #ea580c; }
html[data-theme="dark"] .ka-enroll-note.ka-enroll-ok { background: rgba(16,185,129,0.12); border-color: #047857; color: #34d399; }
html[data-theme="dark"] .ka-pin-input { background: #0e0e12; border-color: #30303a; color: #f4f4f6; }
html[data-theme="dark"] .ka-pin-input:focus { border-color: #f97316; background: #17171d; }
html[data-theme="dark"] .ka-pin-input::placeholder { color: #6b6b78; }
html[data-theme="dark"] .ka-pin-error { background: rgba(239,68,68,0.12); color: #ea580c; }
html[data-theme="dark"] .ka-pin-locked { background: rgba(239,68,68,0.12); border-color: #b91c1c; color: #ea580c; }
html[data-theme="dark"] .ka-num-btn { background: #17171d; border-color: #30303a; color: #f4f4f6; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
html[data-theme="dark"] .ka-num-btn:hover { background: #26262e; border-color: #4a2a1a; }
html[data-theme="dark"] .ka-num-btn:active { background: rgba(249,115,22,0.18); border-color: #f97316; }
html[data-theme="dark"] .ka-num-back { color: #8f8f9c; }
html[data-theme="dark"] .ka-loading-spinner { border-color: #30303a; border-top-color: #f97316; }
html[data-theme="dark"] .ka-loading-text { color: #8f8f9c; }
html[data-theme="dark"] .ka-copy-btn { background: rgba(249,115,22,0.14); }
html[data-theme="dark"] .ka-copy-btn:hover { background: rgba(249,115,22,0.24); }
