/* Legacy-parity text rendering: the old Creditas site sets
 * -webkit-font-smoothing: antialiased globally, which renders type
 * lighter/thinner on macOS. Webflow Code Components live in isolated
 * shadow roots, so this must be declared per-component on :host to
 * inherit into the shadow tree (the property does not cross the
 * shadow boundary). Without it, Blink defaults to subpixel smoothing
 * and identical 400-weight text looks heavier than the old site. */
:host {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/**
 * HowItWorksStep (Old) — single step inside a How It Works grid.
 *
 * Class naming: single-class, no BEM `__` separator. Base element rules
 * (title, description, icon) are nested under the `.how-it-works-step-old`
 * block; each variant's rules are grouped (nested) under its
 * `.how-it-works-step-old.<variant>` modifier selector.
 *
 * Token values inlined from @creditas-ui/themes standard:
 *   colors.neutral.0   = #ffffff
 *   colors.neutral.10  = #f1f3f2
 *   colors.neutral.90  = #3d3d3d
 *   colors.neutral.100 = #292929
 *   colors.primary.50  = #8edb00
 */

:host,
.how-it-works-step-old {
  display: block;
}

.how-it-works-step-old,
.how-it-works-step-old *,
.how-it-works-step-old *::before,
.how-it-works-step-old *::after {
  box-sizing: border-box;
}

.how-it-works-step-old {
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  color: inherit;

  /* ----- shared typography ----------------------------------------- */

  .title {
    margin: 0;
    font-weight: 500;
    font-size: 20px;
    line-height: 28px;
    letter-spacing: 0.3px;
  }

  .description {
    margin: 0;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;
    opacity: 0.85;
  }

  /* ----- icon base + squircle (ported from CustomIcon/ShapeIcon) ---- */

  .icon {
    position: relative;

    img,
    svg {
      position: relative;
      z-index: 1;
    }

    &[data-squircle='true']::before {
      content: '';
      position: absolute;
      width: 77%;
      height: 85%;
      background: #8edb00; /* primary.40 */
      opacity: 0.25;
      border-radius: 8px;
      z-index: 0;
    }

    &[data-squircle-position='top-left']::before {
      top: 4px;
      left: 6px;
    }
    &[data-squircle-position='top-right']::before {
      top: 4px;
      right: 6px;
    }
    &[data-squircle-position='bottom-left']::before {
      bottom: 4px;
      left: 6px;
    }
    &[data-squircle-position='bottom-right']::before {
      bottom: 4px;
      right: 6px;
    }
    &[data-squircle-position='center-top']::before {
      top: 2px;
      left: 0;
      right: 0;
      margin: 0 auto;
    }
    &[data-squircle-position='center-bottom']::before {
      bottom: 2px;
      left: 0;
      right: 0;
      margin: 0 auto;
    }
  }
}

/* ----- inline variant (Sidebar list) ----------------------------- */

.how-it-works-step-old.inline {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;

  .enumeration {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #8edb00;
    color: #292929;
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 0.3px;
  }

  .content {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ----- card variant (Cards grid) --------------------------------- */

.how-it-works-step-old.card {
  padding: 24px;
  border-radius: 16px;
  background-color: #ffffff;
  color: #292929;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;

  &.card-dark {
    background-color: #3d3d3d;
    color: #ffffff;
    box-shadow: none;
  }

  .enumeration {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #8edb00;
    color: #292929;
    font-weight: 500;
    font-size: 18px;
    line-height: 1;
  }
}

/* card-icon variant: same card, but an icon at the top instead of the number
   dot. Inherits card / card-dark styling; only the icon box sizing is added. */
.how-it-works-step-old.card-icon .icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  img,
  svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

/* ----- icon variant (Icon columns) ------------------------------- */

.how-it-works-step-old.icon {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  .icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    img,
    svg {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}

/* ----- timeline variant (Numbered timeline) ---------------------- */
/* Number dot + card. Mobile: dot left of the card (centre at 18px, on the
 * parent's vertical connector line). Desktop: dot on top, centred over the
 * column (centre at 18px from the top, on the horizontal line). */

.how-it-works-step-old.timeline {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: start;
  height: 100%;

  .enumeration {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #8edb00; /* primary.40 */
    color: #292929;
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
  }

  .card {
    background-color: #ffffff;
    color: #292929;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    height: 100%;
  }

  /* Dark timeline: the dark background goes on the inner card (the timeline
     root is a grid, so --card-dark on the root wouldn't reach the card). */
  &.card-dark .card {
    background-color: #3d3d3d;
    color: #ffffff;
    box-shadow: none;
  }

  .icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    img,
    svg {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  @media (min-width: 768px) {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 24px;

    .enumeration {
      justify-self: center;
    }
  }
}

