/* ============================================================
   css/views/login.css
   ------------------------------------------------------------
   Login_framework split-pane login/registration/waitlist styles,
   ported for the Agent Vector portal and SCOPED under #loginGate so
   the dashboard (variables.css / layout.css) is never touched. The
   framework's :root tokens are redefined on #loginGate (never :root)
   and the global `* {}` / `body {}` reset from core.css is dropped.
   Only email + password and the waitlist screen are used: the OAuth
   and 2FA-OTC styles are intentionally omitted (no backend).
   Version marker: v4.45.0
   ============================================================ */

#loginGate {
  /* Framework tokens re-scoped to the gate; emerald accent to match AX. */
  --bg-primary: #0f1115;
  --bg-secondary: #15181f;
  --bg-tertiary: #232a34;
  --text-primary: #f4f7fb;
  --text-secondary: #9aa4b2;
  --text-tertiary: #6b7686;
  --accent-primary: #10b981;
  --accent-secondary: #34d399;
  --border-color: rgba(255, 255, 255, 0.10);
  --hover-bg: #2b333f;

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  overflow: hidden;
  background: #0f1115;
}

#loginGate .login-page {
  height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: 460px 1fr;
  overflow: hidden;
  background: var(--bg-primary);
}

/* --- Left pane (form) --- */
#loginGate .login-left {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

#loginGate .login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-primary);
  margin-bottom: 48px;
  width: fit-content;
  user-select: none;
  transition: opacity 0.2s;
}

#loginGate .login-logo:hover { opacity: 0.85; }

#loginGate .login-logo span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#loginGate .login-form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}

#loginGate .login-form-container h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

#loginGate .login-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

/* --- Notice banner slot (errors injected here) --- */
#loginGate #auth-notice-banner .auth-notice {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

#loginGate #auth-notice-banner .auth-notice.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

#loginGate #auth-notice-banner .auth-notice.info {
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.30);
  color: #6ee7b7;
}

/* --- Form fields --- */
#loginGate .login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

#loginGate .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#loginGate .form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

#loginGate .field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#loginGate .form-field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

#loginGate .form-field input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

#loginGate .form-field input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

#loginGate .password-wrapper {
  position: relative;
  width: 100%;
}

#loginGate .password-wrapper input { padding-right: 42px; }

#loginGate .toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s;
}

#loginGate .toggle-pw:hover { color: var(--text-primary); }

/* --- Submit button --- */
#loginGate .btn-primary {
  background: var(--accent-primary);
  color: #05130d;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

#loginGate .btn-primary:hover {
  background: var(--accent-secondary);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

#loginGate .btn-primary:active { transform: translateY(0); }
#loginGate .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

#loginGate .btn-full {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: 8px;
}

/* --- Footer copy --- */
#loginGate .signup-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

#loginGate .signup-link a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

#loginGate .signup-link a:hover { text-decoration: underline; }

#loginGate .terms-text {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-top: 24px;
  opacity: 0.7;
}

#loginGate .terms-text a { color: inherit; text-decoration: underline; }
#loginGate .terms-text a:hover { color: var(--text-primary); }

/* --- Right pane (quote) --- */
#loginGate .login-right {
  position: relative;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#loginGate .login-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

#loginGate .login-right::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(16, 185, 129, 0.07) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#loginGate .login-quote-container {
  position: relative;
  z-index: 1;
  max-width: 520px;
  padding: 40px;
}

#loginGate .quote-mark {
  font-size: 96px;
  font-family: Georgia, serif;
  line-height: 1;
  color: var(--accent-primary);
  opacity: 0.3;
  user-select: none;
  margin-bottom: -16px;
}

#loginGate blockquote {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  border: none;
  padding: 0;
  margin: 0 0 32px;
}

#loginGate .quote-author { display: flex; align-items: center; gap: 14px; }

#loginGate .quote-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #05130d;
  flex-shrink: 0;
  user-select: none;
}

#loginGate .quote-avatar.blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
}

#loginGate .quote-author div { display: flex; flex-direction: column; gap: 2px; }
#loginGate .quote-author strong { font-size: 15px; font-weight: 600; color: var(--text-primary); }
#loginGate .quote-author span { font-size: 13px; color: var(--text-secondary); }

/* ============================================================
   WAITLIST / PENDING APPROVAL SCREEN (getWaitingHtml)
   ============================================================ */
#loginGate .waitlist-card {
  background: #22262e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
  position: relative;
  box-sizing: border-box;
}

#loginGate .waitlist-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
  text-align: center;
}

#loginGate .waitlist-card-text {
  font-size: 13px;
  color: #94A3B8;
  line-height: 1.6;
  margin: 0 auto 20px;
  text-align: center;
}

#loginGate .waitlist-check-circle {
  width: 68px;
  height: 68px;
  font-size: 30px;
  border: 1px solid #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.25);
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#loginGate .waitlist-status-pill {
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.15);
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 14px;
  text-transform: uppercase;
}

#loginGate .waitlist-email-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  margin-bottom: 20px;
}

#loginGate .waitlist-email-box-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

#loginGate .waitlist-email-box-val {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  font-family: monospace;
}

#loginGate .waitlist-info-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 20px;
}

#loginGate .waitlist-info-header {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#loginGate .waitlist-info-text {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

#loginGate .btn-waitlist-submit {
  background: var(--accent-primary);
  color: #05130d;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#loginGate .btn-waitlist-submit:hover { background: var(--accent-secondary); }
#loginGate .btn-waitlist-submit:active { transform: scale(0.99); }
#loginGate .btn-waitlist-submit:disabled { opacity: 0.6; cursor: not-allowed; }

#loginGate .btn-waitlist-secondary {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  margin-top: 10px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#loginGate .btn-waitlist-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

#loginGate .waitlist-terms-notice {
  margin-top: 24px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

#loginGate .waitlist-terms-notice a { color: #94a3b8; text-decoration: underline; }

/* --- Toasts (LoginView.showToast) : kept global so they float above the gate --- */
.login-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.login-toast {
  pointer-events: auto;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: #232a34;
  color: #f4f7fb;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: loginToastIn 0.25s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}

.login-toast.info { border-left: 4px solid #3b82f6; }
.login-toast.success { border-left: 4px solid #10b981; }
.login-toast.warning { border-left: 4px solid #f59e0b; }
.login-toast.error { border-left: 4px solid #ef4444; }

@keyframes loginToastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  #loginGate .login-page { grid-template-columns: 1fr; }
  #loginGate .login-right { display: none; }
  #loginGate .login-left { padding: 24px; }
}
