/* === 4 rəqəmli PIN kilidi (telefon üslubu) === */
#pinLockGate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#pinLockGate.is-visible {
  display: flex;
}

.pin-lock-shell {
  width: min(100%, 340px);
  text-align: center;
  animation: pinFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pinFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pin-lock-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.pin-lock-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.pin-lock-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.55);
  min-height: 20px;
}

.pin-lock-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 36px;
}

.pin-lock-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(248, 250, 252, 0.35);
  background: transparent;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-lock-dot.filled {
  background: #f8fafc;
  border-color: #f8fafc;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(248, 250, 252, 0.35);
}

.pin-lock-dots.shake {
  animation: pinShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes pinShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

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

.pin-lock-key {
  aspect-ratio: 1;
  max-height: 72px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.pin-lock-key:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pin-lock-key:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.18);
}

.pin-lock-key--action {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(248, 250, 252, 0.7);
  background: transparent;
}

.pin-lock-key--action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pin-lock-error {
  margin-top: 16px;
  font-size: 13px;
  color: #fca5a5;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pin-lock-error.is-visible {
  opacity: 1;
}

/* === Sazlamalar: PIN bölməsi === */
.pin-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.pin-settings-row:last-of-type {
  border-bottom: none;
}

.pin-settings-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pin-settings-label strong {
  font-size: 14px;
  color: #0f172a;
}

.pin-settings-label span {
  font-size: 12px;
  color: #64748b;
}

.pin-settings-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 8px;
}

.pin-settings-status--on {
  background: #dcfce7;
  color: #166534;
}

.pin-settings-status--off {
  background: #f1f5f9;
  color: #64748b;
}

.pin-settings-status--warn {
  background: #fef3c7;
  color: #92400e;
}

.pin-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.pin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pin-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.pin-toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-toggle input:checked + .pin-toggle-slider {
  background: #2563eb;
}

.pin-toggle input:checked + .pin-toggle-slider::before {
  transform: translateX(20px);
}

.pin-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

body[data-ui-theme="midnight"] .pin-settings-label strong,
body[data-ui-theme="graphite"] .pin-settings-label strong {
  color: #e2e8f0;
}

body[data-ui-theme="midnight"] .pin-settings-label span,
body[data-ui-theme="graphite"] .pin-settings-label span {
  color: #94a3b8;
}

body[data-ui-theme="midnight"] .pin-settings-row,
body[data-ui-theme="graphite"] .pin-settings-row {
  border-bottom-color: rgba(255,255,255,.08);
}

/* === Ekran kilidi səhifəsi === */
.pin-lock-settings-page {
  padding-bottom: 24px;
}

.pin-lock-settings-shell {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.pin-lock-settings-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pin-lock-settings-head h2 {
  margin: 0 0 4px;
  font-size: clamp(22px, 3vw, 28px);
  color: #0f172a;
}

.pin-max-attempts-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-max-attempts-input {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  text-align: center;
}

.pin-toggle--sm {
  width: 42px;
  height: 24px;
}

.pin-toggle--sm .pin-toggle-slider::before {
  width: 18px;
  height: 18px;
}

.pin-toggle--sm input:checked + .pin-toggle-slider::before {
  transform: translateX(18px);
}

/* === Admin modal (Yetkilər) === */
.pin-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.pin-admin-card {
  position: relative;
  width: min(100%, 440px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.pin-admin-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.pin-admin-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #0f172a;
}

.pin-admin-target {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
  word-break: break-all;
}

.pin-admin-info {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.pin-admin-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: #334155;
}

.pin-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pin-admin-global {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.pin-admin-global h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #0f172a;
}

.pin-admin-global-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.pin-admin-info-row--hint {
  justify-content: flex-start;
}

.pin-admin-info-row--hint small {
  font-size: 12px;
  color: #64748b;
}

body[data-ui-theme="midnight"] .pin-admin-global,
body[data-ui-theme="graphite"] .pin-admin-global {
  border-top-color: rgba(255,255,255,.1);
}

body[data-ui-theme="midnight"] .pin-admin-global h4,
body[data-ui-theme="graphite"] .pin-admin-global h4 {
  color: #f1f5f9;
}

body[data-ui-theme="midnight"] .pin-admin-card,
body[data-ui-theme="graphite"] .pin-admin-card {
  background: #1e293b;
  border-color: rgba(255,255,255,.1);
}

body[data-ui-theme="midnight"] .pin-admin-card h3,
body[data-ui-theme="graphite"] .pin-admin-card h3 {
  color: #f1f5f9;
}

body[data-ui-theme="midnight"] .pin-lock-settings-head h2,
body[data-ui-theme="graphite"] .pin-lock-settings-head h2 {
  color: #f1f5f9;
}

/* === Toast bildirişi === */
.kv-pin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 100020;
  max-width: min(92vw, 360px);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.kv-pin-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.kv-pin-toast.is-success {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

.kv-pin-toast.is-error {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
