/* API integration page. Everything is scoped under .ap-page */

.ap-page {
  --ap-orange: #f5a028;
  --ap-orange-dark: #e8901a;
  --ap-dark: #121212;
  --ap-black: #000000;
  --ap-white: #ffffff;
  --ap-font-heading: "Poppins", sans-serif;
  --ap-font-body: "Inter", sans-serif;
  --ap-text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);

  font-family: var(--ap-font-body);
  color: var(--ap-black);
  overflow-x: clip;
}

.ap-page *,
.ap-page *::before,
.ap-page *::after {
  box-sizing: border-box;
}

/* Blocks use <div> rather than <section>: the old responsive.css forces
   `section { padding: 40px 0 !important }` on mobile.
   Undo the old heading underline inside the new design. */
.ap-page h1::after,
.ap-page h2::after {
  content: none;
}

/* 1280px content width (as in Figma) + 20px side padding */
.ap-page .ap-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */

.ap-page .ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 200px;
  height: 60px;
  padding: 0 32px;
  border-radius: 100px;
  font-family: var(--ap-font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.ap-page .ap-btn--primary {
  background: var(--ap-orange);
  color: var(--ap-black);
}

.ap-page .ap-btn--primary:hover,
.ap-page .ap-btn--primary:focus {
  background: var(--ap-orange-dark);
  color: var(--ap-black);
  transform: translateY(-1px);
}

.ap-page .ap-btn--outline {
  border: 1px solid var(--ap-white);
  background: transparent;
  color: var(--ap-white);
}

.ap-page .ap-btn--outline:hover,
.ap-page .ap-btn--outline:focus {
  background: var(--ap-white);
  color: var(--ap-black);
  transform: translateY(-1px);
}

.ap-page .ap-btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Hero ---------- */

.ap-page .ap-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 576px;
  overflow: hidden;
  background: var(--ap-dark);
}

.ap-page .ap-hero__bg,
.ap-page .ap-hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ap-page .ap-hero__bg img {
  object-fit: cover;
  object-position: center;
}

/* dark fade on the left so the white text stays readable */
.ap-page .ap-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(18, 18, 18, 0.5) 0%,
    rgba(18, 18, 18, 0.2) 50%,
    rgba(18, 18, 18, 0) 75%
  );
  pointer-events: none;
}

.ap-page .ap-hero .ap-container {
  position: relative;
  z-index: 1;
}

.ap-page .ap-hero__content {
  max-width: 640px;
  padding: 56px 0;
  text-align: left;
}

.ap-page .ap-hero__title {
  margin: 0 0 96px;
  color: var(--ap-white);
  font-family: var(--ap-font-heading);
  font-size: 64px;
  font-weight: 600;
  line-height: 68px;
  letter-spacing: -2px;
  text-align: inherit;
  text-shadow: var(--ap-text-shadow);
}

.ap-page .ap-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1199px) {
  .ap-page .ap-hero {
    min-height: 460px;
  }

  .ap-page .ap-hero__title {
    margin-bottom: 64px;
    font-size: 48px;
    line-height: 54px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .ap-page .ap-container {
    padding: 0 16px;
  }

  .ap-page .ap-hero {
    min-height: 340px;
  }

  .ap-page .ap-hero::after {
    background: rgba(18, 18, 18, 0.4);
  }

  .ap-page .ap-hero__content {
    max-width: none;
    padding: 40px 0;
    text-align: center;
  }

  .ap-page .ap-hero__title {
    margin: 0 auto 32px;
    font-size: 28px;
    line-height: 32px;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  }

  .ap-page .ap-hero__actions {
    flex-direction: column;
    gap: 12px;
  }

  .ap-page .ap-hero__actions .ap-btn {
    width: 100%;
    height: 48px;
    font-size: 16px;
  }

  .ap-page .ap-btn {
    min-width: 140px;
    height: 44px;
    padding: 0 20px;
    gap: 8px;
    font-size: 14px;
  }

  .ap-page .ap-btn__icon {
    width: 16px;
    height: 16px;
  }
}

/* =====================================================================
   Page body: side menu + sections
   ===================================================================== */

.ap-page {
  --ap-brown: #593636;
  --ap-text: #333333;
  --ap-grey-border: #eaeaea;
}

.ap-page .ap-btn--small {
  min-width: 0;
  height: 44px;
  padding: 0 28px;
  font-family: var(--ap-font-heading);
  font-size: 14px;
  font-weight: 600;
}

.ap-page .ap-link {
  color: var(--ap-orange);
  text-decoration: underline;
}

.ap-page .ap-link:hover,
.ap-page .ap-link:focus {
  color: var(--ap-orange-dark);
}

/* ---------- Layout: side menu + main column ---------- */

.ap-page .ap-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 956px);
  justify-content: space-between;
  align-items: start;
  gap: 40px;
  padding-top: 66px;
}

.ap-page .ap-sidenav {
  position: sticky;
  top: 40px;
}

.ap-page .ap-sidenav__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-page .ap-sidenav__link {
  position: relative;
  display: block;
  padding-left: 11px;
  color: var(--ap-black);
  font-family: var(--ap-font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ap-page .ap-sidenav__link:hover,
.ap-page .ap-sidenav__link:focus,
.ap-page .ap-sidenav__link.is-active {
  color: var(--ap-orange);
}

.ap-page .ap-sidenav__link.is-active::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  width: 2px;
  height: 17px;
  background: var(--ap-orange);
}

/* ---------- Shared section heading ---------- */

.ap-page .ap-section {
  padding-bottom: 96px;
  scroll-margin-top: 40px;
}

.ap-page .ap-section--tight {
  padding-bottom: 56px;
}

.ap-page .ap-heading {
  position: relative;
  max-width: 560px;
  margin: 0 0 40px;
  color: var(--ap-brown);
  font-family: var(--ap-font-heading);
  font-size: 38px;
  font-weight: 600;
  line-height: 46px;
  letter-spacing: -2px;
  text-align: left;
}

/* short orange bar under the heading */
.ap-page .ap-heading::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: -21px;
  width: 26px;
  height: 5px;
  border-radius: 6px;
  background: #ffa527;
}

.ap-page .ap-intro {
  max-width: 820px;
  margin: 0 0 16px;
  color: var(--ap-brown);
  font-family: var(--ap-font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
}

.ap-page .ap-intro--wide {
  max-width: 940px;
}

.ap-page .ap-intro + .ap-btn {
  margin-top: 16px;
}

.ap-page .ap-flow {
  position: relative;
  margin-top: 40px;
  padding: 40px 36px 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ap-dark);
}

.ap-page .ap-flow__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ap-page .ap-flow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.45) 0%,
    rgba(18, 18, 18, 0.1) 60%
  );
  pointer-events: none;
}

.ap-page .ap-flow__title {
  position: relative;
  margin: 0 0 32px;
  color: var(--ap-white);
  font-family: var(--ap-font-heading);
  font-size: 38px;
  font-weight: 700;
  line-height: 46px;
  text-align: left;
  text-transform: uppercase;
  text-shadow: var(--ap-text-shadow);
}

/* Desktop layout (as in Figma):
     [avatar A] [text A] [hub] [text C ---->] [avatar C]
     [avatar B] [text B] [hub]
   Text A/B stops before the hub; only its underline carries on to the middle of the hub
   (the 60px half-hub column) and turns down (A) or up (B) into it with an arrowhead. Text C's underline is an arrow to avatar C.
   Each text sits just above its line: its bottom edge is at the avatar's centre. */
.ap-page .ap-flow__panel {
  --ap-flow-drop: 18px; /* length of the turned-down / turned-up part of arrows A and B */

  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 60px 60px minmax(0, 1fr) 112px;
  grid-template-rows: minmax(112px, auto) minmax(112px, auto);
  align-items: center;
  row-gap: 56px;
  padding: 44px 40px 40px;
  border-radius: 6px;
  background: var(--ap-white);
}

/* the steps' avatar and text are placed straight into the panel grid */
.ap-page .ap-flow__step {
  display: contents;
}

.ap-page .ap-flow__step--a .ap-flow__img {
  grid-row: 1;
  grid-column: 1;
}

.ap-page .ap-flow__step--a .ap-flow__text {
  grid-row: 1;
  grid-column: 2;
}

.ap-page .ap-flow__step--b .ap-flow__img {
  grid-row: 2;
  grid-column: 1;
}

.ap-page .ap-flow__step--b .ap-flow__text {
  grid-row: 2;
  grid-column: 2;
}

.ap-page .ap-flow__hub {
  grid-row: 1 / 3;
  grid-column: 3 / 5;
  display: flex;
  justify-content: center;
}

.ap-page .ap-flow__step--c .ap-flow__text {
  grid-row: 1 / 3;
  grid-column: 5;
}

.ap-page .ap-flow__step--c .ap-flow__img {
  grid-row: 1 / 3;
  grid-column: 6;
}

.ap-page .ap-flow__img {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
}

.ap-page .ap-flow__img--hub {
  width: 120px;
  height: 120px;
}

.ap-page .ap-flow__text {
  position: relative;
  margin: 0;
  padding: 0 0 10px 20px;
  color: var(--ap-brown);
  font-family: var(--ap-font-heading);
  /* sized so the longest text (B) stays within the 112px row; a taller row would stretch the arrows */
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.2px;
  text-align: center;
  /* centred on the avatar, then lifted by half its height: the line underneath lands on the avatar's centre */
  transform: translateY(-50%);
}

.ap-page .ap-flow__step--c .ap-flow__text {
  padding-right: 16px;
}

/* arrow lines */
.ap-page .ap-flow__text::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 0;
  border-color: var(--ap-orange);
  border-style: solid;
  border-width: 0;
}

/* arrowheads: a small square with two borders, rotated to point the right way */
.ap-page .ap-flow__text::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--ap-orange);
  border-bottom: 1px solid var(--ap-orange);
}

/* A: along the bottom, then down into the hub */
.ap-page .ap-flow__step--a .ap-flow__text::after,
.ap-page .ap-flow__step--b .ap-flow__text::after {
  right: -60px; /* on to the middle of the hub */
}

.ap-page .ap-flow__step--a .ap-flow__text::before,
.ap-page .ap-flow__step--b .ap-flow__text::before {
  right: -64px;
}

.ap-page .ap-flow__step--a .ap-flow__text::after {
  top: 100%;
  height: var(--ap-flow-drop);
  border-top-width: 1px;
  border-right-width: 1px;
  border-top-right-radius: 6px;
}

.ap-page .ap-flow__step--a .ap-flow__text::before {
  top: calc(100% + var(--ap-flow-drop) - 8px);
  transform: rotate(45deg);
}

/* B: along the bottom, then up into the hub */
.ap-page .ap-flow__step--b .ap-flow__text::after {
  top: calc(100% - var(--ap-flow-drop));
  height: var(--ap-flow-drop);
  border-bottom-width: 1px;
  border-right-width: 1px;
  border-bottom-right-radius: 6px;
}

.ap-page .ap-flow__step--b .ap-flow__text::before {
  top: calc(100% - var(--ap-flow-drop) + 1px);
  transform: rotate(-135deg);
}

/* C: straight arrow from the hub to the last avatar */
.ap-page .ap-flow__step--c .ap-flow__text::after {
  top: 100%;
  right: 16px;
  border-top-width: 1px;
}

.ap-page .ap-flow__step--c .ap-flow__text::before {
  top: calc(100% - 4px);
  right: 16px;
  transform: rotate(-45deg);
}

/* ---------- Feature + platform cards ---------- */

.ap-page .ap-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 96px;
}

.ap-page .ap-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  border: 1px solid var(--ap-grey-border);
  border-radius: 6px;
  background: var(--ap-white);
}

.ap-page .ap-card__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  object-fit: contain;
}

.ap-page .ap-card__title {
  margin: 0 0 14px;
  color: var(--ap-brown);
  font-family: var(--ap-font-heading);
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.3px;
  text-align: left;
}

.ap-page .ap-card__text,
.ap-page .ap-card__list {
  margin: 0;
  color: var(--ap-brown);
  font-family: var(--ap-font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

.ap-page .ap-card__list {
  padding-left: 18px;
}

.ap-page .ap-card__list li + li {
  margin-top: 6px;
}

.ap-page .ap-card__text strong {
  font-weight: 700;
}

.ap-page .ap-card__link {
  margin-top: auto;
  padding-top: 28px;
  color: var(--ap-orange);
  font-family: var(--ap-font-body);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.ap-page .ap-card__link:hover,
.ap-page .ap-card__link:focus {
  color: var(--ap-orange-dark);
  text-decoration: underline;
}

.ap-page .ap-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  column-gap: 40px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.ap-page .ap-steps__item {
  display: contents;
}

.ap-page .ap-steps__item:nth-child(1) .ap-steps__head {
  grid-row: 2;
}

.ap-page .ap-steps__item:nth-child(2) .ap-steps__head {
  grid-row: 3;
}

.ap-page .ap-steps__item:nth-child(3) .ap-steps__head {
  grid-row: 4;
}

.ap-page .ap-steps__head {
  grid-column: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  max-width: 360px;
  padding: 16px 0 0;
  cursor: pointer;
}

.ap-page .ap-steps__head:focus-visible {
  outline: 2px solid var(--ap-orange);
  outline-offset: 4px;
  border-radius: 4px;
}

/* thin grey line from each step icon down to the next */
.ap-page .ap-steps__item:not(:last-child) .ap-steps__head::after {
  content: "";
  grid-column: 1;
  justify-self: center;
  width: 1px;
  height: 30px;
  margin-top: 16px;
  background: #d3d3d3;
}

.ap-page .ap-steps__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ap-brown);
  color: var(--ap-white);
  transition: background-color 0.3s ease;
}

.ap-page .ap-steps__head:hover .ap-steps__icon,
.ap-page .ap-steps__item.is-current .ap-steps__icon {
  background: var(--ap-orange);
}

.ap-page .ap-steps__icon svg {
  width: 20px;
  height: 20px;
}

.ap-page .ap-steps__text {
  margin: 0;
  color: var(--ap-brown);
  font-family: var(--ap-font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  transition: font-size 0.3s ease;
}

.ap-page .ap-steps__item.is-current .ap-steps__text {
  font-family: var(--ap-font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.ap-page .ap-steps__text a {
  color: var(--ap-orange);
  text-decoration: underline;
}

/* all three pictures share one cell; the current one fades in */
.ap-page .ap-steps__img {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: end;
  display: block;
  width: 100%;
  aspect-ratio: 7 / 5;
  object-fit: contain;
  object-position: right bottom;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ap-page .ap-steps__item.is-current .ap-steps__img {
  opacity: 1;
}

/* carousel dots: mobile only */
.ap-page .ap-steps__dots {
  display: none;
}

/* ---------- Need help: 3 steps with dotted arrows ---------- */

.ap-page .ap-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: 940px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.ap-page .ap-help__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

/* dotted arrow pointing to the next item */
.ap-page .ap-help__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 25px;
  left: 76px;
  right: 0;
  border-top: 2px dotted #b9a9a9;
}

.ap-page .ap-help__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 21px;
  right: -2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #b9a9a9;
}

.ap-page .ap-help__icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.ap-page .ap-help__text {
  max-width: 180px;
  color: var(--ap-brown);
  font-family: var(--ap-font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

/* ---------- Body: tablet ---------- */

@media (max-width: 1199px) {
  .ap-page .ap-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 32px;
  }

  /* Narrow diagram (Figma mobile layout):
       [text A ]   [text B ]
       [avatar A]  [avatar B]
           └──>  [hub]  <──┘
                   |
                   v
               [avatar C]
                [text C]
     The elbow arrows hang off steps A/B, the down arrow off the hub. Their sizes come
     from the three variables below, so tablet and mobile only change the variables. */
  .ap-page .ap-flow__panel {
    --ap-flow-avatar: 96px;
    --ap-flow-col-gap: 32px;
    --ap-flow-row-gap: 48px;

    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-template-areas:
      "a b"
      "hub hub"
      "c c";
    align-items: end;
    column-gap: var(--ap-flow-col-gap);
    row-gap: var(--ap-flow-row-gap);
    padding: 32px 24px;
  }

  .ap-page .ap-flow__step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .ap-page .ap-flow__step--a {
    grid-area: a;
  }

  .ap-page .ap-flow__step--b {
    grid-area: b;
  }

  .ap-page .ap-flow__step--c {
    grid-area: c;
  }

  /* A and B: text above the picture; C: picture above the text */
  .ap-page .ap-flow__step--a .ap-flow__img,
  .ap-page .ap-flow__step--b .ap-flow__img {
    order: 1;
  }

  .ap-page .ap-flow__step--c .ap-flow__img {
    order: -1;
  }

  .ap-page .ap-flow__hub {
    position: relative;
    grid-area: hub;
    justify-content: center;
  }

  .ap-page .ap-flow__img,
  .ap-page .ap-flow__img--hub {
    width: var(--ap-flow-avatar);
    height: var(--ap-flow-avatar);
  }

  .ap-page .ap-flow__text,
  .ap-page .ap-flow__step--c .ap-flow__text {
    padding: 0;
    text-align: center;
    transform: none;
  }

  .ap-page .ap-flow__step--c .ap-flow__text {
    max-width: 260px;
  }

  /* the desktop arrows (drawn on the text) are not used here */
  .ap-page .ap-flow__text::before,
  .ap-page .ap-flow__text::after,
  .ap-page .ap-flow__step .ap-flow__text::before,
  .ap-page .ap-flow__step .ap-flow__text::after {
    content: none;
  }

  /* elbow arrows: down from the middle of avatar A / B, then across to the hub's edge */
  .ap-page .ap-flow__step--a::after,
  .ap-page .ap-flow__step--b::after {
    content: "";
    position: absolute;
    top: calc(100% + 8px);
    height: calc(var(--ap-flow-row-gap) + var(--ap-flow-avatar) / 2 - 8px);
    border: 0 solid var(--ap-orange);
    border-bottom-width: 1px;
  }

  .ap-page .ap-flow__step--a::after {
    left: 50%;
    right: calc(var(--ap-flow-avatar) / 2 + 8px - var(--ap-flow-col-gap) / 2);
    border-left-width: 1px;
    border-bottom-left-radius: 6px;
  }

  .ap-page .ap-flow__step--b::after {
    right: 50%;
    left: calc(var(--ap-flow-avatar) / 2 + 8px - var(--ap-flow-col-gap) / 2);
    border-right-width: 1px;
    border-bottom-right-radius: 6px;
  }

  /* arrowheads: a small square with two borders, rotated to point at the hub */
  .ap-page .ap-flow__step--a::before,
  .ap-page .ap-flow__step--b::before,
  .ap-page .ap-flow__hub::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-right: 1px solid var(--ap-orange);
    border-bottom: 1px solid var(--ap-orange);
  }

  .ap-page .ap-flow__step--a::before,
  .ap-page .ap-flow__step--b::before {
    top: calc(100% + var(--ap-flow-row-gap) + var(--ap-flow-avatar) / 2 - 5px);
  }

  .ap-page .ap-flow__step--a::before {
    right: calc(var(--ap-flow-avatar) / 2 + 9px - var(--ap-flow-col-gap) / 2);
    transform: rotate(-45deg);
  }

  .ap-page .ap-flow__step--b::before {
    left: calc(var(--ap-flow-avatar) / 2 + 9px - var(--ap-flow-col-gap) / 2);
    transform: rotate(135deg);
  }

  /* down arrow from the hub to avatar C */
  .ap-page .ap-flow__hub::after {
    content: "";
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    height: calc(var(--ap-flow-row-gap) - 16px);
    border-left: 1px solid var(--ap-orange);
  }

  .ap-page .ap-flow__hub::before {
    top: calc(100% + var(--ap-flow-row-gap) - 17px);
    left: calc(50% - 3.5px);
    transform: rotate(45deg);
  }

  .ap-page .ap-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* below 992px there is no room for the side menu */
@media (max-width: 991px) {
  .ap-page .ap-layout {
    display: block;
    padding-top: 48px;
  }

  .ap-page .ap-sidenav {
    display: none;
  }
}

/* ---------- Body: mobile ---------- */

@media (max-width: 767px) {
  .ap-page .ap-layout {
    padding-top: 32px;
  }

  .ap-page .ap-section {
    padding-bottom: 56px;
  }

  .ap-page .ap-section--tight {
    padding-bottom: 32px;
  }

  .ap-page .ap-cards {
    margin-bottom: 56px;
  }

  .ap-page .ap-heading {
    margin-bottom: 26px;
    font-size: 22px;
    line-height: 26px;
    letter-spacing: -1px;
  }

  .ap-page .ap-heading::before {
    bottom: -10px;
    width: 20px;
    height: 3px;
  }

  .ap-page .ap-intro {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 19px;
  }

  /* diagram: no photo card on mobile, brown title on white (Figma mobile) */
  .ap-page .ap-flow {
    margin-top: 32px;
    padding: 0;
    border-radius: 0;
    overflow: visible;
    background: none;
  }

  .ap-page .ap-flow::before,
  .ap-page .ap-flow__bg {
    display: none;
  }

  .ap-page .ap-flow__title {
    margin-bottom: 24px;
    color: var(--ap-brown);
    font-size: 18px;
    line-height: 22px;
    text-shadow: none;
  }

  .ap-page .ap-flow__panel {
    --ap-flow-avatar: 76px;
    --ap-flow-col-gap: 16px;
    --ap-flow-row-gap: 40px;

    padding: 0;
    border-radius: 0;
  }

  .ap-page .ap-flow__step {
    gap: 14px;
  }

  .ap-page .ap-flow__text {
    font-size: 13px;
    line-height: 17px;
  }

  .ap-page .ap-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ap-page .ap-card {
    padding: 16px 12px;
  }

  .ap-page .ap-card__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
  }

  .ap-page .ap-card__title {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 18px;
  }

  .ap-page .ap-card__text,
  .ap-page .ap-card__list {
    font-size: 13px;
    line-height: 18px;
  }

  .ap-page .ap-card__list {
    padding-left: 16px;
  }

  .ap-page .ap-card__link {
    padding-top: 16px;
  }

  .ap-page .ap-steps {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .ap-page .ap-steps::-webkit-scrollbar {
    display: none;
  }

  .ap-page .ap-steps__item {
    display: flex;
    flex: 0 0 100%;
    flex-direction: column;
    gap: 16px;
    scroll-snap-align: start;
  }

  .ap-page .ap-steps__head {
    max-width: none;
    padding: 0;
    cursor: default;
  }

  .ap-page .ap-steps__item:not(:last-child) .ap-steps__head::after {
    content: none;
  }

  /* every slide shows its step as the active one */
  .ap-page .ap-steps__item .ap-steps__icon {
    background: var(--ap-orange);
  }

  .ap-page .ap-steps__item .ap-steps__text {
    font-family: var(--ap-font-heading);
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
  }

  .ap-page .ap-steps__img {
    object-position: center;
    opacity: 1;
  }

  .ap-page .ap-steps__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
  }

  .ap-page .ap-steps__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d3d3d3;
  }

  .ap-page .ap-steps__dot.is-active {
    background: var(--ap-orange);
  }

  .ap-page .ap-help {
    gap: 12px;
    margin-top: 24px;
  }

  .ap-page .ap-help__item {
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .ap-page .ap-help__icon {
    width: 40px;
    height: 40px;
  }

  .ap-page .ap-help__item:not(:last-child)::after {
    top: 19px;
    left: calc(50% + 28px);
    right: calc(-50% + 16px);
    border-top-width: 1px;
  }

  .ap-page .ap-help__item:not(:last-child)::before {
    top: 16px;
    right: calc(-50% + 12px);
    border-top-width: 4px;
    border-bottom-width: 4px;
    border-left-width: 5px;
  }

  .ap-page .ap-help__text {
    max-width: none;
    font-size: 12px;
    line-height: 16px;
  }
}
