/* Sprout — the sign-in and upgrade windows, shared by the app (index.html) and the landing page (waitlist/).
   Their colours are set on the windows themselves, so this file never changes the page behind them: the landing
   page keeps its own look, and the app's light/dark choice still wins inside the app ([data-theme]). */
.auth-modal-backdrop, #upgradeModal {
  --surface: #ffffff; --surface-2: #f2f4f2; --text: #141a16; --muted: #6c7670; --line: #e3e7e4;
  --accent-2: color-mix(in srgb, var(--accent, #2e6b46) 70%, #ffffff); --accent-3: color-mix(in srgb, var(--accent, #2e6b46) 55%, #000000);
  --accent-soft: color-mix(in srgb, var(--accent, #2e6b46) 12%, transparent);
  --hero: linear-gradient(160deg, color-mix(in srgb, var(--accent, #2e6b46) 85%, #3a8a5c), var(--accent-3));
  --radius: 24px; --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --dur-1: 120ms; --dur-2: 150ms; --dur-3: 200ms;
  color: var(--text); font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; font-size: 14px;
  letter-spacing: normal; line-height: 1.45; text-align: left;
}
/* Dark: the app's own choice, or the system's on the landing page (which has no theme switch) */
[data-theme="dark"] .auth-modal-backdrop, [data-theme="dark"] #upgradeModal {
  --surface: #181f1b; --surface-2: #202923; --text: #e9efea; --muted: #8d9a92; --line: #29332d;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .auth-modal-backdrop, html:not([data-theme]) #upgradeModal {
    --surface: #181f1b; --surface-2: #202923; --text: #e9efea; --muted: #8d9a92; --line: #29332d;
  }
}
.auth-modal-backdrop *, #upgradeModal * { box-sizing: border-box; }
.auth-modal-backdrop h2, .auth-modal-backdrop h3, .auth-modal-backdrop p, #upgradeModal h3, #upgradeModal p { margin: 0; }
.auth-modal-backdrop button, .auth-modal-backdrop input, #upgradeModal button { font: inherit; color: inherit; }

/* The upgrade window's frame and buttons, for pages that don't load styles.css (the landing page) */
#upgradeModal.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: grid; place-items: center; z-index: 1000; padding: 16px; }
#upgradeModal .modal-card { background: var(--surface); border-radius: var(--radius); padding: 24px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
#upgradeModal .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 600; cursor: pointer; white-space: nowrap; }
#upgradeModal .btn-primary { background: var(--hero); color: #fff; }
#upgradeModal .btn-secondary { background: var(--surface-2); color: var(--text); }
#upgradeModal .btn-outline { background: transparent; border: 1.5px solid var(--accent-3); color: var(--text); }

/* ---------- Upgrade Modal & Feature Gating ---------- */
.upgrade-card { max-width: 560px; text-align: center; padding: 32px 24px; }
.upgrade-icon { font-size: 34px; display: block; margin-bottom: 8px; color: var(--accent, #4ade80); }
.upgrade-sub { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.upgrade-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; text-align: left; }
.upgrade-opt { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; justify-content: space-between; }
.upgrade-opt.current { border-color: var(--accent, #4ade80); }
.upgrade-opt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.upgrade-opt-head strong { font-size: 16px; }
.upgrade-opt-head span { font-size: 14px; font-weight: 700; color: var(--accent, #4ade80); }
.upgrade-opt p { font-size: 13px; color: var(--muted); line-height: 1.4; margin-bottom: 16px; }
.upgrade-actions { display: flex; justify-content: center; gap: 12px; }
.upgrade-note { font-size: 11px; color: var(--muted); margin-top: 16px; }

/* ---------- Production Authentication Modal ---------- */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}
.auth-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.auth-card {
  position: relative;
  background: var(--surface, #141b16);
  border: 1px solid var(--line, #232e26);
  border-radius: 24px;
  max-width: 420px;
  width: 100%;
  padding: 32px 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  color: var(--text, #f0fdf4);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-modal-backdrop.is-active .auth-card {
  transform: translateY(0) scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: 0;
  color: var(--muted, #86a390);
  font-size: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-modal-close:hover {
  background: var(--surface-2, #1b261f);
  color: var(--text, #f0fdf4);
}

.auth-head {
  text-align: center;
  margin-bottom: 24px;
}
.auth-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.auth-head p {
  font-size: 13px;
  color: var(--muted, #86a390);
  line-height: 1.45;
}

/* Prominent Google OAuth Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}
.btn-google:active {
  background: #eeeeee;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 20px;
  color: var(--muted, #86a390);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line, #232e26);
}
.auth-divider span {
  padding: 0 12px;
  letter-spacing: 0.02em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f0fdf4);
}
.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.auth-field input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2, #1b261f);
  border: 1px solid var(--line, #232e26);
  border-radius: 8px;
  color: var(--text, #f0fdf4);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent, #4ade80);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

.auth-btn-primary {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent, #4ade80);
  color: #0d120f;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.auth-btn-primary:hover {
  opacity: 0.92;
}
.auth-btn-primary:active {
  transform: scale(0.99);
}
.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.auth-success-banner {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.auth-link-subtle {
  font-size: 13px;
  color: var(--muted, #86a390);
  text-decoration: none;
  transition: color 0.15s ease;
}
.auth-link-subtle:hover {
  color: var(--accent, #4ade80);
}

.auth-link-accent {
  color: var(--accent, #4ade80);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.auth-link-accent:hover {
  opacity: 0.85;
}

.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted, #86a390);
  display: flex;
  justify-content: center;
  gap: 8px;
}

.avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent, #4ade80);
}
