/* Littlest Dreamer — premium pricing modal + return-flow toasts.
   Matches the auth modal pattern (bottom-sheet on mobile, centred
   on desktop) and design-system tokens (sage, cream, DM Sans,
   Playfair for the headline). */

.lr-bill-overlay {
  position: fixed;
  inset: 0;
  /* Flat scrim instead of backdrop-filter — see lr-auth.css for why
     blur on a full-viewport overlay sitting over a scrolling modal
     pegs the GPU and reads as scroll lag. */
  background: rgba(45,36,28,0.62);
  z-index: 10000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overscroll-behavior: contain;
}
.lr-bill-overlay.is-open { display: flex; }

body.lr-bill-open { overflow: hidden; overscroll-behavior: none; }
html:has(body.lr-bill-open) { overflow: hidden; }

@media (min-width: 640px) {
  .lr-bill-overlay { align-items: center; padding: 24px; }
}

.lr-bill-modal {
  position: relative;
  background: var(--warm-white, #fdfbff);
  color: var(--charcoal, #1a1a18);
  width: 100%;
  max-width: 460px;
  border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(28px + var(--lr-nav-clear));
  box-shadow: 0 -8px 40px rgba(0,0,0,0.22);
  font-family: 'DM Sans', sans-serif;
  max-height: calc(92vh - var(--lr-nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 640px) {
  .lr-bill-modal {
    border-radius: 22px;
    padding: 30px 30px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  }
}

.lr-bill-handle {
  width: 40px; height: 4px;
  background: var(--border, #e0deef);
  border-radius: 4px;
  margin: -10px auto 14px;
}
@media (min-width: 640px) { .lr-bill-handle { display: none; } }

.lr-bill-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted, #75726d);
  cursor: pointer;
  display: none;
}
@media (min-width: 640px) { .lr-bill-close { display: block; } }

.lr-bill-header { text-align: center; margin-bottom: 16px; }
.lr-bill-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-dark, #4a4a8c);
  background: rgba(74,74,140,0.08);
  padding: 5px 12px;
  border-radius: 50px;
  margin-bottom: 12px;
}
.lr-bill-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--charcoal, #1a1a18);
}
.lr-bill-subtitle {
  font-size: 14px;
  color: var(--muted, #75726d);
  line-height: 1.5;
  margin: 0;
}

.lr-bill-features {
  list-style: none;
  padding: 16px 16px;
  margin: 16px 0 18px;
  display: grid;
  gap: 14px;
  background: rgba(74,74,140,0.04);
  border: 1px solid rgba(74,74,140,0.08);
  border-radius: 14px;
}
.lr-bill-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--charcoal, #1a1a18);
  line-height: 1.4;
}
.lr-bill-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sage-dark, #4a4a8c);
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
/* Stack label above body so the eye lands on the feature name first
   and the supporting copy reads as a separate line — previous
   inline-bold layout had labels and descriptions blending together
   into a wall of text. */
.lr-bill-feat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lr-bill-feat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal, #1a1a18);
  letter-spacing: 0.005em;
  line-height: 1.3;
}
.lr-bill-feat-body {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted, #75726d);
  line-height: 1.45;
}

.lr-bill-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--border, #e0deef);
  border-radius: 50px;
  margin-bottom: 14px;
}
.lr-bill-toggle-btn {
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--muted, #75726d);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
}
.lr-bill-toggle-btn.is-active {
  background: var(--warm-white, #fdfbff);
  color: var(--charcoal, #1a1a18);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.lr-bill-toggle-save {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sage-dark, #4a4a8c);
  background: rgba(74,74,140,0.12);
  padding: 3px 8px;
  border-radius: 50px;
  line-height: 1;
}
.lr-bill-toggle-btn:not(.is-active) .lr-bill-toggle-save {
  color: var(--muted, #75726d);
  background: rgba(0,0,0,0.05);
}

.lr-bill-price {
  text-align: center;
  margin: 10px 0 18px;
}
.lr-bill-price-big {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--charcoal, #1a1a18);
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.lr-bill-price-unit {
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--muted, #75726d);
}
.lr-bill-price-fine {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted, #75726d);
}

.lr-bill-cta {
  width: 100%;
  min-height: 50px;
  background: var(--sage-dark, #4a4a8c);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.lr-bill-cta:hover:not(:disabled) { background: #3a3a72; }
.lr-bill-cta:active:not(:disabled) { transform: scale(0.99); }
.lr-bill-cta:disabled { opacity: 0.65; cursor: not-allowed; }

.lr-bill-legal {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted, #75726d);
  text-align: center;
}

.lr-bill-legal-links {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.lr-bill-legal-links a {
  color: var(--charcoal, #1a1a18);
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}
.lr-bill-legal-links a:hover { opacity: 0.8; }
.lr-bill-legal-links span { color: var(--muted, #75726d); }

.lr-bill-error {
  background: #fcebe4;
  color: #8a3a1a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.4;
}
.lr-bill-error.is-visible { display: block; }

/* ── Return-from-checkout toast host ────────────────────────── */
#lr-bill-toast-host {
  position: fixed;
  left: 50%;
  bottom: var(--lr-nav-clear);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10010;
  pointer-events: none;
  width: min(92vw, 420px);
}
.lr-bill-toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--charcoal, #1a1a18);
  background: var(--warm-white, #fdfbff);
  border: 1px solid var(--border, #e0deef);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lr-bill-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.lr-bill-toast-ok {
  background: #e4f1e9;
  color: #4a4a8c;
  border-color: rgba(74,74,140,0.18);
}
.lr-bill-toast-info {
  background: #fff7ec;
  color: #6a4a22;
  border-color: rgba(184,122,74,0.18);
}
.lr-bill-toast-action {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.lr-bill-toast-action-msg { flex: 1; min-width: 0; }
.lr-bill-toast-action-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  padding: 10px 12px;
  margin: -10px -12px;
  cursor: pointer;
  min-height: 44px;
}
.lr-bill-toast-action-btn:hover { opacity: 0.75; }

#lr-activating-banner {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -8px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #4a4a8c;
  background: #e4f1e9;
  border: 1px solid rgba(74,74,140,0.18);
  box-shadow: 0 6px 20px rgba(74,74,140,0.12);
  opacity: 0;
  z-index: 10011;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
#lr-activating-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.lr-activating-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(74,74,140,0.25);
  border-top-color: #4a4a8c;
  animation: lr-activating-spin 0.9s linear infinite;
}
@keyframes lr-activating-spin {
  to { transform: rotate(360deg); }
}
