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

/**
 * MaskedField — same boxed floating-label style as TextField.
 * Class naming: no BEM `__`; elements nested under `.masked-field`.
 */
:host,
.masked-field {
  display: block;
}

.masked-field,
.masked-field *,
.masked-field *::before,
.masked-field *::after {
  box-sizing: border-box;
}

.masked-field {
  .wrapper {
    position: relative;
    width: 100%;
  }

  .input {
    display: block;
    width: 100%;
    height: 64px;
    padding: 24px 20px 8px;
    background-color: #f1f3f2;
    border: 1.5px solid transparent;
    border-radius: 16px;
    color: #292929;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.3px;
    outline: none;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;

    &::placeholder {
      color: transparent;
    }

    &:focus {
      border-color: #292929;
      background-color: #ffffff;
    }

    &:not(:placeholder-shown) ~ .label,
    &:focus ~ .label {
      top: 12px;
      transform: translateY(0);
      font-size: 11px;
      line-height: 14px;
    }

    &:focus ~ .label {
      color: #292929;
    }
  }

  .label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.3px;
    color: #52605a;
    pointer-events: none;
    transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease;
  }

  .required {
    color: #e53935;
  }

  .error {
    display: block;
    margin-top: 6px;
    padding-left: 20px;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-size: 12px;
    line-height: 16px;
    color: #e53935;
  }

  &.error .input {
    border-color: #e53935;
    background-color: #fff8f8;
  }

  &.disabled .input {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

