/* =============================================================
   Forward Finance — Products page
   Companion to pages/products.html.
   Link order: fonts.css → tokens.css → site.css → products.css

   Shared chrome (reset, nav, buttons, hero shell, section shells,
   CTA band, footer) lives in site.css. This file only holds what is
   specific to the products page: the hero product tiles and the
   three product cards.
   ============================================================= */


/* -------------------------------------------------------------
   Hero product tiles (right column)
   ------------------------------------------------------------- */
.phero-tiles { display: flex; flex-direction: column; gap: 14px; }

.ptile {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #171f28;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 18px 20px;
  transition: transform .22s var(--ease-forward), border-color .22s var(--ease-forward);
}
.ptile:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.2); }

.ptile-ico {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}
.ptile-ico svg { width: 21px; height: 21px; }
.ptile.is-gold .ptile-ico { background: rgba(229, 173, 67, 0.16); color: var(--ff-gold-bright); }
.ptile.is-blue .ptile-ico { background: rgba(0, 99, 255, 0.18); color: #6BA6FF; }
.ptile.is-muted .ptile-ico { background: rgba(255, 255, 255, 0.07); color: var(--neutral-400); }

.ptile-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ptile-t { font-size: 15.5px; font-weight: 600; color: #fff; }
.ptile-s { font-size: 13px; color: rgba(255, 255, 255, 0.55); }

/* sits directly on the light hero, not inside one of the dark tiles */
.ptile-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 4px;
  padding-left: 4px;
}
.ptile-note svg { width: 15px; height: 15px; color: var(--ff-gold-deep); flex-shrink: 0; }


/* -------------------------------------------------------------
   Product cards
   ------------------------------------------------------------- */
.pcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-1);
  border-radius: 20px;
  padding: 30px;
  height: 100%;
  transition: box-shadow .22s var(--ease-forward), transform .22s var(--ease-forward);
}
.pcard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
/* The coming-soon card sits on the same white surface as the others — the
   badge alone carries the "not live yet" signal. */

.pcard-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--ff-gold);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
}

.pcard-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--neutral-100);
  margin-bottom: 22px;
}
.pcard-ico svg { width: 22px; height: 22px; color: var(--fg-2); }
.pcard-ico.is-gold { background: rgba(229, 173, 67, 0.22); }
.pcard-ico.is-gold svg { color: var(--ff-gold-deep); }
.pcard-ico.is-blue { background: rgba(0, 99, 255, 0.09); }
.pcard-ico.is-blue svg { color: var(--fw-blue); }
.pcard-ico.is-muted { background: var(--neutral-200); }
.pcard-ico.is-muted svg { color: var(--neutral-500); }

.pcard h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.pcard-lead { font-size: 14.5px; line-height: 1.6; color: var(--fg-2); margin-top: 12px; }

.pcard-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-1);
}
.pcard-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-2);
}
.pcard-list svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--status-success);
}
.pcard.is-soon .pcard-list svg { color: var(--neutral-400); }

/* The list absorbs the card's spare height, so all three CTAs line up on
   the same baseline even though the copy lengths differ. */
.pcard-list { flex: 1 0 auto; }
.pcard-cta { margin-top: 26px; justify-content: center; width: 100%; }


/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 1024px) {
  /* three cards get cramped before the hero does — go 1-up here and let
     the copy breathe rather than squeezing 3 columns */
  .pcards { grid-template-columns: 1fr; gap: 18px; max-width: 720px; margin: 0 auto; }
  .pcard-list { flex: 0 0 auto; }
}

@media (max-width: 900px) {
  .phero-tiles { max-width: 560px; }
}

@media (max-width: 768px) {
  .phero-tiles { max-width: none; gap: 12px; }
  .ptile { padding: 15px 16px; gap: 13px; border-radius: 16px; }
  .ptile-ico { width: 38px; height: 38px; border-radius: 10px; }
  .ptile-ico svg { width: 19px; height: 19px; }
  .ptile-t { font-size: 14.5px; }
  .ptile-s { font-size: 12.5px; }

  .pcards { max-width: none; gap: 16px; }
  .pcard { padding: 24px; }
  .pcard:hover { transform: none; }
  .pcard h3 { font-size: 18.5px; }
  .pcard-badge { top: 16px; right: 16px; }
}

@media (max-width: 480px) {
  .ptile-t { font-size: 14px; }
  .ptile-s { font-size: 12px; }

  .pcard { padding: 20px; }
  .pcard-ico { margin-bottom: 18px; }
  /* keep the badge clear of the heading on the narrowest screens */
  .pcard.is-soon h3 { padding-right: 92px; }
}


/* =============================================================
   Product detail modals
   Native <dialog>, so focus trapping, Esc-to-close, inert
   background and the backdrop come from the platform.

   The dialog itself is a full-viewport transparent flex container
   and the visible card is .pmodal-panel inside it — that way a
   click landing on the dialog is unambiguously a backdrop click.
   Dark surface to match the hero tiles and the CTA band.
   ============================================================= */
.pmodal {
  width: 100vw;
  max-width: 100vw;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 16px;
  border: none;
  background: transparent;
  overflow: hidden;
}
.pmodal[open] { display: flex; align-items: center; justify-content: center; }
.pmodal::backdrop { background: rgba(6, 10, 15, 0.72); }

/* The panel itself does not scroll — .pmodal-scroll inside it does. That keeps
   the close button pinned to the panel corner instead of drifting with the
   text, and keeps the rounded corners clipping the scroll edge cleanly. */
.pmodal-panel {
  position: relative;
  display: flex;
  width: min(600px, 100%);
  max-height: min(88vh, 920px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: #171f28;
  color: #fff;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.pmodal-scroll {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;

  /* Standard properties — Firefox, and Chrome 121+ where these take priority
     over the -webkit- pseudo-elements below. The default scrollbar is a wide
     light-grey bar that reads as a system artefact on a dark panel. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* Older Chrome / Safari fall back to these. The transparent border plus
   background-clip: content-box insets the thumb so it reads as a slim floating
   pill rather than filling the gutter edge to edge. */
.pmodal-scroll::-webkit-scrollbar { width: 11px; }
.pmodal-scroll::-webkit-scrollbar-track { background: transparent; }
.pmodal-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
}
.pmodal-scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.36); }
.pmodal-scroll::-webkit-scrollbar-corner { background: transparent; }

/* Pinned to the panel, above the scrolling content. Absolute rather than
   float/sticky: the panel is a flex container, which ignores float and would
   otherwise lay the button out as the first flex item on the left. Absolute
   positioning also takes it out of flex flow entirely. */
.pmodal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(23, 31, 40, 0.9);
  color: rgba(255, 255, 255, 0.7);
  z-index: 2;
  transition: color .18s, border-color .18s, background .18s;
}
.pmodal-x svg { width: 15px; height: 15px; display: block; }
.pmodal-x:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); }

.pmodal-head { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.pmodal-ico {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}
.pmodal-ico svg { width: 21px; height: 21px; }
.pmodal-ico.is-gold { background: rgba(229, 173, 67, 0.16); color: var(--ff-gold-bright); }
.pmodal-ico.is-blue { background: rgba(0, 99, 255, 0.18); color: #6BA6FF; }
.pmodal-ico.is-muted { background: rgba(255, 255, 255, 0.07); color: var(--neutral-400); }

.pmodal-head h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.pmodal-badge {
  align-self: flex-start;
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--ff-gold);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  white-space: nowrap;
}

.pmodal-lead {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 16px;
}

.pmodal-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ff-gold-bright);
  margin-top: 28px;
}

/* key benefits */
.pmodal-benefits { display: flex; flex-direction: column; gap: 11px; margin-top: 16px; }
.pmodal-benefits li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}
.pmodal-benefits svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #3FBF84;
}

/* how it works — numbered steps via a counter */
.pmodal-steps { counter-reset: pstep; margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.pmodal-steps li { counter-increment: pstep; position: relative; padding-left: 40px; }
.pmodal-steps li::before {
  content: counter(pstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #6BA6FF;
  background: rgba(0, 99, 255, 0.18);
}
.pmodal-steps h4 { font-size: 14.5px; font-weight: 600; color: #fff; line-height: 1.35; }
.pmodal-steps p {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.pmodal-foot {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.pmodal-cta { width: 100%; justify-content: center; }
/* pre-launch: the action is present but deliberately inert */
.pmodal-cta[disabled] {
  cursor: not-allowed;
  opacity: .55;
  background: var(--fw-blue-deep);
}

@media (max-width: 768px) {
  .pmodal { padding: 10px; }
  .pmodal-panel { max-height: 92vh; padding: 22px 20px; border-radius: 18px; }
  .pmodal-head { gap: 12px; padding-right: 36px; }
  .pmodal-head h2 { font-size: 18.5px; }
  .pmodal-ico { width: 38px; height: 38px; }
  .pmodal-ico svg { width: 19px; height: 19px; }
  .pmodal-badge { display: none; }   /* the CTA already says "coming soon" */
  .pmodal-lead { font-size: 14.5px; margin-top: 14px; }
  .pmodal-h { margin-top: 24px; }
  .pmodal-benefits li { font-size: 13.5px; }
  .pmodal-steps li { padding-left: 36px; }
}
