/*
 * Shared styles for the static marketing pages (index.html, pricing.html and
 * the legal pages). These pages are plain HTML served without the React
 * bundle, so first-time visitors and crawlers get rendered, indexable content
 * with no JavaScript required. The palette is the app's dark theme
 * (src/renderer/app/theme.ts): slate background, blue accent, near-white
 * type, so the marketing site and the product read as one thing.
 */
:root {
  --bg: #0f172a;
  --bg-2: #111c33;
  --panel: rgba(30, 41, 59, 0.55);
  --panel-border: #334155;
  --panel-border-hover: #475569;
  --ink: #f8fafc;
  --body: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-deep: #2563eb;
  --ok: #34d399;
  --warn: #fbbf24;
  --max: 1040px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  color: var(--body);
  background:
    radial-gradient(55rem 35rem at 90% -10%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(45rem 35rem at -10% 110%, rgba(96, 165, 250, 0.08), transparent 60%), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: #93c5fd;
}
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: saturate(160%) blur(10px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--ink);
}
.brand img {
  width: 28px;
  height: 28px;
  display: block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav a:not(.btn) {
  color: var(--muted);
  font-size: 0.95rem;
}
.nav a:not(.btn):hover,
.nav a[aria-current='page'] {
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #0b1120;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}
.btn:hover {
  color: #0b1120;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.35);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 10px;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  box-shadow: none;
  color: var(--ink);
}
.btn-ghost:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--panel-border-hover);
  filter: none;
  box-shadow: none;
}

/* Hero */
.hero {
  padding: 84px 0 36px;
  text-align: center;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin: 0;
}
.hero h1 {
  font-size: 2.9rem;
  line-height: 1.1;
  margin: 14px 0 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 800;
}
.hero h1 .grad,
.grad {
  background-image: linear-gradient(100deg, #93c5fd, #60a5fa, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.22rem;
  color: var(--body);
  max-width: 680px;
  margin: 0 auto 30px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .note {
  color: var(--muted);
  margin-top: 16px;
  font-size: 0.95rem;
}

/* Content */
main {
  padding: 20px 0 40px;
}
main h2 {
  font-size: 1.75rem;
  margin: 50px 0 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 700;
}
main h3 {
  font-size: 1.15rem;
  margin: 26px 0 8px;
  color: var(--ink);
}
main h4 {
  font-size: 1rem;
  margin: 20px 0 6px;
  color: var(--ink);
}
main p,
main li {
  font-size: 1.02rem;
  color: var(--body);
}
main strong {
  color: var(--ink);
}
main code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.9em;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* Feature grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.card {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 22px;
  background: var(--panel);
  backdrop-filter: blur(4px);
}
.card h3 {
  margin-top: 0;
}
.card p {
  color: var(--muted);
  margin-bottom: 0;
}

/*
 * Card glyphs. Inline SVG rather than an icon font or a sprite: these pages
 * load one small module and nothing else, and a font or an extra request for
 * eight 20px marks would cost more than the marks are worth. `currentColor`
 * means the tile's color rule drives the stroke, so there is one place to
 * change it.
 */
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--accent);
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.22);
}
.card-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
/* The "How it works" tiles carry their step number instead of a glyph. */
.card-icon.step {
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/*
 * Product screenshots. Real captures of the running app
 * (scripts/capture-site-screenshots.mjs) — the page claims to be a form
 * builder and should show one.
 *
 * width/height are set on the <img> so the box is reserved before the bytes
 * arrive: these sit below the fold, and a late-loading image that pushes the
 * page down is the layout shift Lighthouse measures.
 */
.shot {
  margin: 36px 0 0;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}
/*
 * Some views are taller than their content (the preview leaves the page
 * empty below a short form). Crop from the top rather than shipping a
 * screenshot that is half background.
 */
.shot.crop img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
}
.shot figcaption {
  margin: 12px 0 0;
  text-align: center;
  color: var(--faint);
  font-size: 0.85rem;
}

/* Pricing */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  margin: 34px 0;
}
.plan {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 30px;
  background: var(--panel);
}
.plan.featured {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-deep)) border-box;
  box-shadow: 0 16px 40px rgba(59, 130, 246, 0.18);
}
/*
 * Plan names are h2 because they precede the page's first section heading and
 * an h1 -> h3 jump is an accessibility failure. They must not pick up the
 * `main h2` section size, so the old h3 size and spacing are pinned here.
 */
.plan h2 {
  color: var(--ink);
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.plan .price {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 8px 0;
  color: var(--ink);
}
.plan .price small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 18px 0;
}
.plan li {
  padding: 7px 0 7px 28px;
  position: relative;
  color: var(--body);
}
.plan li::before {
  content: '✓';
  color: var(--ok);
  position: absolute;
  left: 0;
  font-weight: 700;
}
.plan .unavailable {
  color: var(--muted);
  font-size: 0.95rem;
}

/* CTA band */
.cta {
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  margin: 56px 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(96, 165, 250, 0.08));
  border: 1px solid var(--panel-border);
}
.cta h2 {
  color: var(--ink);
  margin: 0 0 12px;
}
.cta p {
  margin-top: 0;
}

/* Prose pages (legal) */
.prose {
  max-width: 780px;
}
.prose .updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: -6px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.95rem;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  vertical-align: top;
}
.prose th {
  background: rgba(30, 41, 59, 0.8);
  color: var(--ink);
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
}
.faq h3 {
  margin-bottom: 4px;
}
.faq p {
  margin-top: 4px;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 34px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.site-footer nav a,
.site-footer nav button {
  color: var(--muted);
}
.site-footer nav a:hover,
.site-footer nav button:hover {
  color: var(--ink);
}
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* Cookie banner (rendered by src/site/main.ts) */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  margin: 0 auto;
  max-width: 720px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--panel-border-hover);
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner p {
  margin: 0;
  flex: 1 1 320px;
  font-size: 0.95rem;
  color: var(--body);
}
.cookie-banner .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cookie-banner .btn {
  padding: 9px 16px;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .hero {
    padding-top: 56px;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .nav a:not(.btn):not(.nav-keep) {
    display: none;
  }
  /* Pricing and the button share the row with the brand. Log in is hidden
     here (it is not .nav-keep): it goes to the same /app as the button. */
  .nav {
    gap: 14px;
  }
  .nav a,
  .brand {
    white-space: nowrap;
  }
  .nav .btn {
    padding: 9px 14px;
    font-size: 0.9rem;
  }
  /* The banner sat over the first screenshot on a phone: smaller text and
     the two buttons side by side take it from 163px to about 137px tall. */
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 12px 14px;
    gap: 10px;
  }
  .cookie-banner p {
    flex-basis: 100%;
    font-size: 0.85rem;
  }
  .cookie-banner .actions {
    width: 100%;
    flex-wrap: nowrap;
  }
  .cookie-banner .btn {
    flex: 1;
    padding: 8px 12px;
  }
}
