// ============================================
// LEGACY FORM STYLES - DEPRECATED
// This file is kept for backward compatibility
// All form styling is now handled by the PSX Forms design system
// See: resources/src/assets/styles/sass/design-system/components/_psx-forms.scss
// ============================================

// Keep card-input utility for payment methods
.card-input {
  display: flex;
  flex-wrap: wrap;
  legend {
    margin-right: auto;
    width: auto;
  }
  .ul-widget-list__payment-method {
    img {
      height: 24px;
      width: auto;
    }
  }
}

// Keep datepicker specific styles
[ngbdatepicker] {
  height: 34px;
}

// Keep RTL support for legacy components
[dir="rtl"] {
  .form-check-label {
    // margin-right: 1rem !important;
  }
}

// ============================================
// LEGACY SWITCH (Old pattern - use .psx-switch instead)
// Kept for backward compatibility only
// ============================================
.switch {
  position: relative;
  display: inline-block;
  padding-left: 50px;
  height: 16px;
  span:not(.slider) {
    position: relative;
    top: -2px;
    cursor: pointer;
  }
  input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  .slider {
    position: absolute;
    cursor: pointer;
    width: 42px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 34px;
    background-color: $gray-300;
    -webkit-transition: 0.4s;
    transition: 0.4s;
  }
  .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: -1px;
    bottom: -4px;
    background-color: $background;
    -webkit-transition: 0.4s;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
      0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  }
  input:checked + .slider {
    background-color: $primary;
  }
  input:focus + .slider {
    box-shadow: 0 0 1px $primary;
  }
  input:checked + .slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
  }
}

@each $name, $value in $theme-colors {
  .switch-#{$name} {
    input:checked + .slider {
      background-color: $value;
    }
    input:focus + .slider {
      box-shadow: 0 0 1px $value;
    }
  }
}
