/* Password gate overlay (injected by assets/auth.js) */

#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: var(--paper);
  animation: auth-in 0.3s cubic-bezier(.23, 1, .32, 1);
}
#auth-overlay.auth-fade-out { animation: auth-out 0.35s cubic-bezier(.23, 1, .32, 1) forwards; }
@keyframes auth-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-out { from { opacity: 1; } to { opacity: 0; } }

/* The homepage hero field (assets/hero-field.js), full screen. */
.auth-field-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: clamp(20px, 3vw, 32px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
}

.auth-row { display: flex; gap: 12px; }

.auth-field { position: relative; flex: 1; min-width: 0; }
.auth-field input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  outline: none;
}
.auth-field input::placeholder { color: var(--ink-3); }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.auth-field button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  padding: 6px;
  background: none;
  border: 0;
  color: var(--ink-3);
  cursor: pointer;
}
.auth-field button:hover { color: var(--ink); }

.auth-submit {
  flex-shrink: 0;
  height: 52px;
  padding: 0 22px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: var(--fs-meta);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s cubic-bezier(.23, 1, .32, 1), transform 0.16s cubic-bezier(.23, 1, .32, 1);
}
.auth-submit:active { transform: scale(0.97); }
.auth-submit span { display: inline-block; margin-left: 6px; transition: transform 0.2s cubic-bezier(.23, 1, .32, 1); }
.auth-submit:hover { background: var(--accent); }
.auth-submit:hover span { transform: translateX(3px); }
.auth-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-error { min-height: 1.5em; margin: 8px 0 4px; font-size: var(--fs-meta); color: var(--accent); }
.auth-error:empty { min-height: 0; margin: 0; }

.auth-contact { margin-top: 16px; font-size: var(--fs-meta); color: var(--ink-2); }
#auth-overlay .auth-contact a { color: var(--ink); border-bottom: 0; white-space: nowrap; }
.auth-contact a span { border-bottom: 1px solid var(--accent); }
/* Icon sits on the baseline at cap height, in text colour until hover. */
.auth-contact svg { display: inline-block; width: 0.72em; height: 0.72em; width: 1cap; height: 1cap; margin-right: 0.3em; vertical-align: baseline; transition: color .2s cubic-bezier(.23, 1, .32, 1); }
.auth-contact a:hover svg { color: #0a66c2; }
.auth-contact a:hover span { border-bottom-color: var(--ink); }

@media (max-width: 520px) {
  .auth-row { flex-direction: column; }
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.auth-shake { animation: auth-shake 0.4s ease; }
@media (prefers-reduced-motion: reduce) { .auth-shake { animation: none; } }
