/* ==========================================================================
   Our additions to the designer's stylesheets.

   Everything else in public/marketing/css/ is the designer's export, kept
   byte-for-byte so the next export can be copied over it (docs/MARKETING_SITE.md).
   Anything the application needs that the design does not have goes here, so a
   re-export never silently deletes it.
   ========================================================================== */

/* A refusal or notice the server flashes onto the register page (session
   expired, too many attempts). The static design had no server to hear from. */
.rg-alert {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.45;
}
.rg-alert--error { color: #9F2A23; background: #FDEDEC; border-color: #F5C6C2; }
.rg-alert--warning { color: #7A4A06; background: var(--orange-50); border-color: var(--orange-100); }
.rg-alert--success { color: #1D5B3A; background: #EAF6EF; border-color: #BFE3CD; }
.rg-alert--status { color: var(--charcoal); background: var(--stone); border-color: var(--line); }

/* Real screens in the Features page's device figures (js/real-screens.js). The designer's
   .device--laptop / .device--phone frame stays exactly as drawn; inside it, instead of a canvas,
   a copy of the real screen at its captured size (960x600, or 390x845 on a phone), scaled by
   the script to fit. Two copies of one figure cross-fade. */
.live-screen { position: relative; overflow: hidden; background: #F4F5F7; }
.live-screen--laptop { aspect-ratio: 960 / 600; border-radius: 4px; }
.live-screen--phone { aspect-ratio: 390 / 845; border-radius: 12% / 5.6%; }
.live-screen iframe { position: absolute; inset: 0 auto auto 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; opacity: 0; transition: opacity .5s ease; will-change: transform, opacity; }
.live-screen iframe.is-shown.is-loaded { opacity: 1; }
/* Below 980px register.css un-sticks the side panel with `position: static`, which also stops
   it being the containing block for its decorative glow (.rg-panel::before, right: -30%). The
   glow then positions against the page, escapes the panel's overflow: hidden, and gave the page
   113px of sideways scroll at 390px — measured in a browser, 2026-10-26. `relative` un-sticks it
   just the same and keeps the glow inside. */
@media (max-width: 980px) {
  .rg-panel { position: relative; }
}
/* Pages a phone laid out wider than its screen — measured 2026-10-28, 390px, with a phone's
   layout viewport (Chromium, isMobile): /how-it-works at 446px and /features at 395px (780px at
   768). body's overflow-x: clip stops anyone scrolling sideways, but a phone still sizes its
   layout viewport to the widest content, so the fixed header grew with it and pushed its menu
   button off the right edge — on How It Works only a sliver of it showed. Three causes:
   - .hw-panel's phone layout is `grid-template-columns: 1fr`, and a bare 1fr cannot shrink
     below its widest child; the step-1 illustration's aspect-ratio box wanted ~360px. The
     designer's desktop rule already says minmax(0, …).
   - A step's button ("Explore Product & Inventory Features →") is .btn, which never wraps.
   - The laptop's base overhangs the screen by 6% a side (margin: 0 -6%), which on a laptop
     drawn edge to edge is wider than the page's gutter. 3% still reads as a base. */
@media (max-width: 899px) {
  .hw-panel { grid-template-columns: minmax(0, 1fr); }
  .hw-panel__copy .btn { white-space: normal; text-align: center; }
  /* Narrower now, the illustration's 16:11 box is shorter than its card, and overflow: hidden
     cut the card's top and bottom off. Let it take the card's height. */
  .hw-illus { aspect-ratio: auto; padding-block: 28px; }
}
@media (max-width: 900px) {
  .device--laptop .device__base { margin-inline: -3%; }
}
/* The legal pages (and the blog post, which borrows their layout) had the same bare 1fr below
   960px, so the Cookie Policy's table — which is meant to scroll inside its own box — widened
   the whole page instead: 533px at 390. */
@media (max-width: 960px) {
  .lg-layout { grid-template-columns: minmax(0, 1fr); }
}
/* And every other one-column phone grid in the design, at the designer's own breakpoints. Where
   the content fits, minmax(0, 1fr) lays out exactly as 1fr does; where it does not, the column
   stays the screen's width instead of growing. .split (home) and .fx-split (features) measured
   13px and 9px too wide at 320. */
@media (max-width: 1100px) {
  .how { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .px-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .hero, .split, .faq, .fx-split, .fx-split--wide, .px-steps, .sx-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .who, .how__cols, .how__cols--pos, .fx-cards, .hw-day, .hw-tools, .sx-problems, .sx-why { grid-template-columns: minmax(0, 1fr); }
}
/* The header at a phone's width. The designer's bar — a 28px logo, Get Started and the 44px menu
   button with 24px between them — needs ~395px, so at 360 (a common Android width) the menu
   button was half off the screen and at 320 wholly off it, leaving no way to the navigation.
   Smaller logo and gaps; the menu button keeps its 44px. */
@media (max-width: 400px) {
  .site-header__bar { gap: 12px; }
  .brand img { height: 24px; }
  .header__mobile-cta { padding: 8px 12px; font-size: .9rem; }
}
@media (max-width: 350px) {
  /* .btn never wraps and .btn--lg is at least 210px, so at 320 a long label ("Start Your 14-Day
     Free Trial →") was wider than its column and widened the page with it. */
  .btn { white-space: normal; text-align: center; }
  .btn--lg { min-width: 0; }
  .site-header__bar { gap: 8px; }
  .brand img { height: 21px; }
  .header__mobile-cta { padding: 8px 10px; font-size: .85rem; }
}
/* The cookie notice (partials/cookie-notice.blade.php). A card in the bottom-left corner on a
   wide screen and a full-width bar on a phone, never centred over the page, and clear of a
   phone's home indicator. Above the page's own layers, below the skip link. */
.cookie-notice {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 440px;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--charcoal); box-shadow: 0 10px 30px rgba(17, 24, 39, .14);
  font-size: .9rem; line-height: 1.45;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; }
.cookie-notice a { color: var(--orange-600); font-weight: 600; }
.cookie-notice__ok { flex: 0 0 auto; min-height: 44px; padding: 10px 22px; }
@media (max-width: 600px) {
  .cookie-notice {
    left: 0; right: 0; bottom: 0; max-width: none; border-radius: 16px 16px 0 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }
}

/* The register page's "I agree" box (auth/register.blade.php): the design has none. */
.rg-agree { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: .92rem; line-height: 1.5; color: var(--body); }
.rg-agree input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--orange); }
.rg-agree a { color: var(--orange-600); font-weight: 600; }
.rg-agree + .rg-error { margin: -12px 0 14px; }

/* The home page's hero on a phone only (≤600px): no shopkeeper photo, and the copy centred like
   the other four pages' heroes. Tablets and desktops keep the design exactly as drawn — the owner
   asked for phones only (2026-10-27). */
@media (max-width: 600px) {
  .hero__photo { display: none; }
  .hero__copy { text-align: center; }
  .hero__title, .hero__lede { margin-left: auto; margin-right: auto; }
  .hero__ctas, .hero__perks { justify-content: center; }
}

/* ==========================================================================
   The header's Resources menu (Blog, FAQ) — ours, F-19, docs/BLOG.md.
   Rendered only while marketing.blog.enabled; otherwise Resources is the
   plain FAQ link the design drew. Opens on hover (a mouse), on keyboard focus
   (focus-within) and on click or tap (js/nav-menu.js sets .is-open). In the
   phone menu it is simply listed under its label: a menu inside a menu is
   one tap too many on a small screen.
   ========================================================================== */
.nav__group { position: relative; }
.nav__group-btn {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; font-weight: 500; font-size: .98rem; color: var(--charcoal);
  display: inline-flex; align-items: center; gap: 7px;
}
.nav__group-btn:hover, .nav__group.is-open .nav__group-btn, .nav__group-btn[aria-current="page"] { color: var(--orange-600); }
.nav__chevron {
  width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease);
}
.nav__group.is-open .nav__chevron { transform: translateY(1px) rotate(-135deg); }

@media (min-width: 1101px) {
  .nav__sub {
    position: absolute; top: calc(100% + 14px); left: 50%; z-index: 60;
    min-width: 190px; padding: 8px; margin: 0; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 40px -18px rgba(18, 20, 22, .28);
    opacity: 0; visibility: hidden; transform: translate(-50%, -6px);
    transition: opacity .18s, transform .18s var(--ease), visibility 0s .18s;
  }
  /* A bridge over the gap, so the pointer can travel from the label to the menu. */
  .nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
  .nav__group:focus-within .nav__sub,
  .nav__group.is-open .nav__sub {
    opacity: 1; visibility: visible; transform: translate(-50%, 0);
    transition: opacity .18s, transform .18s var(--ease);
  }
  .nav__sub a { display: block; padding: 10px 14px; border-radius: 8px; white-space: nowrap; }
  .nav__sub a:hover, .nav__sub a[aria-current="page"] { background: var(--orange-50); color: var(--orange-600); }
}
@media (min-width: 1101px) and (hover: hover) {
  .nav__group:hover .nav__sub {
    opacity: 1; visibility: visible; transform: translate(-50%, 0);
    transition: opacity .18s, transform .18s var(--ease);
  }
  .nav__group:hover .nav__chevron { transform: translateY(1px) rotate(-135deg); }
}
@media (max-width: 1100px) {
  .nav__group-btn {
    display: block; width: 100%; text-align: left; cursor: default;
    padding: 14px 0 6px; font-size: .82rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
  }
  .nav__group-btn:hover { color: var(--muted); }
  .nav__chevron { display: none; }
  .nav__sub { margin: 0; padding: 0 0 0 14px; list-style: none; }
}
