/* spakit/spa.css — chrome styles consumed by the SPA helpers in
 * api.js / chrome.js / modals.js / settings.js / landing.js / sub.js.
 * Layered on top of motif tokens; do not duplicate motif variables
 * here — reach for var(--space-*), var(--color-*), etc. when adding.
 *
 * Pattern: each block below corresponds to one helper or render
 * function. Apps can override any selector in their own app.css
 * loaded after this file.
 */

/* Tier banner ------------------------------------------------------------- */
.tier-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.tier-banner.free {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
}
.tier-banner.warn {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}
.tier-banner.paid {
  background: #ecfccb;
  border: 1px solid #a3e635;
  color: #365314;
}
.tier-banner .spacer { flex: 1; }
.tier-banner .btn { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.tier-banner .link-btn { font-size: 0.85rem !important; }

/* Modal (centered popover with backdrop) ---------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  padding: 1rem;
  animation: spakit-fadeIn 120ms ease;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.4rem 1.5rem 1.4rem;
  max-width: 26rem;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  animation: spakit-popIn 140ms ease;
}
.modal-card.ok   { border-top: 6px solid #166534; }
.modal-card.miss { border-top: 6px solid #b91c1c; }
.modal-card .result-line { font-size: 1.1rem; margin-top: 0.2rem; }
.modal-card .next-row { margin-top: 1rem; }
.modal-card .next-row button { min-width: 8rem; padding: 0.7rem 1.2rem; }
@keyframes spakit-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spakit-popIn {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Settings cards ---------------------------------------------------------- */
.settings-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 0.8rem 0;
}
.settings-card h3 {
  margin: 0 0 0.4rem;
  color: #2e4a25;
  font-size: 1.05rem;
}
.settings-card p { margin: 0.4rem 0; }
.settings-card code {
  background: #f3f4f6; padding: 0.05rem 0.35rem;
  border-radius: 3px; font-size: 0.88em;
}

/* Activating screen (post-LS-checkout poll) ------------------------------- */
.activating {
  max-width: 28rem;
  margin: 4rem auto;
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.activating .lede { color: #2e4a25; font-weight: 500; }
.activating::before {
  content: '';
  display: block;
  width: 28px; height: 28px;
  margin: 0 auto 1rem;
  border: 3px solid #e5e7eb;
  border-top-color: #4f7c40;
  border-radius: 50%;
  animation: spakit-spin 800ms linear infinite;
}
@keyframes spakit-spin {
  to { transform: rotate(360deg); }
}

/* Flashbar ---------------------------------------------------------------- */
.flashbar {
  position: fixed; bottom: 1rem; left: 50%;
  transform: translateX(-50%) translateY(2rem);
  background: #2e4a25; color: #fff;
  padding: 0.5rem 1rem; border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.flashbar.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Landing page (unauth) ---------------------------------------------------
 *
 * The hero is motif's .hero component (rounded green band, white
 * text). spakit only adds the typography sizing here; padding +
 * background + foreground come from motif. */
.landing { max-width: 44rem; margin: 1rem auto 0; }
.landing .hero h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}
.landing .hero .lede {
  /* No explicit color — inherits from motif's .hero (white on the
     green band by default; dark on .hero-light). */
  font-size: 1.05rem;
  max-width: 32rem;
  margin: 0 auto 1.6rem;
  opacity: 0.92;
}
.cta-row {
  display: flex; gap: 0.8rem;
  justify-content: center; flex-wrap: wrap;
  margin: 1.2rem 0 0.6rem;
}
.btn-large {
  font: inherit;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  font-weight: 500;
  background: #fff; color: #2e4a25;
  border: 2px solid #4f7c40;
  border-radius: 6px;
  cursor: pointer;
  min-width: 10rem;
}
.btn-large:hover { background: #ecfccb; }
.btn-large.primary {
  background: #4f7c40; color: #fff;
}
.btn-large.primary:hover { background: #3e6431; }

/* Primary CTA on the green hero band: invert to white-bg / dark-text
 * so the call-to-action stands out against the same-colored band.
 * Same pattern pouch's marketing pages use. */
.hero .btn-large.primary {
  background: #fff;
  color: #2e4a25;
  border-color: #fff;
}
.hero .btn-large.primary:hover {
  background: rgba(255, 255, 255, 0.9);
}
.hero .btn-large {
  /* The non-primary "Try free" button keeps its outline style but
   * needs visible borders against the green band. */
  border-color: rgba(255, 255, 255, 0.65);
  background: transparent;
  color: #fff;
}
.hero .btn-large:hover {
  background: rgba(255, 255, 255, 0.12);
}
/* The sign-in line lives inside the hero so colors come from
 * motif's .hero a / .hero p inheritance rules. */
.sign-in { font-size: 0.9rem; margin-top: 1rem; opacity: 0.85; }

.lp-section {
  margin: 2rem 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid #e5e7eb;
}
.lp-section h2 { font-size: 1.2rem; margin-bottom: 0.7rem; }
.lp-section.quiet { border: 0; padding-top: 0; }
.steps, .who-list { padding-left: 1.4rem; }
.steps li, .who-list li { margin: 0.4rem 0; }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.6rem;
}
.plan {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.2rem 1.2rem 1rem;
  text-align: center;
}
.plan.featured { border-color: #4f7c40; box-shadow: 0 2px 8px rgba(79,124,64,0.12); }
.plan h3 { font-size: 1rem; margin: 0; color: #4f7c40; text-transform: uppercase; letter-spacing: 0.04em; }
.plan .price {
  font-size: 2rem; font-weight: 600; color: #2e4a25;
  margin: 0.4rem 0 0.6rem;
}
.plan .price .per { font-size: 0.9rem; font-weight: 400; color: #777; }
.plan ul {
  list-style: none; padding: 0; margin: 0.4rem 0 1rem;
  font-size: 0.92rem; color: #444;
}
.plan ul li { padding: 0.25rem 0; border-bottom: 1px dashed #e5e7eb; }
.plan ul li:last-child { border-bottom: 0; }
.plan button { width: 100%; }

.lp-footer {
  text-align: center;
  color: #777;
  font-size: 0.85rem;
  margin: 2rem 0 1rem;
}
.lp-footer a { color: #4f7c40; text-decoration: none; }
.lp-footer a:hover { text-decoration: underline; }

/* Generic icon helper hook (sized inline by callers; this is just
 * the shared default). */
.icon {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentColor;
}

/* Low-emphasis link button (used in tier banner and reveal-row) ----------- */
.link-btn {
  background: transparent !important;
  color: #6b7280 !important;
  border: 0 !important;
  padding: 0.4rem 0.6rem !important;
  font-size: 0.9rem !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #d1d5db;
  cursor: pointer;
}
.link-btn:hover {
  color: #2e4a25 !important;
  text-decoration-color: #4f7c40;
}
