/* Minimal layout/styling to satisfy S0.7 (responsive, mobile treated as
   primary) and the S0.0 requirement that the cookie banner never covers
   the email field or submit button on small viewports. Not a design
   system — Phase 0 is a single throwaway page (design-spec.md 1.1). */

:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1rem 2rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: #fafafa;
  transition: padding-bottom 0.15s ease;
}

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

.page {
  max-width: 640px;
  margin: 0 auto;
  padding-top: 2rem;
}

.page__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 1rem;
}

.page__eyebrow a {
  color: inherit;
  text-decoration: none;
}

/* Privacy policy page (public/privacy-policy.html) only. */
.legal h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.legal h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.legal p,
.legal ul {
  font-size: 0.95rem;
  color: #333;
}

.legal ul {
  padding-left: 1.25rem;
}

.hero h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}

.hero__subcopy {
  font-size: 1rem;
  color: #333;
}

.signup {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
}

.signup label {
  font-weight: 600;
  font-size: 0.9rem;
}

.signup__field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.signup__field-row input[type="email"] {
  flex: 1 1 220px;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.signup__field-row input[aria-invalid="true"] {
  border-color: #b3261e;
}

.signup__field-row button {
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.signup__field-row button:disabled {
  opacity: 0.6;
  cursor: default;
}

.field-error {
  color: #b3261e;
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

.field-error--submit {
  margin-top: 0.75rem;
}

.signup__microcopy,
.signup__consent {
  font-size: 0.8rem;
  color: #666;
  margin: 0.75rem 0 0;
}

.signup__consent a {
  color: #1a56db;
}

.signup__success {
  padding: 1rem;
  background: #eafaf0;
  border: 1px solid #b7e4c7;
  border-radius: 6px;
  color: #1e4620;
}

/* Author `display: flex` below otherwise beats the browser's built-in
   `[hidden] { display: none }` UA rule regardless of specificity/order
   (author-normal always wins over user-agent-normal in the cascade), so
   toggling the `hidden` attribute via JS (cookie-banner.js) would
   silently do nothing without this override — the banner would render
   permanently and never dismiss on Accept/Decline, nor stay hidden for a
   returning visitor who already chose. Higher specificity than
   `.cookie-banner` alone ensures this wins whenever `hidden` is set. */
.cookie-banner[hidden] {
  display: none;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.cookie-banner__text {
  margin: 0;
  font-size: 0.85rem;
  flex: 1 1 240px;
}

.cookie-banner__text a {
  color: #9ec1ff;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.cookie-banner__actions button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

#cookie-accept {
  background: #1a56db;
  color: #fff;
}

#cookie-decline {
  background: transparent;
  color: #fff;
  border-color: #777;
}

@media (max-width: 480px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cookie-banner__actions {
    justify-content: center;
  }

  /* Same flex-basis-becomes-height bug as the email input fix below, in
     a different element: `.cookie-banner__text`'s `flex: 1 1 240px` is a
     *width* hint for the row layout above 480px, but `.cookie-banner`
     switches to `flex-direction: column` here, so 240px is read as a
     *height* on the now-vertical main axis. This was already live in
     production and pre-dates this fix pass, but was masked: the
     ~220px-tall broken email input (fixed below) pushed the submit
     button off-screen, so the banner's own oversized text block
     (measured ~240px tall) never visibly collided with it. Fixing the
     email input alone would have newly exposed this — a ~312px-tall
     banner covering the email field *and* submit button on phone
     viewports — as a regression against the test report's explicitly
     passed "banner does not vertically overlap submit button" check.
     Reset flex-basis so the text sizes by content instead. */
  .cookie-banner__text {
    flex-basis: auto;
  }

  .signup__field-row {
    flex-direction: column;
    align-items: stretch;
  }

  /* Bug fix (post-/test): in the row layout above 480px, `flex: 1 1 220px`
     on the email input uses 220px as a *width* hint on the horizontal main
     axis. Once the column layout above switches the main axis to vertical,
     the same flex-basis is read as a *height* instead, producing a
     ~220px-tall broken-looking input on every phone-width viewport. Reset
     flex-basis to auto and let the input size itself by content/padding
     (a normal single-line field) at these widths; width is already 100%
     via `align-items: stretch` on the column flex container. */
  .signup__field-row input[type="email"] {
    flex-basis: auto;
  }
}
