/* Sign-in popup. Entirely plain markup — no iframe, no app bundle — so it
   opens instantly and the logged-in app is never rendered inside it. Uses
   the same design tokens as the rest of the site (css/tokens.css) so the
   popup reads as part of the marketing page. */

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out), visibility 0s linear 0.25s;
}

.login-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s var(--ease-out);
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(10px) saturate(140%);
}

.login-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7), 0 0 60px var(--primary-glow);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.login-modal.is-open .login-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.login-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.login-modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.login-modal-body {
  padding: 34px 32px 28px;
}

@media (max-width: 520px) {
  .login-modal-body {
    padding: 30px 22px 24px;
  }
}

.login-modal-title {
  font-size: 25px;
  letter-spacing: var(--tracking-tight);
}

.login-modal-lede {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.login-form[hidden] {
  display: none;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.login-field input {
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.login-error {
  display: none;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  color: var(--critical);
  font-size: 13.5px;
  line-height: 1.5;
}

.login-error.is-visible {
  display: block;
}

.login-submit {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
}

.login-submit[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.login-link {
  justify-self: center;
  background: none;
  border: 0;
  padding: 2px 4px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
}

.login-link:hover {
  color: var(--text);
}

.login-modal-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
}

.login-modal-foot a {
  color: var(--text-dim);
}

.login-modal-foot a:hover {
  color: var(--primary-light);
}
