/* Paddle inline checkout on /buy. Loaded only by buy/index.html, so css/styles.css and its
   cache key on the other pages stay untouched. The page adds .is-inline to the card only while
   checkoutProvider is "paddle"; in Lemon mode none of these rules apply. */

/* .checkout-landing-pulse (display: flex) and the fallback link (.button, display: inline-flex)
   set a display in styles.css, which beats the hidden attribute. */
.checkout-landing-pulse[hidden],
.checkout-landing-fallback[hidden],
.checkout-landing-fallback-note[hidden],
.checkout-landing-frame[hidden],
.checkout-landing-success[hidden],
.checkout-landing-totals[hidden],
.checkout-landing-keys[hidden],
.checkout-landing-success p[hidden],
.checkout-landing-top .language-switcher[hidden] {
  display: none;
}

.checkout-landing-card.is-inline {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.checkout-landing-card.is-inline .checkout-landing-copy {
  justify-content: flex-start;
  min-height: 0;
  padding: clamp(24px, 4vw, 44px);
}

.checkout-landing-card.is-inline .checkout-landing-copy h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
}

.checkout-landing-card.is-inline .checkout-landing-copy > p:not(.kicker) {
  margin-top: 16px;
  font-size: 16px;
}

/* Paddle sizes the frame itself. Width, border and background come from here instead of a
   frameStyle string, so the page keeps style-src 'self'. */
.checkout-landing-frame {
  margin-top: 28px;
  min-height: 450px;
}

.checkout-landing-frame iframe {
  display: block;
  width: 100%;
  min-width: 312px;
  border: 0;
  background: transparent;
}

/* Paddle.js injects this rule as an inline <style>, which style-src 'self' blocks. It keeps a
   scrollbar from flashing inside the frame while Paddle resizes it. */
.checkout-landing-frame .paddle-frame-inline::-webkit-scrollbar {
  display: none;
}

.checkout-landing-success {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-bright);
}

.checkout-landing-success:focus {
  outline: none;
}

.checkout-landing-success:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.checkout-landing-success h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.checkout-landing-success p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* The license key after payment: one row per key, the key in a monospace font that may wrap,
   the copy button next to it and below it on narrow screens. */
.checkout-landing-keys {
  margin-top: 16px;
}

.checkout-landing-keys h3 {
  margin: 0;
  font-size: 15px;
}

.checkout-landing-keys ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.checkout-landing-keys li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.checkout-landing-keys code {
  flex: 1 1 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  overflow-wrap: anywhere;
  user-select: all;
}

.checkout-landing-keys p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.checkout-landing-keys button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.checkout-landing-keys button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkout-landing-totals {
  display: grid;
  gap: 10px;
  margin: 0 0 28px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.checkout-landing-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.checkout-landing-totals div:last-child {
  color: var(--paper-bright);
  font-size: 15px;
  font-weight: 700;
}

.checkout-landing-totals dt,
.checkout-landing-totals dd {
  margin: 0;
}

/* Amounts keep their own direction inside the right-to-left Arabic page. */
.checkout-landing-totals bdi,
.checkout-landing-summary strong bdi {
  unicode-bidi: isolate;
}

/* Paddle needs at least 312 px for the form. On a 375 px phone the outer, card and copy
   padding together leave 331 px. */
@media (max-width: 760px) {
  .checkout-inline .checkout-landing {
    padding: 10px;
  }

  .checkout-landing-card.is-inline {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }

  .checkout-landing-card.is-inline .checkout-landing-copy {
    padding: 22px 4px 12px;
  }
}

/* Only the very narrowest phones go below 312 px; there the frame may shrink. */
@media (max-width: 359px) {
  .checkout-landing-frame iframe {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-landing-success {
    transition: none;
  }
}

/* Logo on one side, language switcher on the other. The switcher sits above the card and the
   Paddle frame, so its menu is never covered. RTL flips the row and the menu (styles.css). */
.checkout-landing-top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.checkout-landing-keynote {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.5;
}

.checkout-landing-keynote + .checkout-landing-legal {
  margin-top: 8px;
}
