/* ============================================================================
   Shared UI — everything that renders on BOTH stylesheet stacks.

   The homepage runs the product site's stack (marketing.css + friends) with no
   site.css; every other page runs site.css + chrome.css. Anything that appears
   on both — the footer's extras, flash messages, the cookie banner — cannot
   live in either stack alone, so it lives here and is linked from both.

   Getting this wrong is invisible in dev: GTM_CONTAINER_ID is empty when
   DEBUG=True, so the cookie banner never renders locally. It would have shipped
   unstyled on the homepage only.

   Deliberately self-contained: the cookie banner's buttons do not lean on
   site.css's .btn-primary, because on the homepage marketing.css owns that
   class for the nav CTA.
============================================================================ */

/* ---------------------------------------------------------------------------
   Flash messages — the waitlist and contact POSTs redirect back with one
   ------------------------------------------------------------------------ */

.flash-wrap {
  max-width: 1280px;
  margin: 1.25rem auto 0;
  padding: 0 24px;
}

.flash {
  padding: .85rem 1.15rem;
  border-radius: 12px;
  margin-bottom: .75rem;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
}

.flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ---------------------------------------------------------------------------
   Cookie consent banner — only rendered when GTM_CONTAINER_ID is set
   ------------------------------------------------------------------------ */

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1100;
  max-width: 680px;
  margin: 0 auto;
  background: #0b0b0b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}

.cookie-banner[hidden] { display: none; }

.cookie-banner p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .82);
  flex: 1 1 300px;
}

.cookie-banner a { color: #fff; text-decoration: underline; }

.cookie-actions { display: flex; gap: .5rem; flex: 0 0 auto; }

/* Written out in full rather than inheriting .btn: on the homepage
   marketing.css owns .btn-primary for the nav CTA.

   The .cookie-actions step is load-bearing, not decoration. marketing.css has
   `body.homepage-black-white .btn-primary` at (0,2,1); a plain
   `.cookie-banner .btn-primary` is only (0,2,0) and loses, which painted the
   Accept button black on the black banner. Going through the wrapper makes
   these (0,3,0) so they win outright, on both stacks, without !important. */
.cookie-banner .cookie-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}

.cookie-banner .cookie-actions .btn-primary { background: #fff; color: #000; }
.cookie-banner .cookie-actions .btn-primary:hover { background: #ececec; }

.cookie-banner .cookie-actions .btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .28);
}

.cookie-banner .cookie-actions .btn-secondary:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, .08);
}

/* ---------------------------------------------------------------------------
   Footer extras — this site's footer carries a contact line and the waitlist
   form; the product's does not, and footer.css ends .footer-description at
   `margin: 0`.
   ------------------------------------------------------------------------ */

.global-footer .footer-brand .footer-description {
  margin-bottom: 1.25rem;
}

.global-footer .footer-contact {
  margin: 0 0 1.25rem;
  font-size: .9rem;
}

.global-footer .footer-contact a {
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  transition: color .2s ease, border-color .2s ease;
}

.global-footer .footer-contact a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Waitlist form on the black ground. */
.global-footer .waitlist-form {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 340px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  overflow: hidden;
}

.global-footer .waitlist-form:focus-within {
  border-color: rgba(255, 255, 255, .3);
}

.global-footer .waitlist-form input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 13px 16px;
  font: inherit;
  font-size: .95rem;
  color: #fff;
}

.global-footer .waitlist-form input[type="email"]:focus {
  outline: none;
  box-shadow: none;
}

.global-footer .waitlist-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, .5);
}

.global-footer .waitlist-form button {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  border-radius: 0;
  padding: 13px 22px;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  background: #fff;
  color: #000;
  white-space: nowrap;
  transition: background .2s ease;
}

.global-footer .waitlist-form button:hover {
  background: #f1f1f1;
}

/* "Latest guides" runs long titles; clamp them rather than let one stretch
   the three-column grid. */
.global-footer .footer-links--guides a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .global-footer .waitlist-form {
    flex-direction: column;
    background: transparent;
    border: none;
    gap: .55rem;
  }
  .global-footer .waitlist-form input[type="email"] {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
  }
  .global-footer .waitlist-form button {
    width: 100%;
    border-radius: 12px;
  }
}
