/* PayPicks marketing site — shared styles.
   Design tokens mirror the app theme (lib/theme/app_colors.dart) and /p/index.html. */

:root {
  color-scheme: light dark;

  --indigo: #6366F1;
  --indigo-deep: #4F46E5;
  --navy: #1E3F8F;
  --emerald: #10B981;

  --bg: #F3F8FF;
  --grad-top: #F3F8FF;
  --grad-bottom: #D1EFF5;
  --surface: #FFFFFF;
  --soft: #EFF6FF;
  --border: #DDE7F0;
  --ink: #0F172A;
  --muted: #64748B;
  --wordmark: #1E3F8F;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);
  --header-bg: rgba(243, 248, 255, 0.85);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-brand: "M PLUS Rounded 1c", var(--font-body);

  --container: 72rem;
  --prose: 70ch;
  --radius: 12px;
  --radius-lg: 20px;
  --section-pad: clamp(3.5rem, 8vw, 7rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F172A;
    --grad-top: #16213A;
    --grad-bottom: #0F172A;
    --surface: #1E293B;
    --soft: #172136;
    --border: #334155;
    --ink: #E2E8F0;
    --muted: #94A3B8;
    --wordmark: #D9E8FF;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(15, 23, 42, 0.85);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }

h1 { font-size: clamp(2rem, 4.5vw + 0.6rem, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.4vw + 0.6rem, 2.25rem); font-weight: 800; }
h3 { font-size: clamp(1.1rem, 1vw + 0.7rem, 1.3rem); font-weight: 700; }

p { margin: 0.5em 0; }

a { color: var(--indigo-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

@media (prefers-color-scheme: dark) {
  a { color: #A5B4FC; }
}

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: min(100% - clamp(2rem, 6vw, 3rem), var(--container));
  margin-inline: auto;
}

.lede {
  color: var(--muted);
  font-size: clamp(1rem, 0.6vw + 0.85rem, 1.2rem);
  max-width: 46em;
}

.section {
  padding-block: var(--section-pad);
  scroll-margin-top: 5rem;
}

.section-head {
  max-width: 46em;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.band {
  background: linear-gradient(180deg, var(--grad-top), var(--grad-bottom));
}

.band-soft { background: var(--soft); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--indigo);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding-block: 0.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand img { width: 2.1rem; height: 2.1rem; }

.wordmark {
  font-family: var(--font-brand);
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--wordmark);
  letter-spacing: -0.02em;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 1.5vw, 1.6rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.15rem;
  display: inline-block;
}
.site-nav a:hover { color: var(--indigo-deep); text-decoration: none; }

.site-nav .nav-cta {
  background: var(--indigo);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
}
.site-nav .nav-cta:hover { background: var(--indigo-deep); color: #fff; }

.nav-toggle {
  display: none;
  appearance: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  line-height: 0;
}

.nav-toggle svg { width: 1.35rem; height: 1.35rem; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 767.98px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.75rem clamp(1rem, 4vw, 1.5rem) calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .site-nav.open { display: block; }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav li { border-bottom: 1px solid var(--border); }
  .site-nav li:last-child { border-bottom: none; }

  .site-nav a {
    display: block;
    padding: 0.85rem 0.25rem;
    font-size: 1.05rem;
  }

  .site-nav .nav-cta {
    margin-top: 0.75rem;
    text-align: center;
    padding: 0.85rem 1.2rem;
  }
}

/* ---------- Buttons & store badges ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  min-height: 44px;
  border: none;
  cursor: pointer;
}

.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-deep); color: #fff; text-decoration: none; }

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.store-badge { display: inline-flex; border-radius: 8px; }

.store-badge img {
  display: block;
  height: clamp(44px, 3.4vw + 34px, 52px);
  width: auto;
}

.store-badge[hidden] { display: none; }

.badges-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* ---------- Phone frames ---------- */

.phone {
  background: #0F172A;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: clamp(30px, 9%, 44px);
  padding: clamp(7px, 2%, 11px);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(23px, 7%, 34px);
}

.phone-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1rem, 3vw, 2rem);
}

.phone-pair .phone { max-width: min(44%, 250px); }

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 6vw, 6rem) clamp(3.5rem, 7vw, 6.5rem);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 { max-width: 13em; }

.hero .lede { margin-bottom: 1.75rem; }

.hero .store-badges {
  justify-content: center;
  width: fit-content;
  margin-inline: auto;
}

.hero .badges-note {
  text-align: center;
  width: fit-content;
  margin-inline: auto;
}

.hero-phones {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-phones .phone-front {
  position: relative;
  z-index: 2;
  width: min(85vw, 300px);
}

.hero-phones .phone-back {
  display: none;
  position: absolute;
  z-index: 1;
  width: min(70vw, 264px);
}

/* Tablet portrait & up: layered two-phone composition */
@media (min-width: 640px) {
  .hero-phones { padding-right: clamp(0px, 8vw, 7rem); }

  .hero-phones .phone-back {
    display: block;
    top: clamp(2rem, 5vw, 3.5rem);
    left: calc(50% + 4rem);
    transform: rotate(4deg);
  }
}

/* Two-column hero on tablet landscape & up */
@media (min-width: 960px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .hero-phones { padding-right: 0; }

  .hero-phones .phone-front { width: min(30vw, 320px); }

  .hero-phones .phone-back {
    width: min(25vw, 270px);
    left: auto;
    right: clamp(-2rem, -1vw, 0rem);
    top: 3.5rem;
  }
}

@media (min-width: 1200px) {
  .hero-phones .phone-back { right: 0; }
}

/* Short landscape viewports: keep the hero above the fold */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding-block: 1.5rem 2.5rem; }
  .hero-phones .phone-front { width: min(32vh, 220px); }
  .hero-phones .phone-back { display: none; }
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: 1fr;
}

@media (min-width: 600px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  box-shadow: var(--shadow);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.step h3 { margin-bottom: 0.35rem; }
.step p { color: var(--muted); margin: 0; font-size: 0.97rem; }

/* ---------- Feature sections ---------- */

.feature {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  padding-block: clamp(2.25rem, 5vw, 4.5rem);
}

.feature + .feature { border-top: 1px solid var(--border); }

.feature-media { display: flex; justify-content: center; }

.feature-media .phone { max-width: min(72vw, 280px); }

.feature-copy h3 {
  font-size: clamp(1.35rem, 1.6vw + 0.8rem, 1.9rem);
  font-weight: 800;
}

.feature-copy p { color: var(--muted); max-width: 44em; }

.feature-kicker {
  display: inline-block;
  color: var(--indigo-deep);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  .feature-kicker { color: #A5B4FC; }
}

@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .feature-copy { order: 0; }
  .feature-media { order: 1; }
  .feature:nth-of-type(even) .feature-copy { order: 1; }
  .feature:nth-of-type(even) .feature-media { order: 0; }
  .feature-media .phone { max-width: 280px; }
}

/* ---------- Services grid ---------- */

.services-grid {
  display: grid;
  gap: clamp(0.6rem, 1.5vw, 1rem);
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
}

.service-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(0.8rem, 1.5vw, 1.1rem) 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.service-tile .logo-disc {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-tile .logo-disc img { width: 1.65rem; height: 1.65rem; }

.service-tile span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.services-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1.25rem;
}

/* ---------- Trust section ---------- */

.trust-grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: 1fr;
}

@media (min-width: 800px) { .trust-grid { grid-template-columns: 1fr 1fr; } }

.trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: var(--shadow);
}

.trust-card h3 { margin-bottom: 0.75rem; }

.trust-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.trust-card li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--muted);
}

.trust-card li .mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 0.15rem;
}

.mark-yes { background: rgba(16, 185, 129, 0.15); color: #067A5B; }
.mark-no { background: rgba(239, 68, 68, 0.13); color: #B4232C; }

@media (prefers-color-scheme: dark) {
  .mark-yes { color: #34D399; }
  .mark-no { color: #F87171; }
}

/* ---------- Plans ---------- */

.plans {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: 1fr;
  max-width: 56rem;
  margin-inline: auto;
}

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

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.plan-premium { border: 2px solid var(--indigo); position: relative; }

.plan-tag {
  position: absolute;
  top: -0.85rem;
  left: 1.5rem;
  background: var(--indigo);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
}

.plan h3 { font-size: 1.35rem; margin-bottom: 0.25rem; }

.plan .plan-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.1rem; }

.plan ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.plan li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  color: var(--muted);
}

.plan li .mark { margin-top: 0.15rem; }

.plan-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ---------- FAQ ---------- */

.faq-list {
  max-width: 46rem;
  display: grid;
  gap: 0.85rem;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1rem 1.25rem;
  min-height: 44px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  flex: none;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--indigo);
  line-height: 1;
}

.faq-list details[open] summary::after { content: "\2212"; }

.faq-list details p {
  margin: 0;
  padding: 0 1.25rem 1.1rem;
  color: var(--muted);
}

/* ---------- Final CTA ---------- */

.cta-final { text-align: center; }

.cta-final .store-badges { justify-content: center; margin-top: 1.5rem; }

.cta-final .lede { margin-inline: auto; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
  background: var(--bg);
}

.footer-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}

@media (min-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.3fr; }
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 26em;
}

.site-footer h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.site-footer ul a {
  color: var(--ink);
  font-weight: 500;
  display: inline-block;
  padding-block: 0.3rem;
}

.footer-badges { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }

.footer-badges .store-badge img { height: 44px; }

.footer-legal {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ---------- Subpages (privacy / support) ---------- */

.page-hero {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.page-hero h1 { max-width: 18em; }

.page-hero .lede { margin-top: 0.5rem; }

.page-body { padding-block: clamp(2rem, 4vw, 3.5rem) var(--section-pad); }

.policy-layout { display: grid; gap: 2.5rem; }

@media (min-width: 1100px) {
  .policy-layout { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
  .policy-toc { position: sticky; top: 5.5rem; }
}

.policy-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.policy-toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.policy-toc ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.prose { max-width: var(--prose); }

.prose h2 {
  font-size: clamp(1.25rem, 1.2vw + 0.85rem, 1.55rem);
  margin: 2em 0 0.6em;
  scroll-margin-top: 5.5rem;
}

.prose h2:first-of-type { margin-top: 0.5em; }

.prose p, .prose li { color: var(--muted); }

.prose ul { padding-left: 1.3rem; margin: 0.6em 0 1em; }
.prose li { margin-bottom: 0.4em; }

.prose strong { color: var(--ink); }

.prose code {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  word-break: break-word;
}

.effective-date {
  color: var(--muted);
  font-size: 0.95rem;
}

.support-cards {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: 1fr;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 800px) { .support-cards { grid-template-columns: 1fr 1fr; } }

.support-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: var(--shadow);
}

.support-card h2 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.support-card p, .support-card li { color: var(--muted); }
.support-card ul { padding-left: 1.3rem; margin: 0.6em 0 0; }
.support-card li { margin-bottom: 0.4em; }
.support-card code {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  word-break: break-word;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .step, .service-tile, .plan, .trust-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
  .step:hover, .plan:hover, .trust-card:hover { transform: translateY(-3px); }
  .service-tile:hover { transform: translateY(-2px); }
  .store-badge { transition: transform 0.2s ease; }
  .store-badge:hover { transform: translateY(-2px); }

  /* Scroll-driven reveal — progressive enhancement (ignored where unsupported) */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-rise both;
      animation-timeline: view();
      animation-range: entry 0% entry 32%;
    }
  }
}

@keyframes reveal-rise {
  from { opacity: 0.2; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
