// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

@use "@cloudscape-design/design-tokens/index" as cloudscape;

.container {
  display: flex;
  align-items: stretch;

  .left {
    border: 2px solid cloudscape.$color-border-input-default;
    background-color: cloudscape.$color-background-dropdown-item-hover;
    border-right: none;
    border-top-left-radius: cloudscape.$border-radius-input !important;
    border-bottom-left-radius: cloudscape.$border-radius-input !important;
    padding: 2px 10px 0;
    font-size: 0.9em;
    align-content: center;
    white-space: nowrap;
  }

  input {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }

  .error & {
    .left {
      border-color: cloudscape.$color-text-status-error;
      color: cloudscape.$color-text-status-error;
      border-left-width: cloudscape.$space-static-xs;
    }

    input {
      border-left-width: 2px !important;
    }
  }
}

.readOnly {
  .left,
  input:focus {
    border-color: cloudscape.$color-border-button-primary-disabled !important;
  }
}
