/*
 * Viasat in-flight survey landing page
 * Minimal and centered: white logo, one message, one white button, small legal links.
 * Everything fits on one screen; the background image fills it. A OneTrust cookie banner sits at the bottom,
 * and the page lays out above it while it is showing. Also used by 404.html.
 */

/* ---------- Tokens ---------- */
:root {
  --bg: #173d55;                     /* shown while the image loads; sampled from the image */
  --scrim: rgba(6, 28, 48, 0.3);     /* light tint over the image so white text stays readable on the bright glow */
  --white: #ffffff;
  --text-faint: rgba(255, 255, 255, 0.7);
  --button-text: #0d3047;            /* deep navy from the image's darkest areas */
  --button-hover: #e4f2f3;

  --font: "Ubuntu Sans", "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* 1% of the visible screen height (with browser toolbars showing, where supported) */
  --vh: 1vh;
  /* Height of the cookie banner while it is showing; set by landing.js, 0 once it is dismissed */
  --banner-h: 0px;
  /* Space the legal links take at the bottom of the screen: one line plus the page's bottom padding */
  --legal-zone: calc(19px + clamp(20px, calc(4 * var(--vh)), 40px));
}
@supports (height: 1svh) {
  :root { --vh: 1svh; }
}

/* ---------- Base ---------- */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--scrim), var(--scrim)), url("/assets/background.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout: logo at the top, message centered, legal links at the bottom ---------- */
.landing {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  min-height: calc(100 * var(--vh));
  /* The top padding tightens a little while the cookie banner is showing, so the button stays above it on phones */
  padding: clamp(24px, calc(8 * var(--vh) - var(--banner-h) / 5), 88px) clamp(24px, 8vw, 64px) clamp(20px, calc(4 * var(--vh)), 40px);
  text-align: center;
}

.logo {
  display: block;
  width: auto;
  height: clamp(30px, calc(5 * var(--vh)), 44px);
}

.message {
  align-self: center;
  max-width: 40rem;
  /* While the cookie banner is showing, the message is centered in the space between the logo and the banner;
     the legal links sit behind the banner like any footer */
  margin-bottom: max(0px, calc(var(--banner-h) - var(--legal-zone)));
  padding-block: clamp(8px, calc(6 * var(--vh) - var(--banner-h) / 3), 72px);
}

/* Phones: the logo, message and button travel as one block, centered in the space above the legal links
   (or above the cookie banner while it is showing), with equal room above the logo and below the button */
@media (max-width: 767px) {
  .landing {
    grid-template-rows: minmax(16px, 1fr) auto auto minmax(16px, 1fr) auto;
    padding-top: 0;
  }
  .logo {
    grid-row: 2;
    margin-bottom: clamp(28px, calc(5 * var(--vh)), 40px);
  }
  .message {
    grid-row: 3;
    padding-block: 0;
  }
  .legal { grid-row: 5; }
}

h1 {
  margin: 0;
  font-size: clamp(26px, calc(1.6vw + 18px), 44px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 strong { font-weight: 700; }
.nowrap { white-space: nowrap; }

.invite {
  margin: clamp(20px, calc(3.4 * var(--vh)), 32px) 0 0;
  font-size: clamp(16px, calc(0.3vw + 15px), 19px);
  font-weight: 400;
  text-wrap: balance;
}
.invite strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.12em;
  font-weight: 700;
}

/* ---------- White button ---------- */
.cta {
  display: inline-flex;
  vertical-align: top; /* no stray line space under the button, so it centers true */
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  height: 52px;
  margin-top: clamp(20px, calc(3.4 * var(--vh)), 32px);
  padding: 0 40px;
  border-radius: 999px;
  background: var(--white);
  color: var(--button-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(4, 22, 40, 0.25);
}
.cta:hover { background: var(--button-hover); }
.cta:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 4px;
}
/* Shown disabled until the survey link is set (no href, aria-disabled="true") */
.cta[aria-disabled="true"] {
  opacity: 0.55;
  box-shadow: none;
  cursor: not-allowed;
}
.cta[aria-disabled="true"]:hover { background: var(--white); }

/* ---------- Legal links ---------- */
.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 13px;
}
.legal a,
.legal button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-faint);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.legal a:hover,
.legal button:hover {
  color: var(--white);
  text-decoration: underline;
}
.legal a:focus-visible,
.legal button:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- OneTrust banner and preference center: match the page font ---------- */
#onetrust-consent-sdk, #onetrust-consent-sdk * { font-family: "Ubuntu Sans", Arial, sans-serif !important; }
