/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
/**
 * Convert a pixels given value into rem
 * 
 * @param pixels - Value in pixels to be converted (i.e. px)
 * @param context (optional) - Baseline value
 */
/**
 * Convert a font size to a dynamic font size.
 * Fonts that participate in Dynamic Type should use
 * dynamic font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param unit (optional) - The unit to convert to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a maximum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a minimum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * maximum and minimum font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
:host {
  /**
   * @prop --background: Background color of the input boxes
   *
   * @prop --border-radius: Border radius of the input boxes
   *
   * @prop --border-width: Border width of the input boxes
   * @prop --border-style: Border style of the input boxes
   * @prop --border-color: Border color of the input boxes
   *
   * @prop --color: Text color of the input
   *
   * @prop --margin-top: Top margin of the input group
   * @prop --margin-end: Right margin if direction is left-to-right, and left margin if direction is right-to-left of the input group
   * @prop --margin-bottom: Bottom margin of the input group
   * @prop --margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the input group
   *
   * @prop --padding-top: Top padding of the input group
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the input group
   * @prop --padding-bottom: Bottom padding of the input group
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the input group
   *
   * @prop --height: Height of input boxes
   * @prop --width: Width of input boxes
   * @prop --min-width: Minimum width of input boxes
   *
   * @prop --separator-color: Color of the separator between boxes
   * @prop --separator-width: Width of the separator between boxes
   * @prop --separator-height: Height of the separator between boxes
   * @prop --separator-border-radius: Border radius of the separator between boxes
   *
   * @prop --highlight-color-focused: The color of the highlight on the input when focused
   * @prop --highlight-color-valid: The color of the highlight on the input when valid
   * @prop --highlight-color-invalid: The color of the highlight on the input when invalid
   */
  --margin-top: 0;
  --margin-end: 0;
  --margin-bottom: 0;
  --margin-start: 0;
  --separator-height: var(--separator-width);
  /**
   * This is a private API that is used to switch
   * out the highlight color based on the state
   * of the component without having to write
   * different selectors for different fill variants.
   */
  --highlight-color: var(--highlight-color-focused);
  display: block;
  position: relative;
}

.input-otp-group {
  -webkit-margin-start: var(--margin-start);
  margin-inline-start: var(--margin-start);
  -webkit-margin-end: var(--margin-end);
  margin-inline-end: var(--margin-end);
  margin-top: var(--margin-top);
  margin-bottom: var(--margin-bottom);
  -webkit-padding-start: var(--padding-start);
  padding-inline-start: var(--padding-start);
  -webkit-padding-end: var(--padding-end);
  padding-inline-end: var(--padding-end);
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  display: flex;
  align-items: center;
  justify-content: center;
}

.native-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--min-width);
}

.native-input {
  border-radius: var(--border-radius);
  width: var(--width);
  min-width: inherit;
  height: var(--height);
  border-width: var(--border-width);
  border-style: var(--border-style);
  border-color: var(--border-color);
  background: var(--background);
  color: var(--color);
  font-family: inherit;
  font-size: inherit;
  text-align: center;
  appearance: none;
  box-sizing: border-box;
}

:host(.has-focus) .native-input {
  caret-color: var(--highlight-color);
}

.input-otp-description {
  text-align: center;
}

.input-otp-description-hidden {
  display: none;
}

.input-otp-separator {
  border-radius: var(--separator-border-radius);
  flex-shrink: 0;
  width: var(--separator-width);
  height: var(--separator-height);
  background: var(--separator-color);
}

:host(.input-otp-disabled),
:host(.input-otp-disabled) .native-input:disabled {
  cursor: not-allowed;
}

:host(.has-focus) .native-input:focus {
  --border-color: var(--highlight-color);
  outline: none;
}

:host(.ion-touched.ion-invalid) {
  --highlight-color: var(--highlight-color-invalid);
}

/**
 * The component highlight is only shown
 * on focus, so we can safely set the valid
 * color state when valid. If we
 * set it when .has-focus is present then
 * the highlight color would change
 * from the valid color to the component's
 * color during the transition after the
 * component loses focus.
 */
:host(.ion-valid) {
  --highlight-color: var(--highlight-color-valid);
}

/**
 * If the input has a validity state, the
 * border should reflect that as a color.
 * The invalid state should show if the input is
 * invalid and has already been touched.
 * The valid state should show if the input
 * is valid, has already been touched, and
 * is currently focused. Do not show the valid
 * highlight when the input is blurred.
 */
:host(.has-focus.ion-valid),
:host(.ion-touched.ion-invalid) {
  --border-color: var(--highlight-color);
}

:host {
  --padding-top: var(--token-space-400, var(--token-scale-400, 16px));
  --padding-end: var(--token-space-0, var(--token-scale-0, 0px));
  --padding-bottom: var(--token-space-400, var(--token-scale-400, 16px));
  --padding-start: var(--token-space-0, var(--token-scale-0, 0px));
  --color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
  --min-width: var(--token-scale-1000, 40px);
  --border-width: var(--token-border-size-025, var(--token-scale-025, 1px));
  --border-style: var(--token-border-style-solid, solid);
  --border-color: var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c));
  --separator-width: var(--token-scale-200, 8px);
  --separator-border-radius: var(--token-border-radius-full, 999px);
  --separator-color: var(--token-bg-neutral-subtle-press, var(--token-primitives-neutral-400, #d5d5d5));
  --highlight-color-focused: var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));
  --highlight-color-valid: var(--token-border-success, var(--token-semantics-success-900, var(--token-primitives-green-900, #126f23)));
  --highlight-color-invalid: var(--token-border-danger-default, var(--token-semantics-danger-800, var(--token-primitives-red-800, #bf2222)));
  font-size: var(--token-font-size-350, 14px);
  font-weight: var(--token-font-weight-regular, 400);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-600, var(--token-scale-600, 24px));
  text-decoration: none;
  text-transform: none;
}

:host(.has-focus) .native-input:focus {
  --border-width: var(--token-border-size-050, var(--token-scale-050, 2px));
}

.input-otp-description {
  font-size: var(--token-font-size-300, 12px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-500, var(--token-scale-500, 20px));
  text-decoration: none;
  text-transform: none;
  color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262));
}

:host(.input-otp-size-small) {
  --width: var(--token-scale-1000, 40px);
  --height: var(--token-scale-1000, 40px);
}

:host(.input-otp-size-small) .input-otp-group {
  gap: var(--token-space-200, var(--token-scale-200, 8px));
}

:host(.input-otp-size-medium) {
  --width: var(--token-scale-1200, 48px);
  --height: var(--token-scale-1200, 48px);
}

:host(.input-otp-size-large) {
  --width: var(--token-scale-1400, 56px);
  --height: var(--token-scale-1400, 56px);
}

:host(.input-otp-size-medium) .input-otp-group,
:host(.input-otp-size-large) .input-otp-group {
  gap: var(--token-space-300, var(--token-scale-300, 12px));
}

:host(.input-otp-shape-round) {
  --border-radius: var(--token-round-xl, var(--token-border-radius-400, var(--token-scale-400, 16px)));
}

:host(.input-otp-shape-soft) {
  --border-radius: var(--token-soft-xl, var(--token-border-radius-200, var(--token-scale-200, 8px)));
}

:host(.input-otp-shape-rectangular) {
  --border-radius: var(--token-rectangular-xl, var(--token-border-radius-0, var(--token-scale-0, 0px)));
}

:host(.input-otp-fill-outline) {
  --background: var(--token-bg-input-default, var(--token-primitives-base-white, #ffffff));
}

:host(.input-otp-fill-solid) {
  --border-color: var(--token-bg-input-bold-default, var(--token-primitives-neutral-200, #eae9e9));
  --background: var(--token-bg-input-bold-default, var(--token-primitives-neutral-200, #eae9e9));
}

:host(.input-otp-disabled) {
  --color: var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2));
}

:host(.input-otp-fill-outline.input-otp-disabled) {
  --background: var(--token-bg-input-disabled, var(--token-primitives-neutral-100, #f3f3f3));
  --border-color: var(--token-border-disabled, var(--token-primitives-neutral-300, #e0e0e0));
}

:host(.input-otp-fill-outline.input-otp-readonly) {
  --background: var(--token-bg-input-read-only, var(--token-primitives-neutral-100, #f3f3f3));
}

:host(.input-otp-fill-solid.input-otp-disabled) {
  --border-color: var(--token-bg-input-bold-disabled, var(--token-primitives-neutral-300, #e0e0e0));
  --background: var(--token-bg-input-bold-disabled, var(--token-primitives-neutral-300, #e0e0e0));
}

:host(.input-otp-fill-solid.input-otp-readonly) {
  --border-color: var(--token-bg-input-bold-read-only, var(--token-primitives-neutral-300, #e0e0e0));
  --background: var(--token-bg-input-bold-read-only, var(--token-primitives-neutral-300, #e0e0e0));
}

:host(.ion-color) {
  --highlight-color-focused: var(--ion-color-base);
}

:host(.input-otp-fill-outline.ion-color) .native-input,
:host(.input-otp-fill-solid.ion-color) .native-input:focus {
  border-color: rgba(var(--ion-color-base-rgb), 0.6);
}

:host(.input-otp-fill-outline.ion-color.ion-invalid) .native-input,
:host(.input-otp-fill-solid.ion-color.ion-invalid) .native-input,
:host(.input-otp-fill-outline.ion-color.has-focus.ion-invalid) .native-input,
:host(.input-otp-fill-solid.ion-color.has-focus.ion-invalid) .native-input {
  border-color: var(--ion-color-danger, var(--token-bg-danger-base-default, var(--token-semantics-danger-800, var(--token-primitives-red-800, #bf2222))));
}

:host(.input-otp-fill-outline.ion-color.ion-valid) .native-input,
:host(.input-otp-fill-solid.ion-color.ion-valid) .native-input,
:host(.input-otp-fill-outline.ion-color.has-focus.ion-valid) .native-input,
:host(.input-otp-fill-solid.ion-color.has-focus.ion-valid) .native-input {
  border-color: var(--ion-color-success, var(--token-bg-success-base-default, var(--token-semantics-success-900, var(--token-primitives-green-900, #126f23))));
}

:host(.input-otp-fill-outline.input-otp-disabled.ion-color) .native-input {
  border-color: rgba(var(--ion-color-base-rgb), 0.3);
}