/* Auth overlay — passkey gate. Adapted from dog-food-tracker (chocolate palette).
   CSS variables (--card/--text/--muted/--accent/--warm) are defined in index.html. */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #3a2417, #6b4226);
  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, #3a2417, #6b4226);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  color: #fff;
  font-size: 2rem;
}

.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(200, 80, 60, 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); } }

.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: #b06a2e; }
.auth-btn-primary:active { transform: scale(0.98); }
.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); }

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;
}
