/* Checkout v2 shell styles */

/* ==========================================================================
   REM CONVERSION REFERENCE
   This file is plain CSS (not .scss.liquid), so the per-theme `rem(N)`
   SCSS helper is unavailable here. Hand-written rem values are used so the
   checkout page matches the rest of the workspace's "Firefox Zoom Text
   Only" treatment. Divisor: 1rem = 16px (ibs_checkout has no html
   font-size override, same as Serenity).

   Conversion reference (px -> rem at divisor 16):
     5 -> 0.3125, 6 -> 0.375, 8 -> 0.5, 10 -> 0.625, 12 -> 0.75,
     13 -> 0.8125, 14 -> 0.875, 15 -> 0.9375, 16 -> 1, 18 -> 1.125,
     20 -> 1.25, 24 -> 1.5, 27 -> 1.6875, 30 -> 1.875, 34 -> 2.125,
     40 -> 2.5, 44 -> 2.75, 49 -> 3.0625, 50 -> 3.125, 65 -> 4.0625.
   Letter-spacing: -0.28 -> -0.0175, -1.17 -> -0.073125,
     -1.32 -> -0.0825, -1.47 -> -0.091875, -1.96 -> -0.1225.

   Kept in px per the workspace rulebook: JS-measured offset fallbacks
   (--course-header-height, --course-preview-banner-height,
   --course-shell-side-padding), image dimensions (logo height, avatar
   size), border widths, border-radii, shadow offsets/blur, and
   @media breakpoint values.

   See .cursor/plans/firefox_zoom_text_only_course_product_and_checkout.plan.md
   and the "SCSS Compilation: Confirmed Working In This Workspace" section
   in AGENTS.md for context.
   ========================================================================== */

body#encore-theme.checkout-v2-page {
  --checkout-shell-bg: #f2f2f2;
  background: var(--checkout-shell-bg);
  overflow-x: hidden;
  --course-header-height: 65px;
  --course-preview-banner-height: 0px;
  --course-shell-side-padding: 40px;
  /* Natural max width of the two-column layout at desktop: 524px widget + 16px
     (1rem) gap + 468px info = 1008px. The symmetric gutter below centers a band
     of this width, so the content (which never exceeds it) is centered in the
     viewport instead of left-packed within a wider band. 1008px / 16 = 63rem. */
  --checkout-v2-content-max: 63rem;
  --checkout-v2-content-side-padding: 40px;
  --checkout-v2-content-gutter: max(
    var(--checkout-v2-content-side-padding),
    calc((100vw - var(--checkout-v2-content-max)) / 2)
  );
}

body#encore-theme.checkout-v2-page .checkout-v2-main {
  min-height: 100vh;
  padding-top: var(--course-header-height, 65px);
}

.checkout-v2-page .course-header {
  position: fixed;
  top: var(--course-preview-banner-height);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--checkout-shell-bg);
  border-bottom: 0;
  padding: 0.9375rem var(--course-shell-side-padding);
}

.checkout-v2-page .course-header__inner {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.checkout-v2-page .course-header__brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.checkout-v2-page .course-header__logo-link {
  display: inline-flex;
  color: #1c1f23;
  text-decoration: none;
  line-height: 1;
}

.checkout-v2-page .course-header__logo-svg {
  width: 100%;
  height: 100%;
  display: block;
  vertical-align: middle;
}

.checkout-v2-page .course-header__logo-img,
.checkout-v2-page .course-header__logo-svg {
  width: auto;
  height: 35px;
  max-width: none;
}

/* Top-right account prompt + login link. Lives in the header only (the
   embedded checkout widget and its "Sign up for free" button are untouched).
   `.course-header__inner` is flex/space-between/align-items:center, so this
   block sits in the right slot and is vertically aligned with the logo. */
.checkout-v2-page .course-header__account {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.125rem 0.375rem; /* 2px row gap / 6px column gap when wrapped */
  min-width: 0;
  text-align: right;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem; /* 15px */
  line-height: 1.25;
}

.checkout-v2-page .course-header__account-prompt {
  color: #454749; /* AA/AAA-cleared muted secondary text (shared with Serenity) */
  font-weight: 400;
}

.checkout-v2-page .course-header__account-link {
  color: #1c1f23;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  /* Neutralize the global `a:hover { filter: brightness(115%) }` so the dark
     link does not wash out on hover; use a deterministic hover instead. */
  -webkit-filter: none;
  filter: none;
  transition: color 120ms ease;
}

.checkout-v2-page .course-header__account-link:hover,
.checkout-v2-page .course-header__account-link:focus {
  color: #000000;
  text-decoration: underline;
  -webkit-filter: none;
  filter: none;
}

.checkout-v2-page .checkout-v2-section {
  background: #f2f2f2;
}

.checkout-v2-page .checkout-v2-container {
  width: 100%;
  margin: 0;
  padding: 3.125rem var(--checkout-v2-content-gutter) 1.5rem;
}

.checkout-v2-page .checkout-v2-intro {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.875rem;
  color: #1c1f23;
}

.checkout-v2-page .checkout-v2-intro__eyebrow {
  margin: 0 0 1.25rem;
  text-transform: uppercase;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.checkout-v2-page .checkout-v2-intro__title {
  margin: 0;
  color: #1c1f23;
  font-family: "p22-mackinac-pro", "Times New Roman", serif;
  font-size: 3.0625rem;
  font-weight: 500;
  letter-spacing: -0.091875rem;
  line-height: 1;
}

.checkout-v2-page .checkout-v2-intro__subtitle {
  margin: 0;
  color: #1c1f23;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
}

.checkout-v2-page .checkout-v2-layout {
  --checkout-v2-card-radius: 15px;
  --checkout-v2-card-shadow: 0 0 16px rgba(0, 0, 0, 0.25);
  --checkout-v2-card-border: 1px solid #d8d8d8;
  display: grid;
  grid-template-columns: minmax(320px, 524px) minmax(300px, 425px);
  justify-content: start;
  gap: 1rem;
  align-items: start;
  margin-left: 0;
  margin-right: 0;
}

.checkout-v2-page .checkout-v2-layout > .checkout-v2-widget-column,
.checkout-v2-page .checkout-v2-layout > .checkout-v2-info-column {
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 0;
}

.checkout-v2-page .checkout-v2-widget-column,
.checkout-v2-page .checkout-v2-info-column {
  width: 100%;
  max-width: none;
  float: none;
  flex: none;
  padding-top: 0;
}

.checkout-v2-page .checkout-v2-widget-column .kjb-embedded-checkout {
  width: 100%;
}

.checkout-v2-page .checkout-v2-widget-column .embedded-checkout.sage-scoped,
.checkout-v2-page .checkout-v2-widget-column .embedded-checkout.sage-scoped .embedded-checkout__body,
.checkout-v2-page .checkout-v2-widget-column .card {
  border-radius: var(--checkout-v2-card-radius) !important;
}

.checkout-v2-page .checkout-v2-widget-column .embedded-checkout.sage-scoped {
  border: var(--checkout-v2-card-border);
  box-shadow: var(--checkout-v2-card-shadow);
  background: #ffffff;
}

.checkout-v2-page .checkout-v2-info-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: auto;
}

.checkout-v2-page .checkout-v2-card {
  background: #ffffff;
  border-radius: var(--checkout-v2-card-radius);
  border: var(--checkout-v2-card-border);
  box-shadow: var(--checkout-v2-card-shadow);
  padding: 1.5rem 1.5rem 1.25rem;
  color: #1c1f23;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.checkout-v2-page .checkout-v2-card__heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.checkout-v2-page .checkout-v2-card__title {
  margin: 0;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
}

.checkout-v2-page .checkout-v2-card__meta {
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.checkout-v2-page .checkout-v2-experts {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.checkout-v2-page .checkout-v2-scroll-fade {
  --checkout-scroll-fade-height: 32px;
  --checkout-scroll-fade-duration: 120ms;
  --checkout-scroll-fade-bg: #ffffff;
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  border-radius: calc(var(--checkout-v2-card-radius) - 2px);
  overflow: hidden;
}

.checkout-v2-page .checkout-v2-scroll-region {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.checkout-v2-page .checkout-v2-scroll-fade--experts {
  margin-top: 0.875rem;
}

.checkout-v2-page .checkout-v2-scroll-fade--learn {
  margin-top: 0.625rem;
}

.checkout-v2-page .checkout-v2-scroll-fade::before,
.checkout-v2-page .checkout-v2-scroll-fade::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--checkout-scroll-fade-height);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity var(--checkout-scroll-fade-duration) ease;
}

.checkout-v2-page .checkout-v2-scroll-fade::before {
  top: 0;
  background: var(--checkout-scroll-fade-bg);
  -webkit-mask-image: linear-gradient(to bottom, #000000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000000 0%, transparent 100%);
}

.checkout-v2-page .checkout-v2-scroll-fade::after {
  bottom: 0;
  background: var(--checkout-scroll-fade-bg);
  -webkit-mask-image: linear-gradient(to top, #000000 0%, transparent 100%);
  mask-image: linear-gradient(to top, #000000 0%, transparent 100%);
}

.checkout-v2-page .checkout-v2-scroll-fade.has-overflow:not(.is-at-top)::before {
  opacity: 1;
}

.checkout-v2-page .checkout-v2-scroll-fade.has-overflow:not(.is-at-bottom)::after {
  opacity: 1;
}

.checkout-v2-page .checkout-v2-experts__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  padding: 0 0 0.625rem;
}

.checkout-v2-page .checkout-v2-experts__item:last-child {
  padding-bottom: 0;
}

.checkout-v2-page .checkout-v2-experts__avatar {
  --checkout-expert-avatar-size: 60px;
  --checkout-expert-avatar-bg: #e8e3db;
  --checkout-expert-avatar-scale: 1.4;
  --checkout-expert-avatar-shift-y: 15px;
  width: var(--checkout-expert-avatar-size);
  height: var(--checkout-expert-avatar-size);
  border-radius: 999px;
  background: var(--checkout-expert-avatar-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.checkout-v2-page .checkout-v2-experts__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateY(var(--checkout-expert-avatar-shift-y)) scale(var(--checkout-expert-avatar-scale));
  transform-origin: center center;
  display: block;
}

.checkout-v2-page .checkout-v2-experts__meta {
  min-width: 0;
}

.checkout-v2-page .checkout-v2-experts__name {
  margin: 0;
  color: #1c1f23;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.checkout-v2-page .checkout-v2-experts__role {
  margin: 0;
  color: #1c1f23;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
}

.checkout-v2-page .checkout-v2-learn-list {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.checkout-v2-page .checkout-v2-learn-list ol {
  margin: 0;
  padding-left: 1.6875rem;
  list-style-position: outside;
}

.checkout-v2-page .checkout-v2-learn-list li::marker {
  font-variant-numeric: tabular-nums;
}

.checkout-v2-page .checkout-v2-learn-list li {
  color: #1c1f23;
  font-family: "sofia-pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 0.125rem;
}

@media (min-width: 992px) {
  .checkout-v2-page .checkout-v2-layout {
    align-items: stretch;
    grid-template-columns: minmax(320px, 524px) 468px;
  }

  .checkout-v2-page .checkout-v2-info-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: auto;
  }

  .checkout-v2-page .checkout-v2-card--experts,
  .checkout-v2-page .checkout-v2-card--learn {
    /* Intentionally decoupled from checkout widget height for load stability;
       per AGENTS.md "Checkout v2 Layout Stability Decision". Card height
       stays in px; internal typography/spacing reflows via rem under text
       zoom and the scroll-fade architecture handles content overflow. */
    height: 275px;
    min-height: 275px;
    max-height: 275px;
  }
}

@media (max-width: 991px) {
  .checkout-v2-page .checkout-v2-intro__eyebrow {
    margin-bottom: 1rem;
  }

  body#encore-theme.checkout-v2-page {
    --course-header-height: 52px;
  }

  /* Compact header at tablet (parity with Serenity/Momentum): symmetric
     padding drives the rendered height to match the
     `--course-header-height` var so CSS, DOM, and JS-measured runtime
     value all agree (the JS in `checkout_v2.js` re-measures and overwrites
     the var post-mount; this rule eliminates the pre-JS layout jump).
     11px padding + 30px logo + 11px padding = 52px (no border-bottom on
     the checkout header). 0.6875rem = 11px at the project's 16px rem base. */
  .checkout-v2-page .course-header {
    padding-top: 0.6875rem;
    padding-bottom: 0.6875rem;
  }

  .checkout-v2-page .course-header__logo-img,
  .checkout-v2-page .course-header__logo-svg {
    width: auto;
    height: 30px;
  }

  .checkout-v2-page .checkout-v2-container {
    padding-top: 2.5rem;
    padding-bottom: 1.25rem;
  }

  .checkout-v2-page .checkout-v2-intro__title {
    font-size: 2.75rem;
    letter-spacing: -0.0825rem;
  }

  .checkout-v2-page .checkout-v2-layout {
    grid-template-columns: minmax(300px, 1fr);
    gap: 1.25rem;
  }

  .checkout-v2-page .checkout-v2-info-column {
    order: 2;
  }

  .checkout-v2-page .checkout-v2-widget-column {
    order: 1;
  }

  .checkout-v2-page .checkout-v2-widget-column,
  .checkout-v2-page .checkout-v2-info-column {
    margin-bottom: 0;
  }

  .checkout-v2-page .checkout-v2-info-stack {
    height: auto;
  }

  .checkout-v2-page .checkout-v2-card--experts,
  .checkout-v2-page .checkout-v2-card--learn {
    flex: 0 0 auto;
    min-height: auto;
  }

  .checkout-v2-page .checkout-v2-scroll-region {
    max-height: none;
    overflow: auto;
    min-height: auto;
  }
}

@media (max-width: 767px) {
  .checkout-v2-page .checkout-v2-intro__eyebrow {
    margin-bottom: 0.75rem;
  }

  body#encore-theme.checkout-v2-page {
    --course-header-height: 52px;
    --course-shell-side-padding: 20px;
    --checkout-v2-content-side-padding: 20px;
  }

  .checkout-v2-page .course-header {
    display: flex;
    align-items: center;
    /* 3.25rem = 52px at the project's 16px rem base. */
    min-height: 3.25rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: var(--course-shell-side-padding);
    padding-right: var(--course-shell-side-padding);
  }

  .checkout-v2-page .course-header__inner {
    min-height: 3.25rem;
  }

  .checkout-v2-page .course-header__logo-img,
  .checkout-v2-page .course-header__logo-svg {
    width: auto;
    height: 25px;
    max-width: none;
  }

  /* On narrow viewports, shrink the account block and let the prompt wrap
     above the link so it never overlaps the logo lockup. The `__inner` gap
     keeps brand and account separated. */
  .checkout-v2-page .course-header__account {
    flex: 0 1 auto;
    font-size: 0.8125rem; /* 13px */
    line-height: 1.2;
  }

  .checkout-v2-page .checkout-v2-container {
    padding-top: 1.875rem;
    padding-bottom: 1rem;
  }

  .checkout-v2-page .checkout-v2-intro {
    margin-bottom: 1.5rem;
  }

  .checkout-v2-page .checkout-v2-intro__title {
    /* clamp floor/ceiling in rem so text-only zoom grows past the ceiling;
       vw middle term stays for viewport scaling. */
    font-size: clamp(2.125rem, 12.5vw, 3.0625rem);
    letter-spacing: -0.1225rem;
  }

  .checkout-v2-page .checkout-v2-intro__subtitle {
    font-size: 0.9375rem;
  }

  .checkout-v2-page .checkout-v2-card {
    padding: 1.25rem 1.125rem 1rem;
  }
}
