/* ==========================================================================
   Fampay App — Informational Website
   Design system + layout + components
   ========================================================================== */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, picture, svg { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

@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; }
}

/* ---- Design tokens ---- */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f6fb;
  --color-surface: #ffffff;
  --color-text: #191b28;
  --color-text-muted: #5b5f74;
  --color-text-faint: #83879c;
  --color-border: #e5e7f2;
  --color-primary: #5b4cf0;
  --color-primary-dark: #4737d6;
  --color-primary-light: #efedff;
  --color-accent: #10b294;
  --color-accent-light: #e3f9f4;
  --color-warning-bg: #fff7e6;
  --color-warning-border: #f0c96b;
  --color-warning-text: #7a5b06;
  --color-danger: #e5484d;
  --color-danger-bg: #fdecec;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 21, 40, 0.06), 0 1px 1px rgba(20, 21, 40, 0.04);
  --shadow-md: 0 10px 24px rgba(20, 21, 40, 0.08);
  --shadow-lg: 0 24px 56px rgba(20, 21, 40, 0.14);

  --container: 1160px;
  --container-narrow: 760px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--color-text); }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { color: var(--color-text-muted); }
p + p { margin-top: 1rem; }
strong { color: var(--color-text); }

.lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.section-head {
  max-width: 680px;
  margin: 0 0 2.25rem;
}

.section-head p { margin-top: 0.75rem; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.section-alt { background: var(--color-bg-alt); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2.5px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
  min-height: 48px;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.55);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

.btn-group { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}
/* Blur lives on a pseudo-element, not .site-header itself, so the header
   doesn't become a containing block for its fixed-position mobile nav
   (backdrop-filter/filter/transform on an element does that to descendants). */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text);
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.primary-nav a {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}
.primary-nav a:hover { color: var(--color-primary); background: var(--color-primary-light); }
.primary-nav a[aria-current="page"] { color: var(--color-primary); background: var(--color-primary-light); }
.primary-nav a.mobile-download-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 880px) {
  .primary-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 2rem;
    gap: 0.25rem;
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }
  .primary-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .primary-nav a { padding: 0.9rem 1rem; font-size: 1.05rem; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-secondary { display: none; }
  .primary-nav a.mobile-download-cta {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
    padding: 0.9rem 1rem;
    color: #fff;
  }
  .primary-nav a.mobile-download-cta:hover,
  .primary-nav a.mobile-download-cta:focus-visible {
    background: var(--color-primary-dark);
    color: #fff;
  }
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  padding-block: 0.9rem;
  font-size: 0.88rem;
  color: var(--color-text-faint);
  border-bottom: 1px solid var(--color-border);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.breadcrumbs a { color: var(--color-text-muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; color: var(--color-text-faint); }
.breadcrumbs li[aria-current="page"] { color: var(--color-text-faint); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(180deg, #14152a 0%, #201f3d 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 2.5rem;
  padding-block: clamp(2.75rem, 6vw, 5rem);
}
.hero h1 { color: #fff; }
.hero .lede { color: rgba(255,255,255,0.78); }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
}
.hero-media { position: relative; }
.hero-media svg { width: 100%; height: auto; }
.hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 340px; margin-inline: auto; }
}

/* ---- Page header (non-hero inner pages) ---- */
.page-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding-block: clamp(2rem, 4vw, 3rem);
}
.page-header .section-eyebrow { margin-bottom: 0.5rem; }
.page-header p { max-width: 680px; margin-top: 0.75rem; }

/* ---- Cards ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.95rem; }

/* ---- Info table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.info-table { min-width: 480px; }
.info-table th, .info-table td {
  text-align: left;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }
.info-table th { color: var(--color-text-muted); font-weight: 600; width: 42%; background: var(--color-bg-alt); }
.info-table td { color: var(--color-text); font-weight: 500; }

/* ---- Steps ---- */
.steps { display: grid; gap: 1rem; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.step-number {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.step p { font-size: 0.95rem; margin-top: 0.2rem; }

/* ---- Callouts ---- */
.callout {
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--color-border);
  display: flex;
  gap: 0.9rem;
}
.callout svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 0.15rem; }
.callout h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.callout p { font-size: 0.92rem; }

.callout-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.callout-warning svg { color: var(--color-warning-text); }
.callout-info { background: var(--color-primary-light); border-color: #d7d1fb; }
.callout-info svg { color: var(--color-primary-dark); }
.callout-accent { background: var(--color-accent-light); border-color: #b9ecdf; }
.callout-accent svg { color: #0a7d67; }

/* ---- Download card ---- */
.download-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 1.5rem;
}
.download-card-head { display: flex; align-items: center; gap: 1rem; }
.download-card-icon {
  width: 60px; height: 60px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.download-card-icon svg, .download-card-icon img { width: 32px; height: 32px; }
.download-card-title { font-size: 1.3rem; margin-bottom: 0.2rem; }
.download-card-sub { font-size: 0.9rem; color: var(--color-text-faint); }

.download-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.download-meta-item {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.download-meta-item span { display: block; }
.download-meta-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-faint); font-weight: 700; margin-bottom: 0.25rem; }
.download-meta-value { font-weight: 700; font-size: 1rem; }

.download-notice {
  font-size: 0.85rem;
  color: var(--color-text-faint);
  text-align: center;
}

/* ---- FAQ (native details/summary accordion) ---- */
.faq-list { display: grid; gap: 0.75rem; }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { flex-shrink: 0; width: 20px; height: 20px; transition: transform 0.15s ease; color: var(--color-primary); }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--color-bg-alt); }
.faq-answer { padding: 0 1.35rem 1.25rem; }
.faq-answer p { font-size: 0.96rem; }

/* ---- Related links ---- */
.related-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.related-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 700;
  background: var(--color-surface);
}
.related-link:hover { border-color: var(--color-primary); color: var(--color-primary); }
.related-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---- CTA banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #7a6cf5 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.cta-banner h2 { color: #fff; margin-bottom: 0.35rem; }
.cta-banner p { color: rgba(255,255,255,0.85); }

/* ---- Two column ---- */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}
.two-col-media img, .two-col-media svg { width: 100%; height: auto; }

/* ---- Form (contact page) ---- */
.form-grid { display: grid; gap: 1.1rem; max-width: 560px; }
.form-field { display: grid; gap: 0.4rem; }
.form-field label { font-weight: 600; font-size: 0.92rem; }
.form-field input, .form-field textarea {
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 0.98rem;
  color: var(--color-text);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--color-primary); }
.form-field textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: 0.85rem; color: var(--color-text-faint); }

/* ---- Prose (legal pages) ---- */
.prose { max-width: var(--container-narrow); }
.prose h2 { margin-top: 2.25rem; margin-bottom: 0.75rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { list-style: disc; padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.prose ul li { color: var(--color-text-muted); }
.prose p { margin-top: 0.9rem; }

/* ---- Footer ---- */
.site-footer {
  background: #14152a;
  color: rgba(255,255,255,0.7);
  padding-block: 3rem 1.75rem;
  margin-top: clamp(3rem, 6vw, 5rem);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.1rem; color: #fff; margin-bottom: 0.8rem; }
.footer-brand svg { width: 28px; height: 28px; }
.footer-desc { font-size: 0.9rem; max-width: 320px; }
.footer-heading { color: #fff; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9rem; }
.footer-links { display: grid; gap: 0.6rem; }
.footer-links a { font-size: 0.92rem; }
.footer-links a:hover { color: #fff; }
.footer-disclaimer {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  display: grid;
  gap: 0.75rem;
}
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
}

/* ---- Utility ---- */
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }
.stack { display: grid; gap: 1.25rem; }
