/* =====================================================================
   The Fairstone Platform page (template-platform.php).
   Ported from specs/001-platform-landing-page/design/index.html. Scoped to
   .fp-page so nothing outside this page changes.
   ===================================================================== */

/* ---------- Tokens ---------- */
.fp-page {
  --fp-purple: #24174c;
  --fp-lilac: #7c6992;
  /* Fairstone Green. Swap these three for Jamie's accessible version (FR-022). */
  --fp-green: #29bb89;
  --fp-green-hover: #1e8d67;
  --fp-on-green: #fff;
  --fp-lavender: #f1f1f6;
  --fp-paper: #fff;
  --fp-ink: #24174c;
  --fp-text: #2c3e50;
  --fp-muted: #5e6673;
  --fp-hair: #e3e1ec;
  --fp-display: 'Montserrat', Arial, Helvetica, sans-serif;
  --fp-body: 'Open Sans', Arial, Helvetica, sans-serif;
  --fp-gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --fp-gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --fp-shadow: 0 0 30px 0 rgba(62, 46, 99, .14);

  display: block;
  /* The app-screen images carry their shadow as padding, which can reach past the window
     edge at some widths; clip it rather than let the page scroll sideways. */
  overflow-x: clip;
  background: var(--fp-paper);
  color: var(--fp-text);
  font-family: var(--fp-body);
  font-size: 16px;
  line-height: 1.63;
  letter-spacing: .32px;
}

/* ---------- Base (overrides the theme's global rules inside the page) ---------- */
.fp-page *,
.fp-page *::before,
.fp-page *::after { box-sizing: border-box; }
.fp-page h1,
.fp-page h2,
.fp-page h3 {
  font-family: var(--fp-display);
  color: var(--fp-ink);
  line-height: 1.22;
  margin: 0;
  text-wrap: balance;
}
/* style.css forces every heading to 500 with !important; the design's H3s are 600. */
.fp-page h3 { font-weight: 600 !important; }
/* :where() keeps these resets at element specificity, so single-class rules below win. */
:where(.fp-page) p { margin: 0; }
:where(.fp-page) ul { margin: 0; padding: 0; list-style: none; }
:where(.fp-page) a { color: inherit; text-decoration: none; }
.fp-page a:hover { text-decoration: none; }
.fp-page a:focus-visible {
  outline: 3px solid var(--fp-green);
  outline-offset: 3px;
  border-radius: 4px;
}
.fp-page img { max-width: 100%; }

.fp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--fp-gutter-l);
  padding-right: var(--fp-gutter-r);
}
.fp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fp-chev { width: 12px; height: 12px; flex: none; }

/* Buttons, as the site sets them */
.fp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 24px;
  border-radius: 4px;
  font-family: var(--fp-body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.fp-button--green {
  background: var(--fp-green);
  border-color: var(--fp-green);
  color: var(--fp-on-green);
}
.fp-button--green:hover {
  background: var(--fp-green-hover);
  border-color: var(--fp-green-hover);
  color: var(--fp-on-green);
}

/* Bands */
.fp-band { padding-block: 72px; }
.fp-band--lav { background: var(--fp-lavender); }
.fp-band--purple {
  background: var(--fp-purple);
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.fp-band h2 { font-size: 30px; margin-bottom: 16px; }
.fp-band--purple h2 { color: #fff; }
.fp-eyebrow {
  font-family: var(--fp-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fp-lilac);
  margin-bottom: 12px;
}
.fp-band--purple .fp-eyebrow { color: var(--fp-green); }
.fp-two {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
}
.fp-lead-copy { max-width: 36em; }
.fp-lead-copy p + p { margin-top: 14px; }
.fp-section-intro { margin-bottom: 32px; }

/* App screens: images are the phone plus its shadow (440 x 777 at 1x around a
   300 x 617 phone), so size by the phone and let the shadow fall outside it. */
.fp-phone {
  position: relative;
  width: calc(300px * var(--s, 1));
  aspect-ratio: 300 / 617;
  flex: none;
}
.fp-phone img {
  position: absolute;
  left: -23.333%;
  top: -12.966%;
  width: 146.667%;
  max-width: none;
  height: auto;
  display: block;
}

/* Store badges */
.fp-stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}
.fp-store { display: inline-block; line-height: 0; border-radius: 7px; }
.fp-page .fp-store img { height: 48px; width: auto; display: block; }
.fp-page .fp-store img.fp-store__gp { height: 62px; margin-inline: -6px; }
.fp-store:hover { opacity: .92; }

/* Faint Fairstone icon on purple bands */
.fp-page .fp-device {
  position: absolute;
  width: min(62vw, 760px);
  opacity: .07;
  z-index: -1;
  pointer-events: none;
}

@media (max-width: 900px) {
  .fp-band { padding-block: 52px; }
  .fp-band h2 { font-size: 26px; }
  .fp-two { grid-template-columns: 1fr; gap: 32px; }
  .fp-stores { gap: 10px; }
  .fp-page .fp-store img { height: 46px; }
  .fp-page .fp-store img.fp-store__gp { height: 60px; }
}

/* ---------- Hero ---------- */
.fp-hero {
  background: var(--fp-purple);
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.fp-hero .fp-device { right: -6%; top: -18%; }
.fp-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 48px;
  align-items: center;
  padding-block: 56px;
}
.fp-crumb {
  font-size: 14px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, .85);
}
.fp-crumb > span,
.fp-crumb > span > span { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fp-crumb a { color: var(--fp-green); font-weight: 700; }
.fp-crumb a:hover { text-decoration: underline; }
.fp-hero h1 {
  color: #fff;
  font-size: 36px;
  letter-spacing: .73px;
  margin-bottom: 18px;
}
.fp-hero__lead {
  font-size: 18px;
  line-height: 1.63;
  max-width: 34em;
  color: rgba(255, 255, 255, .92);
}
.fp-portal-link {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  border-bottom: 2px solid var(--fp-green);
  padding-bottom: 3px;
}
.fp-page .fp-portal-link { color: #fff; }
.fp-page .fp-portal-link:hover { color: var(--fp-green); }
.fp-hero__visual {
  position: relative;
  height: 500px;
  max-width: 100%;
  justify-self: end;
  width: 430px;
}
.fp-hero__visual .fp-phone { position: absolute; bottom: 0; }
.fp-hero__visual .fp-phone--front { right: 0; --s: .78; z-index: 1; }
.fp-hero__visual .fp-phone--back { right: 204px; bottom: 60px; --s: .66; }

@media (max-width: 900px) {
  .fp-hero__inner { grid-template-columns: 1fr; gap: 24px; padding-block: 36px 44px; }
  .fp-hero h1 { font-size: 34px; }
  .fp-hero__lead { font-size: 17px; }
  .fp-hero__visual { width: 340px; height: 420px; justify-self: center; margin-top: 12px; }
  .fp-hero__visual .fp-phone--front { --s: .66; }
  .fp-hero__visual .fp-phone--back { right: 150px; bottom: 48px; --s: .56; }
}

/* ---------- About the platform ---------- */
.fp-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 32px;
}
.fp-features li { display: flex; gap: 14px; align-items: flex-start; }
.fp-tick {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--fp-green);
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.fp-tick svg { width: 14px; height: 14px; }
.fp-features b {
  display: block;
  font-family: var(--fp-display);
  font-weight: 600;
  color: var(--fp-ink);
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 4px;
}
.fp-features p { font-size: 15px; line-height: 1.6; color: var(--fp-text); }

.fp-screens-wrap {
  margin-top: 64px;
  padding-top: 56px;
  border-top: 1px solid var(--fp-hair);
}
.fp-screens-wrap h3 { font-size: 22px; margin-bottom: 32px; }
.fp-screens {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}
.fp-screens li { min-width: 0; }
.fp-screens .fp-phone { margin: 0 auto; --s: .58; }
.fp-screens p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fp-text);
  margin-top: 18px;
  text-align: center;
}

@media (max-width: 1100px) {
  .fp-screens { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
  .fp-screens .fp-phone { --s: .7; }
}
@media (max-width: 700px) {
  .fp-screens-wrap { margin-top: 48px; padding-top: 40px; }
  .fp-screens {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 12px;
    margin-inline: calc(-1 * var(--fp-gutter-l)) calc(-1 * var(--fp-gutter-r));
    padding-inline: var(--fp-gutter-l) var(--fp-gutter-r);
    -webkit-overflow-scrolling: touch;
  }
  .fp-screens li { flex: 0 0 62%; scroll-snap-align: start; }
}
@media (max-width: 600px) {
  .fp-features { grid-template-columns: 1fr; }
}

/* ---------- Interest rate ---------- */
.fp-rate-card {
  background: var(--fp-paper);
  border-radius: 6px;
  box-shadow: var(--fp-shadow);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.fp-rate-figure {
  padding: 44px 48px;
  border-right: 1px solid var(--fp-hair);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fp-rate-figure__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--fp-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
}
.fp-rate-figure__big {
  font-family: var(--fp-display);
  font-weight: 600;
  font-size: 72px;
  line-height: 1;
  color: var(--fp-ink);
  margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
}
.fp-rate-figure__big small {
  font-size: 28px;
  font-weight: 500;
  color: var(--fp-lilac);
  margin-left: 4px;
}
.fp-rate-figure__basis { font-size: 16px; color: var(--fp-text); }
.fp-page .fp-rate-figure__from {
  margin-top: 18px;
  font-size: 14px;
  color: var(--fp-muted);
  padding-top: 18px;
  border-top: 1px solid var(--fp-hair);
}
.fp-rate-figure__from b { color: var(--fp-ink); font-weight: 700; }
.fp-rate-copy { padding: 44px 48px; }
.fp-rate-copy h3 { font-size: 20px; margin-bottom: 10px; }
.fp-rate-copy dl {
  margin: 22px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 22px;
  font-size: 15px;
}
.fp-rate-copy dt { font-weight: 700; color: var(--fp-ink); white-space: nowrap; }
.fp-rate-copy dd { margin: 0; color: var(--fp-text); }

@media (max-width: 900px) {
  .fp-rate-card { grid-template-columns: 1fr; }
  .fp-rate-figure { border-right: 0; border-bottom: 1px solid var(--fp-hair); padding: 32px 24px; }
  .fp-rate-figure__big { font-size: 56px; }
  .fp-rate-copy { padding: 32px 24px; }
  .fp-rate-copy dl { grid-template-columns: 1fr; gap: 4px 0; }
  .fp-rate-copy dd { margin-bottom: 10px; }
}

/* ---------- Documents ---------- */
.fp-docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.fp-doc {
  background: var(--fp-paper);
  border: 1px solid var(--fp-hair);
  border-radius: 6px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  transition: box-shadow .2s ease;
}
.fp-doc:hover { box-shadow: var(--fp-shadow); }
.fp-doc__icon { width: 40px; height: 40px; color: var(--fp-purple); }
.fp-doc h3 { font-size: 19px; }
.fp-doc p { font-size: 15px; color: var(--fp-text); flex: 1; }
.fp-doc__meta { font-size: 13px; color: var(--fp-muted); }
.fp-page .fp-doc__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--fp-purple);
  border-bottom: 2px solid var(--fp-green);
  padding-bottom: 2px;
  align-self: flex-start;
  margin-top: 4px;
}
.fp-page .fp-doc__link:hover { color: var(--fp-green); }

@media (max-width: 900px) {
  .fp-docs { grid-template-columns: 1fr; }
}

/* ---------- Portal and Third ---------- */
.fp-cards2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.fp-card {
  background: var(--fp-paper);
  border-radius: 6px;
  box-shadow: var(--fp-shadow);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fp-card h3 { font-size: 22px; }
.fp-card p { color: var(--fp-text); }
.fp-card__foot { margin-top: auto; padding-top: 10px; }
.fp-card__links { margin: 6px 0 0; display: flex; flex-direction: column; gap: 10px; }
.fp-page .fp-card__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fp-purple);
  font-weight: 700;
  border-bottom: 2px solid var(--fp-green);
  padding-bottom: 2px;
}
.fp-page .fp-card__links a:hover { color: var(--fp-green); }
.fp-card__mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--fp-lavender);
  display: grid;
  place-items: center;
  color: var(--fp-purple);
}
.fp-card__mark svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .fp-cards2 { grid-template-columns: 1fr; }
  .fp-card { padding: 30px 24px; }
}

/* ---------- Help and the app box ---------- */
.fp-band--purple .fp-device { left: -14%; bottom: -48%; width: min(70vw, 760px); }
.fp-help {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: center;
}
.fp-help p { color: rgba(255, 255, 255, .9); max-width: 36em; font-size: 17px; }
.fp-help .fp-button { margin-top: 26px; }
.fp-get-app {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  padding: 32px 36px;
}
.fp-get-app h3 { color: #fff; font-size: 20px; margin-bottom: 8px; }
.fp-help .fp-get-app p { font-size: 15px; color: rgba(255, 255, 255, .85); }
.fp-get-app .fp-stores { margin-top: 20px; }

@media (max-width: 900px) {
  .fp-help { grid-template-columns: 1fr; gap: 32px; }
  .fp-get-app { padding: 26px 22px; }
}

/* ---------- Regulatory disclosures ---------- */
.fp-disclosures { padding-block: 40px; border-top: 1px solid var(--fp-hair); }
.fp-disclosures h2 { font-size: 18px; font-weight: 600 !important; margin-bottom: 10px; }
.fp-disclosures p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--fp-muted);
  max-width: 80em;
}
.fp-disclosures p + p { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .fp-page * { transition: none !important; }
}
