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

/**
 * SelectField — boxed floating-label select, same visual spec as TextField.
 * Class naming: no BEM `__`; elements nested under `.select-field`. Modifiers
 * bared to `&.error` / `&.disabled` / `&.has-value` (compound on the root).
 *
 * Tokens:
 *   Neutral/Lighter   = #f1f3f2
 *   Neutral/Dark      = #52605a
 *   Neutral/color-100 = #292929
 *   Error             = #e53935
 */

:host,
.select-field {
  display: block;
}

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

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

  .input {
    display: block;
    width: 100%;
    height: 64px;
    padding: 24px 44px 8px 20px; /* right padding for arrow */
    background-color: #f1f3f2;
    border: 1.5px solid transparent;
    border-radius: 16px;
    color: transparent; /* hide value until label is floated */
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease;

    /* Show value text once focused (has-value handled on the root below). */
    &:focus {
      color: #292929;
      border-color: #292929;
      background-color: #ffffff;
    }

    /* Float label up when focused. */
    &:focus ~ .label {
      top: 12px;
      transform: translateY(0);
      font-size: 11px;
      line-height: 14px;
      color: #292929;
    }
  }

  /* Show value text once an option is selected. */
  &.has-value .input {
    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;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease;
  }

  /* Float label up when an option is selected. */
  &.has-value .label {
    top: 12px;
    transform: translateY(0);
    font-size: 11px;
    line-height: 14px;
  }

  .required {
    color: #e53935;
  }

  /* Custom arrow. */
  .arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #52605a;
    pointer-events: none;
  }

  .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;
  }
}

