/*
  credits.css — the sign-in / out-of-credits modal and the "N credits left"
  badge, shared by the AI Backtester, the AI research chat and the Tax Filing
  Assistant.

  Self-contained on purpose: these three pages have three different design
  systems (backtester/style.css, the chat's own scale, the tax page's --ffc-*
  tokens), so nothing here inherits from any of them and every class is
  ff-cred-* to stay out of their way.
*/

.ff-cred-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Above the first-visit newsletter popup (#nlOverlay, z-index 100010).
     This modal is the answer to a click the reader just made, so it has to
     win against anything that opened on its own. */
  z-index: 100020;
  animation: ff-cred-fade 0.15s ease-out;
}

@keyframes ff-cred-fade { from { opacity: 0; } to { opacity: 1; } }

.ff-cred-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 24px 22px;
  text-align: center;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
  position: relative;
  animation: ff-cred-pop 0.18s ease-out;
}

@keyframes ff-cred-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.ff-cred-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.ff-cred-close:hover { background: #f3f4f6; color: #374151; }

.ff-cred-icon { font-size: 34px; line-height: 1; margin-bottom: 8px; }

.ff-cred-modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.ff-cred-modal p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
}

.ff-cred-perk {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 16px;
}

.ff-cred-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: #2c7be5;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.ff-cred-google:hover { background: #1e5bb8; color: #fff; }
.ff-cred-google svg { background: #fff; border-radius: 3px; padding: 2px; }

.ff-cred-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.ff-cred-contacts { display: grid; gap: 8px; margin-top: 4px; }

.ff-cred-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
.ff-cred-contact:hover { background: #f9fafb; color: #1f2937; }
.ff-cred-contact.wa { border-color: #86efac; color: #15803d; }
.ff-cred-contact.wa:hover { background: #f0fdf4; color: #15803d; }

.ff-cred-used {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 16px;
}

/* ── The inline "N of 10 AI credits left" badge ───────────────────────────── */
.ff-cred-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-decoration: none;
  line-height: 1.5;
}
.ff-cred-badge:hover { text-decoration: none; }
.ff-cred-badge.low { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.ff-cred-badge.out { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.ff-cred-badge.anon { background: #f3f4f6; border-color: #d1d5db; color: #4b5563; }
.ff-cred-badge a { color: inherit; text-decoration: underline; }

@media (max-width: 480px) {
  .ff-cred-modal { padding: 22px 18px 18px; }
  .ff-cred-modal h3 { font-size: 18px; }
}
