/**
 * 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 {
  --input-width: 40px;
  --input-height: 54px;
  --input-border-radius: var(--cpsl-border-radius-input);
  --input-border-color: var(--cpsl-color-input-border-placeholder);
  --input-border-width: 1px;
  --input-background-color: var(--cpsl-color-input-surface-default);
  --input-border-error-color: var(--cpsl-color-input-border-error);
  --input-font-size: clamp(20px, 1.25rem, 30px);
  --input-color: var(--cpsl-color-text-primary);
  --helper-text-color: var(--cpsl-color-text-secondary);
  --helper-text-error-color: var(--cpsl-color-text-error);
  --helper-text-icon-color: var(--cpsl-color-text-secondary);
  --helper-text-icon-error-color: var(--cpsl-color-text-error);
  --helper-text-icon-size: 16px;
  --helper-text-font-size: 12px;
  --helper-text-margin-top: 6px;
  display: block;
  font-family: var(--cpsl-font-family, inherit);
}

.code-container {
  display: flex;
  gap: 8px;
}

.code-input {
  font-family: var(--cpsl-font-family, inherit);
  border-radius: var(--input-border-radius);
  font-size: var(--input-font-size);
  border-color: var(--input-border-color);
  border-width: var(--input-border-width);
  border-style: solid;
  font-size: var(--input-font-size);
  color: var(--input-color);
  width: var(--input-width);
  height: var(--input-height);
  background: var(--input-background-color);
  box-sizing: border-box;
  text-align: center;
  outline: none;
}
.code-input.has-value {
  --input-border-color: var(--cpsl-color-accent-32);
}
.code-input:focus {
  --input-border-color: var(--cpsl-color-input-border-active);
}
.code-input::-webkit-outer-spin-button, .code-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.code-input .error-container {
  border-color: var(--input-border-error-color);
}

input[type=number] {
  -moz-appearance: textfield;
}

.helper-text-container {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--helper-text-color);
  font-size: var(--helper-text-font-size);
  margin-top: var(--helper-text-margin-top);
}
.helper-text-container cpsl-icon {
  --height: var(--helper-text-icon-size);
  --width: var(--helper-text-icon-size);
  --icon-color: var(--helper-text-icon-color);
}

.error-text {
  color: var(--helper-text-error-color);
}
.error-text cpsl-icon {
  --icon-color: var(--helper-text-icon-error-color);
}