/* ==========================================================================
   ElectOrchestrator — access gate
   Sign in, create an account, wait for approval. Covers the studio until the
   account is approved; public/js/auth.js drives it.
   ========================================================================== */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  padding: 24px;
  background: var(--bg-app);
  overflow-y: auto;
}

body[data-auth="approved"] .auth-gate {
  display: none;
}

/* Nothing behind the gate is visible or reachable until the account is in. */
body:not([data-auth="approved"]) .app {
  visibility: hidden;
}

/* margin: auto centres it, but unlike align-items it never pushes a card
   taller than the screen off the top, where it could not be scrolled to. */
.auth-card {
  margin: auto;
  width: min(380px, 100%);
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-md);
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 14px;
  font-weight: 600;
}

.auth-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-card__lead {
  margin: 0 0 20px;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.5;
}

.auth-card__lead strong {
  color: var(--fg-2);
  font-weight: 500;
}

/* One view at a time. */
.auth-view {
  display: none;
}

.auth-gate[data-view="loading"] .auth-view[data-for="loading"],
.auth-gate[data-view="signin"] .auth-view[data-for="signin"],
.auth-gate[data-view="pending"] .auth-view[data-for="pending"],
.auth-gate[data-view="error"] .auth-view[data-for="error"] {
  display: block;
}

/* Sign in and create account share one form. */
.auth-form[data-mode="signin"] [data-mode="signup"],
.auth-form[data-mode="signup"] [data-mode="signin"] {
  display: none;
}

.auth-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-3);
  font-size: 13px;
}

.auth-wait--soft {
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-subtle);
}

.auth-google,
.auth-submit {
  width: 100%;
  height: 36px;
}

.auth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--fg-4);
  font-size: 12px;
}

.auth-sep::before,
.auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-field {
  display: block;
  margin-bottom: 12px;
}

.auth-field__label {
  display: block;
  margin-bottom: 5px;
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.auth-msg {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 12.5px;
  line-height: 1.45;
}

.auth-msg[data-tone="info"] {
  background: var(--success-soft);
  color: var(--success-text);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-3);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.auth-link:hover {
  color: var(--fg);
  text-decoration: underline;
}
