/* Sign-in modal + shared email sign-in form. Self-contained (theme-var fallbacks baked in) so
   it can be linked on ANY page — base.html templates AND the standalone landing page, which
   does not load dark-theme.css. Markup: partials/_signin_modal.html + _email_signin.html;
   behaviour: static/js/auth.js. A modal (not a hover dropdown) because the 6-digit flow is
   multi-step — the user leaves to read their email and comes back. */
.signin-modal[hidden] { display: none; }
.signin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.signin-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}
.signin-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary, #0f0f0f);
  border: 1px solid var(--border-color, #252525);
  border-radius: 12px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.signin-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted, #5a5a5a);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.signin-modal-close:hover { color: var(--text-primary, #e8e8e8); }
.signin-modal-title { margin: 0 0 4px; color: var(--text-primary, #e8e8e8); font-size: 20px; }
.signin-modal-sub { margin: 0 0 16px; color: var(--text-secondary, #909090); font-size: 13px; line-height: 1.5; }
.signin-modal-or {
  text-align: center;
  margin: 14px 0 12px;
  color: var(--text-muted, #5a5a5a);
  font-size: 12px;
  font-weight: 700;
}
.signin-modal-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  color: #04170f;
  text-decoration: none;
}

/* Primary button for the sign-in component (kept here so the partial styles itself on every
   page, including the landing page which has no dark-theme.css). */
.btn-submit {
  background: var(--accent-green, #00d47e);
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 16px;
}
.btn-submit:hover { background: #00b86e; }
.btn-submit:disabled { background: var(--text-muted, #5a5a5a); cursor: not-allowed; }

/* Shared email sign-in form (used inline on /contribute and inside the modal everywhere). */
.email-signin-form { display: grid; gap: 10px; }
/* Form buttons sit in a grid row next to their input — no stacking margin, dark label for
   contrast on the green. */
.email-signin-form .btn-submit { margin-top: 0; color: #04170f; }
.email-signin-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.email-signin-form input {
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg-primary, #0a0a0a);
  border: 1px solid var(--border-color, #252525);
  border-radius: 6px;
  color: var(--text-primary, #e8e8e8);
  font-size: 14px;
}
.email-signin-form input:focus { outline: none; border-color: var(--accent-green, #00d47e); }
.email-code-row { display: grid; grid-template-columns: minmax(120px, 160px) auto; gap: 10px; }
.email-code-row[hidden] { display: none; }
.signin-status { min-height: 20px; color: var(--text-muted, #5a5a5a); font-size: 13px; font-weight: 700; }
.signin-status.success { color: var(--accent-green, #00d47e); }
.signin-status.error { color: var(--accent-red, #e05050); }
@media (max-width: 640px) {
  .email-signin-row,
  .email-code-row { grid-template-columns: 1fr; }
}
