/* 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;
}

/**
 * LoanCalculatorHero — port of HeroFormWithImage/Template03.
 *
 * Token values inlined from @creditas-ui/themes standard:
 *
 *   colors.neutral.0   = #ffffff
 *   colors.neutral.10  = #f1f3f2
 *   colors.neutral.20  = #e1e3e3
 *   colors.neutral.40  = #c5cccd
 *   colors.neutral.60  = #5e6566
 *   colors.neutral.90  = #3d3d3d
 *   colors.neutral.100 = #292929
 *   colors.primary.50  = #8edb00
 *   colors.primary.60  = #4f9e00
 *   colors.semantic.danger = #b00020
 *   background          = #e9e9e1 (Template03-specific cream tone)
 *
 *   typography.heading.xlBold  → 48px / 56px / 0.5px (desktop title)
 *   typography.heading.mdBold  → 32px / 40px / 0.3px (mobile title)
 *   typography.body.xlBold     → 20px / 28px / 0.3px (form title)
 *   typography.body.xlRegular  → 18px / 26px / 0.3px (desktop description)
 *   typography.body.lgLight    → 16px / 24px / 0.3px (mobile description, helper)
 *   typography.body.smRegular  → 14px / 20px / 0.2px (labels, errors)
 */

:host,
.loan-calculator-hero {
  position: relative;
  display: block;
}

.loan-calculator-hero,
.loan-calculator-hero *,
.loan-calculator-hero *::before,
.loan-calculator-hero *::after {
  box-sizing: border-box;
}

.loan-calculator-hero {
  background-color: #e9e9e1;
  color: #292929;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  padding: 56px 0;

  @media (min-width: 1024px) {
    padding: 96px 0;
  }

  .wrapper {
    width: 90%;
    max-width: 1172px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;

    @media (min-width: 1024px) {
      flex-direction: row;
      align-items: stretch;
      gap: 48px;
    }
  }

  /* ---------- info column ----------------------------------------- */

  .info {
    display: flex;
    flex-direction: column;
    gap: 16px;

    @media (min-width: 1024px) {
      flex: 1 1 50%;
      padding: 24px;
      justify-content: center;
    }
  }

  .image {
    margin: 0 0 8px;

    img {
      max-width: 100%;
      height: auto;
      display: block;
    }
  }

  .image-desktop {
    display: block;
  }

  .title {
    margin: 0;
    font-family: 'Maison Neue Extended', 'Maisonneueextended Book',
      'Maisonneueextended', 'Helvetica Now Display', 'Helveticanowdisplay',
      sans-serif;
    font-weight: 700;
    font-size: 32px;
    line-height: 40px;
    letter-spacing: 0.3px;
    color: #3d3d3d;

    @media (min-width: 1024px) {
      font-size: 48px;
      line-height: 56px;
      letter-spacing: 0.5px;
    }
  }

  .description {
    margin: 0;
    font-weight: 300;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;
    color: #5e6566;

    @media (min-width: 1024px) {
      font-weight: 400;
      font-size: 18px;
      line-height: 26px;
    }
  }

  /* ---------- award badge ----------------------------------------- */

  .award {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;

    img {
      max-width: 64px;
      height: auto;
      display: block;
    }

    span {
      font-weight: 400;
      font-size: 14px;
      line-height: 20px;
      letter-spacing: 0.2px;
      color: #5e6566;
    }

    &.desktop {
      display: none;
    }

    &.mobile {
      display: flex;
      justify-content: center;
      margin-top: 24px;
    }

    @media (min-width: 768px) {
      &.desktop {
        display: flex;
      }
      &.mobile {
        display: none;
      }
    }
  }

  /* ---------- form column ----------------------------------------- */

  .form-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;

    @media (min-width: 1024px) {
      flex: 1 1 50%;
      justify-content: flex-end;
      align-items: flex-end;
    }
  }

  .card {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);

    @media (min-width: 1024px) {
      max-width: 484px;
      padding: 48px;
      min-height: 580px;
    }
  }

  .form-title {
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 20px;
    line-height: 28px;
    letter-spacing: 0.3px;
    color: #292929;
  }

  /* ---------- form fields ---------------------------------------- */

  .field {
    display: flex;
    flex-direction: column;
    gap: 4px;

    &.error {
      .input {
        border-color: #b00020;

        &:focus {
          box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.2);
        }
      }
    }
  }

  .label {
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.2px;
    color: #5e6566;
  }

  .input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #c5cccd;
    border-radius: 12px;
    background-color: #ffffff;
    font-family: inherit;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;
    color: #292929;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;

    &:focus {
      outline: none;
      border-color: #4f9e00;
      box-shadow: 0 0 0 3px rgba(142, 219, 0, 0.25);
    }

    &:disabled {
      background-color: #f1f3f2;
      cursor: not-allowed;
    }
  }

  .field-error {
    margin: 4px 0 0;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 0.2px;
    color: #b00020;
  }

  /* ---------- helper + submit error ------------------------------ */

  .helper {
    margin: 8px 0 0;
    font-weight: 300;
    font-size: 12px;
    line-height: 18px;
    letter-spacing: 0.2px;
    color: #5e6566;
    text-align: center;
  }

  .submit-error {
    margin: 0;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.2px;
    color: #b00020;
  }

  /* ---------- CTA ------------------------------------------------ */

  .cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    margin-top: 8px;
    border: none;
    border-radius: 999px;
    background-color: #8edb00;
    color: #292929;
    font-family: inherit;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease,
      background-color 0.2s ease;

    &:hover:not(:disabled) {
      background-color: #4f9e00;
      color: #ffffff;
      transform: translateY(-1px);
    }

    &:focus-visible {
      outline: 3px solid #4f9e00;
      outline-offset: 2px;
    }

    &:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
    }
  }
}

