/*
 * Reserve space for the consent banner so it never sits on top of a
 * sign-in control (TRUTHLYDEV-5424).
 *
 * WHY THIS FILE EXISTS. The banner is `position: fixed` at the bottom of
 * the viewport, and the auth card is vertically centred in that same
 * viewport, so on anything but a tall screen the two occupy the same
 * pixels. Measured with the DE geo cookie before this rule existed, with
 * `disablePageInteraction: false` already set:
 *
 *   1280x720  "I already have an account" (Apple merge), "Use phone"
 *             (merge re-auth) and "Next" (name capture) all returned the
 *             banner from `document.elementFromPoint`.
 *   390x844   every primary control on all seven merge / re-auth /
 *             name-capture screens was covered.
 *   390x600   the email and password FIELDS were covered too, not just
 *             the buttons.
 *
 * `disablePageInteraction: false` does not help with any of that. It
 * stops the library dimming and blocking the page; it says nothing about
 * a fixed element physically occluding what is underneath. The ticket's
 * criterion - "the banner does not obstruct, delay or break sign-in on
 * any path" - is a layout claim, and reserving the space is what
 * satisfies it.
 *
 * HOW IT WORKS. `consent.js` measures the banner and publishes its height
 * as `--tru-consent-reserve` on the root element, 0px when no banner is
 * showing. The page containers add that to their existing bottom padding.
 *
 * Both containers are centring flex boxes with `overflow-y: auto`, so the
 * padding does the right thing in both regimes: when the card fits it
 * centres inside the reduced box and rides above the banner, and when the
 * card overflows the padding becomes scrollable space so the last control
 * can be scrolled clear of it.
 *
 * Loaded AFTER styles.css and styles-v2.css so these win on source order
 * at equal specificity; the `calc()` preserves the safe-area insets those
 * files set rather than replacing them.
 */

/* V2 (Liquid Glass), the default design. */
.v2-page {
  padding-bottom: calc(
    max(var(--v2-space-l), env(safe-area-inset-bottom)) +
      var(--tru-consent-reserve, 0px)
  );
}

/* V1 (legacy), still reachable with `?design=v1`, so it needs the same
   treatment: the 24px comes from `.page` in styles.css. */
.page {
  padding-bottom: calc(24px + var(--tru-consent-reserve, 0px));
}


/*
 * KNOWN LIMITATION, measured rather than assumed.
 *
 * At 390x600 - a phone with the keyboard open, which is exactly when
 * someone is typing a password - the bar renders 301px tall, just over
 * half the viewport. The bulk is not the prose (`.cm__texts` is 130px)
 * but the three buttons, which stack vertically at that width
 * (`.cm__btns` is 171px).
 *
 * Every control on every screen is still REACHABLE there: the reserve
 * above gives the page enough scrollable room, verified by scrolling to
 * each control on all seven merge / re-auth / name-capture screens at
 * 1280x720, 390x844 and 390x600. On the three tallest screens at 390x600
 * one or two controls start underneath the bar and have to be scrolled
 * clear first.
 *
 * Capping `.cm__texts` was tried and removed: at 130px it is already
 * under any sensible cap, so the rule was dead. Putting the three buttons
 * in a row would recover ~114px, but that restyles a vendored component
 * into a cramped layout to fix a case that already works, so it is left
 * alone and recorded here instead.
 */
