/* Login overlay built by auth.js. Theme variables come from :root in index.html. */
.auth-overlay {
  position: fixed; inset: 0; z-index: 90; display: flex; overflow-y: auto; overscroll-behavior: contain;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bg); color: var(--text);
}
.auth-overlay[hidden] { display: none; }
.auth-overlay, .auth-overlay * { box-sizing: border-box; }

/* margin: auto centers the card but lets it scroll from the top when the keyboard shrinks the screen */
.auth-card {
  width: 100%; max-width: 360px; margin: auto; padding: 22px 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; text-align: center;
}
.auth-icon { margin-bottom: 8px; font-size: 2.2rem; line-height: 1; }
.auth-title { display: block; margin: 0 0 6px; font-size: 1.25rem; }
.auth-intro { margin: 0 0 20px; color: var(--muted); font-size: 0.85rem; line-height: 1.45; }

.auth-form { text-align: left; }
.auth-field { margin-bottom: 14px; }
.auth-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.8rem; }
.auth-input {
  display: block; width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text);
  font-family: inherit; font-size: max(16px, 1rem);
}
.auth-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.auth-pw-box { position: relative; }
.auth-pw-box .auth-input { padding-right: 88px; }
.auth-toggle {
  position: absolute; top: 3px; right: 3px; bottom: 3px; min-width: 36px; padding: 0 12px;
  border-radius: 6px; background: none; color: var(--accent); font-size: 0.82rem; font-weight: 600;
}
.auth-toggle:focus-visible { outline: 2px solid var(--accent); }

.auth-submit {
  display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 10px 14px;
  background: var(--accent); color: var(--bg); font-size: 1rem; font-weight: 700;
}
.auth-submit:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.auth-submit:disabled { opacity: 0.65; cursor: progress; }

.auth-error { min-height: 1.3em; margin: 12px 0 0; color: var(--loss); font-size: 0.85rem; line-height: 1.3; text-align: center; }
