/* Dark funnel — one-to-one with the reference (pdf-scanner-red.fnlfx.com/pdf-7) */

:root {
  --bg: #121214;
  --surface: #232327;
  --surface-2: #303036;
  --text: #ffffff;
  --body: #c9c9ce;
  --muted: #a1a1aa;
  --blue: #0a7aff;
  --star: #ff9f0a;
  --separator: #303036;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Explicit display rules below would otherwise override the hidden attribute */
[hidden] { display: none !important; }

/* The window itself never scrolls — body is the scroll container, one
   viewport tall (same trick as the reference). In-app browsers (Telegram,
   Instagram, FB) collapse their toolbar on window scroll; with an inner
   scroller the chrome stays expanded and opaque, and page content can't
   slide behind it. */
html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page {
  max-width: 430px;
  margin: 0 auto;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

/* ===== Hero video ===== */
.hero-video video {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #111;
}

/* ===== Sticky app bar (icon + title + single CTA) =====
   Rounded top corners + negative margin make it read as a card
   overlapping the video, like a media-player sheet. */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  margin-top: -22px;
  padding: 18px 20px 16px;
  padding-top: calc(18px + env(safe-area-inset-top));
  transition: border-radius 0.2s ease;
}

/* Flatten the card corners while pinned to the viewport top */
.app-bar--stuck { border-radius: 0; }

.app-bar__row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.app-bar__icon {
  width: 114px;
  height: 114px;
  border-radius: 26px;
  flex-shrink: 0;
}

.app-bar__title { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.app-bar__sub { font-size: 15px; color: var(--muted); margin-top: 4px; }

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
  margin-top: 16px;
  border: none;
  border-radius: 29px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.cta-btn:active { opacity: 0.8; }

/* ===== Editors' Choice badge ===== */
.badge-section {
  text-align: center;
  margin-top: 18px;
  padding: 0 20px;
}

.badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
}

.laurel {
  font-size: 22px;
  filter: grayscale(1) brightness(1.8);
}

.laurel--left { transform: scaleX(-1); }

.badge-stars {
  color: var(--star);
  font-size: 13px;
  letter-spacing: 3px;
  margin-top: 4px;
}

.lead {
  font-size: 15px;
  color: var(--body);
  text-align: center;
  margin: 14px 20px 0;
}

/* ===== Hero phones image ===== */
.hero-phones {
  display: block;
  width: calc(100% - 40px);
  margin: 24px auto 0;
  border-radius: 16px;
}

/* ===== Sections ===== */
.section { margin-top: 34px; padding: 0 20px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 14px; }

/* ===== About chips ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.about-text { font-size: 16px; color: var(--body); margin-top: 14px; }
.price-line { font-size: 16px; color: var(--text); margin-top: 16px; }
.price-line a { color: var(--blue); }

/* ===== Carousels (Embla) ===== */
.embla-viewport { overflow: hidden; cursor: grab; }
.embla-viewport:active { cursor: grabbing; }
.embla-container { display: flex; margin-left: -14px; }
.embla-slide { flex: 0 0 87%; min-width: 0; padding-left: 14px; }

/* ===== Key features ===== */
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 12px 18px;
  height: 100%;
}
.feature-card img {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: var(--surface-2);
}
.feature-card .f-label { font-size: 14px; color: var(--muted); margin-top: 14px; padding: 0 4px; }
.feature-card h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.2px; margin-top: 2px; padding: 0 4px; }
.feature-card p { font-size: 16px; color: var(--body); margin-top: 8px; padding: 0 4px; }

/* ===== Rating & reviews ===== */
.rating-block { display: flex; align-items: center; gap: 20px; }

.rating-score { text-align: center; }
.rating-score__num { font-size: 52px; font-weight: 800; line-height: 1; display: block; }
.rating-score__of { font-size: 14px; color: var(--muted); }

.rating-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.rating-bars .bar { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.rating-bars .bar span { display: block; height: 100%; background: #d8d8dc; border-radius: 2px; }
.rating-count { font-size: 13px; color: var(--muted); text-align: right; margin-top: 8px; }

.reviews-embla { margin-top: 18px; }

.review-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  height: 100%;
}

.review-card h3 { font-size: 17px; font-weight: 700; }
.review-card .stars { color: var(--star); font-size: 12px; letter-spacing: 2px; }
.review-card .reviewer { color: var(--muted); font-size: 13px; margin-left: 6px; }
.review-card .review-meta { margin-top: 6px; }
.review-card p { font-size: 15px; color: var(--body); margin-top: 10px; }

/* ===== Information ===== */
.info-rows > div { padding: 8px 0; }
.info-rows .label { font-size: 13px; color: var(--muted); }
.info-rows .value { font-size: 15px; margin-top: 2px; }
.info-links { display: flex; justify-content: center; gap: 40px; margin-top: 18px; }
.info-links a { color: var(--blue); font-size: 14px; text-decoration: underline; }

/* ===== Cancel page tabs ===== */
.cancel-tabs { display: flex; gap: 10px; margin: 18px 20px 0; }

.cancel-tab {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.cancel-tab--active { background: #fff; color: #000; border-color: #fff; }

/* ===== Legal pages ===== */
.legal .section-title { margin-top: 4px; }
.legal-meta { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.legal h2 { font-size: 17px; font-weight: 700; margin: 22px 0 6px; }
.legal p { font-size: 15px; color: var(--body); margin-top: 8px; }
.legal a { color: var(--blue); }

/* ===== Legal footer ===== */
.legal-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 26px;
  padding: 0 20px;
}
.legal-footer a { color: var(--blue); text-decoration: underline; }
.legal-footer p + p { margin-top: 8px; }

/* ===== Payment page ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 8px 0 0 12px;
  font-size: 30px;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}

.pay-hero { text-align: center; margin-top: 4px; padding: 0 20px; }
.pay-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.accent { color: var(--blue); }
.pay-sub { margin-top: 12px; font-size: 15px; color: var(--muted); }
.pay-sub strong { color: var(--text); }
.pay-terms { margin-top: 12px; font-size: 15px; color: var(--muted); }
.pay-terms strong { color: var(--text); }

.payment-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px;
  text-align: left;
}

.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  margin-bottom: 16px;
}

.field-input::placeholder { color: var(--muted); }
.field-input:focus { outline: none; border-color: var(--blue); }

#payment-element { margin-bottom: 16px; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 26px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.btn-primary, .btn-dark { background: var(--blue); color: #fff; }
.btn-primary:active, .btn-dark:active { opacity: 0.8; }

.error-message { color: #ff453a; font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

.cta-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.cta-note strong { color: var(--text); }

.footer {
  margin-top: 32px;
  padding: 20px 20px 0;
  border-top: 1px solid var(--separator);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.footer a { color: var(--blue); text-decoration: none; margin: 0 8px; }
.footer p { margin-top: 10px; }

/* ===== Download page ===== */
.success-hero { text-align: center; padding: 24px 20px 0; }
.success-hero__emoji { font-size: 56px; }
.success-hero h1 { font-size: 26px; font-weight: 800; margin-top: 12px; }
.success-hero p { color: var(--muted); margin-top: 8px; font-size: 15px; }

.cta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-top: 20px;
  padding: 0 20px;
}
.cta-block .cta-note { margin-top: 0; }

.app-icon--small { width: 72px; height: 72px; border-radius: 16px; display: block; }

.steps { margin-top: 8px; }

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
}

.step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step h3 { font-size: 15px; margin-bottom: 2px; }
.step p { color: var(--muted); }

.user-email-chip {
  display: inline-block;
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  word-break: break-all;
}

/* ===== Demo banner ===== */
#demo-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ff9500;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}

.spinner {
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Pricing (Paddle) ===== */
.billing-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}
.billing-toggle button {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.billing-toggle button.is-active { background: #fff; color: #000; }

.tier-cards { display: flex; flex-direction: column; gap: 14px; }

.tier-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 18px;
}
.tier-card--featured { border-color: var(--blue); }
.tier-card__name { font-size: 19px; font-weight: 700; }
.tier-card__desc { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tier-card__price { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin-top: 12px; }
.tier-card__price small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.tier-card__trial { font-size: 13px; color: var(--muted); margin-top: 4px; min-height: 18px; }
.tier-card__features {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  color: var(--body);
}
.tier-card__features li::before { content: '✓'; color: var(--blue); font-weight: 700; margin-right: 8px; }
.tier-card .btn { margin-top: 16px; }
.tier-card .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ===== Error banner (Paddle misconfigured / failed to load) ===== */
#error-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ff453a;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}
