/* =====================================================================
   FlyForms — responsive fixes, loaded last.
   Phones: a menu button (a native <details>, so it works without
   JavaScript), tab and filter bars that always show every option,
   comfortable tap targets, and no sideways page scroll anywhere.
   ===================================================================== */

/* No stray sliver may scroll the page sideways ("clip" keeps the sticky menu working). */
html, body { overflow-x: clip; }

/* ---------- Phone menu ---------- */

.wh-mnav { display: none; position: static; }
.wh-mnav > summary {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  list-style: none; cursor: pointer; color: var(--wh-ink, #000);
  background: #fff; box-shadow: 0 0 0 1px var(--wh-line, #e8e3dc);
}
.wh-mnav > summary::-webkit-details-marker { display: none; }
.wh-mnav > summary svg { width: 20px; height: 20px; }
.wh-mnav .wh-mnav-close { display: none; }
.wh-mnav[open] .wh-mnav-open { display: none; }
.wh-mnav[open] .wh-mnav-close { display: block; }
.wh-mnav-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  display: flex; flex-direction: column; padding: 8px;
  border-radius: 18px; background: #fff;
  box-shadow: 0 0 0 1px var(--wh-line, #e8e3dc), 0 24px 48px -24px rgb(29 24 48 / .35);
}
.wh-mnav-panel a {
  display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px;
  font-size: 16px; color: var(--wh-ink, #000);
}
.wh-mnav-panel a:hover, .wh-mnav-panel a[aria-current=page] { background: var(--wh-warm, #faf9f8); color: var(--wh-accent, #7147eb); }

@media (max-width: 767px) {
  .wh-mnav { display: block; }
  /* The menu panel hangs off the whole header bar, which is the positioned box. */
  .theme-whistler .flyforms-siteheader { position: relative; }
  .theme-whistler .flyforms-siteheader { padding-inline: 14px 8px; }
}

/* ---------- Bars of options: every option visible on a phone ---------- */

@media (max-width: 480px) {
  /* Product tour tabs: a 2 x 2 grid instead of a bar that runs off the edge. */
  .tv-tabs:not(.tv-tabs-line) {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 360px;
    overflow: visible; border-radius: 16px; gap: 4px;
  }
  .tv-tabs:not(.tv-tabs-line) button { justify-content: center; text-align: center; border-radius: 12px; }

  /* Template filters: one line, slightly tighter. */
  [aria-label="Filter templates"] { flex-wrap: nowrap; gap: 2px; }
  [aria-label="Filter templates"] button { padding-inline: 12px; white-space: nowrap; }
}

/* ---------- Tap targets ---------- */

/* The login page's "Remember me" box is 18px; give it a 40px invisible hit area. */
[data-slot=checkbox] { position: relative; }
[data-slot=checkbox]::after { content: ""; position: absolute; inset: -11px; }

/* ---------- Very small phones (320px) ---------- */

@media (max-width: 360px) {
  .theme-whistler .flyforms-siteheader .text-subheading { font-size: 19px; }
  .theme-whistler header [data-slot=button] { padding-inline: 12px; }
  .hv-title { font-size: 36px; }
}

/* ---------- Side gutters: one fluid gap at every screen width ----------
   24px on phones, growing with the screen to 88px. Content still stops at 1495px, so a 1920px
   screen looks the same as before; smaller laptops and tablets get clearly wider side margins. */
:root {
  --wh-gutter: clamp(24px, 5.5vw, 88px);
  --container-page: calc(var(--wh-content, 1495px) + 2 * var(--wh-gutter));
}
.theme-whistler .max-w-page.px-6 { padding-inline: var(--wh-gutter); }            /* page sections and footer */
.theme-whistler header.sticky { padding-inline: var(--wh-gutter); }                  /* header pill */
.theme-whistler .hv1-band { padding-inline: var(--wh-gutter); }                      /* hero dashboard frame */
.theme-whistler .wh-cta { padding-inline: var(--wh-gutter); }                             /* closing call-to-action panel */
.theme-whistler .wh-cta > div { width: 100%; }                                               /* the section's gutter is its margin now */
.theme-whistler .wh-statement { padding-inline: var(--wh-gutter); }                         /* purple statement banner */
.theme-whistler main > div.mx-auto.px-6 { padding-inline: var(--wh-gutter); }               /* guide index and other plain pages */
.theme-whistler .wh-cta > .max-w-page.px-6 { padding-inline: clamp(24px, 4vw, 64px); }     /* its text keeps its own inset */
.theme-whistler[data-page^="docs"] main > div.max-w-6xl {                                  /* guide pages */
  max-width: calc(var(--wh-content, 1495px) + 2 * var(--wh-gutter)); padding-inline: var(--wh-gutter);
}
#app > div.min-h-svh.bg-background.p-4 { padding-inline: var(--wh-gutter); }              /* log in and password pages */

/* ---------- Section rhythm ----------
   Every section has the same space above and below its content: 144px on desktop, a little less on
   tablets and phones so small screens are not mostly empty. */
:root { --wh-section: 144px; }
@media (max-width: 1023px) { :root { --wh-section: 112px; } }
@media (max-width: 767px) { :root { --wh-section: 88px; } }
.theme-whistler main > section.wh-band:not(.wh-cta):not(.pt-0):not(.py-10):not(:has(> section)),
.theme-whistler main > .wh-band > section:not(.wh-hero) { padding-top: var(--wh-section); }
.theme-whistler main > section.wh-band:not(.wh-cta):not(.py-10):not(:has(> section)),
.theme-whistler main > .wh-band > section:not(.wh-hero) { padding-bottom: var(--wh-section); }
.theme-whistler #tour.pt-0 { margin-top: 0; padding-top: var(--wh-section); }          /* product tour */
.theme-whistler main > .rwp { padding-block: var(--wh-section); }                       /* builder and answers rows */
.theme-whistler .wh-cta { margin-top: 0; padding-block: 24px; }  /* the bands above and below bring their own space */
.theme-whistler .wh-cta > div { margin-block: 0; }

/* 60px gaps: below the feature cards to their one-line strip, and below the tour screenshot to its caption */
.theme-whistler #what-you-get .grid.lg\:grid-cols-3 + .flyforms-arrive > p { margin-top: 60px; }
.theme-whistler .tv-home .tv-cap { margin-top: 60px; }
/* The tour only pins and slides (its scroll animation) when the whole stage fits the window, so the
   canvas gives back the 42px the caption gap gained (tour.css allows 100vh - 230px for an 18px gap). */
.theme-whistler .tv-home .tv-1 .tv-canvas { height: max(360px, min(clamp(380px, 52vw, 780px), calc(100vh - 272px))); }

/* Paragraph lines stay even: no long first line over a one- or two-word last line.
   Long reading text in the guide only avoids a lone last word (pretty), so its lines stay full. */
.theme-whistler :is(main, #app) p { text-wrap: balance; }
.theme-whistler .flyforms-guide :is(p, li) { text-wrap: pretty; }

/* The play icon in "Build one right here" is white on the violet dot. */
.theme-whistler [class*="group/play"] .bg-brand { color: #fff; }

/* The closing panel's band is the off-white on every page, whatever section sits above it. */
.theme-whistler .wh-cta { --band: var(--wh-warm); }

/* Footer credit: "Built by" and the weDevs logo on one line. */
.theme-whistler .wh-builtby { display: inline-flex; align-items: center; gap: 8px; }
.theme-whistler .wh-wedevs { display: block; width: auto; height: 22px; }

/* The closing panel ("Build your first form"): a deeper warm grey with a stronger violet glow,
   so it stands out from the off-white band around it. */
.theme-whistler .wh-cta > div {
  background-color: #f1f0ed;
  background-image: var(--wh-noise), radial-gradient(62% 70% at 50% 112%, rgb(var(--wh-accent-rgb) / .24), transparent 72%);
  border-color: #e5e3df;
}
/* Footer bottom line: credit on the left, copyright on the right (stacked on narrow screens). */
.theme-whistler footer p:has(> .wh-builtby) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }

/* Closing panel background (ctadeco.py): a fine grid of thin lines across the whole panel,
   strongest in the middle and fading softly at the edges. */
.theme-whistler .wh-cta > div:has(> .cth-deco) { position: relative; overflow: hidden; isolation: isolate; }
.theme-whistler .wh-cta > div:has(> .cth-deco) > :not(.cth-deco) { position: relative; z-index: 1; }
.cth-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cth-grid {
  background-image:
    linear-gradient(to right, rgb(20 20 20 / .075) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(20 20 20 / .075) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 45%, #000 45%, rgb(0 0 0 / .35) 100%);
          mask-image: radial-gradient(ellipse 75% 85% at 50% 45%, #000 45%, rgb(0 0 0 / .35) 100%);
}
@media (max-width: 700px) { .cth-grid { background-size: 32px 32px; } }

/* The purple banner straight above the closing panel (features, about): 30px apart, and both boxes
   with 20px corners (the closing panel keeps 20px on every page, so it stays the same everywhere). */
.theme-whistler .wh-statement:has(+ .wh-cta) { padding-bottom: 0 !important; }
.theme-whistler .wh-statement + .wh-cta { padding-top: 30px !important; }
.theme-whistler main .wh-statement .rounded-xl { border-radius: 20px; }   /* main: outranks whistler.css's rounded-xl.border rule */
.theme-whistler .wh-cta > div { border-radius: 20px; }
/* The purple banner's band is white too, so the white runs on unbroken to the footer. */
.theme-whistler .wh-statement:has(+ .wh-cta) { --band: #fff; }
/* The footer is the off-white on every page, like the closing panel's band above it. */
.theme-whistler footer .wh-band:not(.flyforms-parallax) { --band: var(--wh-warm); }
/* Features and About: white under the purple banner, the closing panel and the footer (the off-white stays on Home). */
.theme-whistler:is([data-page="features"], [data-page="about"]) .wh-cta,
.theme-whistler:is([data-page="features"], [data-page="about"]) footer .wh-band:not(.flyforms-parallax) { --band: #fff; }
/* The floating menu (once the page scrolls): frosted glass. See-through white with a strong blur and a
   little colour boost, a bright hairline edge and a soft shadow, so it reads on light and dark sections. */
.theme-whistler .flyforms-siteheader[data-scrolled=true] {
  background: linear-gradient(180deg, rgb(255 255 255 / .62), rgb(255 255 255 / .48));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
          backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgb(255 255 255 / .55);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .7), 0 10px 30px -10px rgb(15 10 40 / .25), 0 2px 6px rgb(15 10 40 / .06);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .theme-whistler .flyforms-siteheader[data-scrolled=true] { background: rgb(255 255 255 / .94); }
}
