/*
 * app-paywall.css — post-login subscription gate.
 *
 * Same overlay mechanics as app-login.css's splash: a fixed,
 * full-viewport surface that sits ABOVE the page chrome whenever the
 * signed-in user has no access (trial expired and no paid plan). It
 * stacks below the login splash (z-index 200) so an unauthenticated
 * user always sees login first; the paywall is z-index 190.
 *
 * Visual language intentionally mirrors the login splash (slate
 * gradient, bar buttons, underline rules) so the two gates feel like
 * one product, not two.
 */

.app-paywall {
  position: fixed;
  inset: 0;
  z-index: 190;
  background:
    radial-gradient(circle at top, rgba(74, 222, 128, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(15, 22, 18, 1), rgba(8, 12, 10, 1));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  overflow-y: auto;
}

.app-paywall[hidden] {
  display: none;
}

body.app-paywall-active {
  overflow: hidden;
}

.app-paywall-card {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: auto 0;
}

.app-paywall-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-paywall-head img {
  height: 54px;
  width: auto;
  margin: 0 auto 0.25rem;
}

.app-paywall-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f2f7f2;
}

.app-paywall-sub {
  font-size: 0.95rem;
  color: #9fb1a3;
  line-height: 1.5;
}

.app-paywall-rule {
  border: 0;
  border-top: 1px solid rgba(116, 143, 126, 0.34);
  margin: 0;
}

/* Trial countdown — shown when the user still HAS access via trial.
 * This is a slim banner injected at the top of the page chrome, not
 * the full overlay (the overlay only appears once access is gone). */
.app-trial-banner {
  position: sticky;
  top: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #07110c;
  background: linear-gradient(90deg, #83e35d, #b8f59b);
  text-align: center;
}

.app-trial-banner[hidden] {
  display: none;
}

.app-trial-banner button {
  background: #07110c;
  color: #b8f59b;
  border: 0;
  padding: 0.3rem 0.8rem;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 3px;
}

.app-paywall-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 760px) {
  .app-paywall-plans {
    grid-template-columns: 1fr;
  }
}

.app-paywall-plan {
  border: 1px solid rgba(116, 143, 126, 0.34);
  background: rgba(13, 24, 17, 0.6);
  padding: 1.1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-paywall-plan.is-featured {
  border-color: #83e35d;
  box-shadow: 0 0 0 1px rgba(131, 227, 93, 0.4) inset;
}

.app-paywall-plan-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f2f7f2;
}

.app-paywall-plan-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: #83e35d;
}

.app-paywall-plan-note {
  font-size: 0.8rem;
  color: #9fb1a3;
  line-height: 1.45;
  min-height: 2.3em;
}

.app-paywall-plan .paypal-button-host {
  margin-top: auto;
  /* Vertical PayPal layout stacks PayPal + Debit/Credit Card, so
   * reserve enough height to avoid a layout jump when the SDK
   * finishes rendering its iframe. */
  min-height: 96px;
}

.app-paywall-status {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #9fb1a3;
  min-height: 1.2em;
}

.app-paywall-status[data-state='error'] {
  color: #ec6f65;
}

.app-paywall-status[data-state='success'] {
  color: #83e35d;
}

.app-paywall-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.app-paywall-foot button {
  background: none;
  border: 0;
  color: #9fb1a3;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
}

.app-paywall-foot button:hover {
  color: #f2f7f2;
}

/* "Back to app" — app-paywall.js un-hides it only when the user has
 * access and is just previewing plans, so a trial / early-upgrade
 * visitor is never trapped on the paywall. Left-aligned, understated;
 * the card's flex gap spaces it from the header. */
.app-paywall-back {
  align-self: flex-start;
  background: none;
  border: 1px solid rgba(159, 177, 163, 0.4);
  color: #cfe0d4;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.app-paywall-back:hover {
  border-color: #83e35d;
  color: #ffffff;
}

.app-paywall-back[hidden] {
  display: none;
}
