/* Auth overlay — replaces the old PIN overlay; same look, more capability. */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a4f7a, #2196d6);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 9999;
  animation: auth-fade-in 0.2s ease-out;
}
.auth-overlay.hidden { display: none; }
@keyframes auth-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-box {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 2rem 1.75rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.auth-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #0a4f7a, #2196d6);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  color: #fff;
}

.auth-box h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.auth-subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-error {
  background: rgba(232, 112, 76, 0.12);
  color: var(--warm);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: none;
}
.auth-error.visible { display: block; }

.auth-spinner {
  display: none;
  margin: 1rem auto 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}
.auth-spinner.visible { display: block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Primary buttons (biometric + PIN) */
.auth-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.auth-choices.hidden { display: none; }

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.05s ease;
}
.auth-btn-primary {
  background: var(--accent);
  color: #fff;
}
.auth-btn-primary:hover { background: #1a85c2; }
.auth-btn-primary:active { transform: scale(0.98); }
.auth-btn-secondary {
  background: rgba(33, 150, 214, 0.12);
  color: var(--text);
}
.auth-btn-secondary:hover { background: rgba(33, 150, 214, 0.20); }
.auth-btn:disabled { opacity: 0.55; cursor: progress; }
.auth-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem;
  font-family: inherit;
}
.auth-link:hover { color: var(--text); }

/* PIN view (shown only when user picks "PIN" path) */
.auth-pin-view.hidden { display: none; }

.auth-pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin: 0.5rem 0 1.25rem;
}
.auth-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(33, 150, 214, 0.18);
  transition: background 0.15s, transform 0.15s;
}
.auth-pin-dot.filled {
  background: var(--accent);
  transform: scale(1.18);
}

.auth-pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  max-width: 240px;
  margin: 0 auto 0.6rem;
}
.auth-pin-numpad button {
  height: 54px;
  border-radius: 12px;
  border: none;
  background: rgba(33, 150, 214, 0.10);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s ease, transform 0.05s ease;
}
.auth-pin-numpad button:hover { background: rgba(33, 150, 214, 0.18); }
.auth-pin-numpad button:active {
  background: var(--accent);
  color: #fff;
  transform: scale(0.96);
}
.auth-pin-numpad button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.auth-pin-numpad button.auth-pin-del { color: var(--muted); font-size: 1.1rem; }
.auth-pin-numpad span { display: block; }

#auth-back.hidden { display: none; }
#auth-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem;
  margin-top: 0.5rem;
  font-family: inherit;
}
#auth-back:hover { color: var(--text); }

body.auth-locked { overflow: hidden; }

.auth-build-version {
  margin: 1rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .auth-pin-numpad button { background: rgba(255, 255, 255, 0.06); }
  .auth-pin-numpad button:hover { background: rgba(255, 255, 255, 0.10); }
  .auth-pin-dot { background: rgba(255, 255, 255, 0.10); }
  .auth-btn-secondary { background: rgba(255, 255, 255, 0.08); }
  .auth-btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }
}
