@use '../base' as *;

// --------------------------------

// (START) Global editor code https://codyhouse.co/ds/globals/forms

// --------------------------------

:root {
  --form-control-font-size: 1em;
  --form-control-padding-x: var(--space-xs);
  --form-control-padding-y: var(--space-xxs);
  --form-control-radius: var(--radius-md);
}

.form-control {
  background: var(--color-bg-dark);
  line-height: 1.2;
  box-shadow: inset 0px 0px 0px 1px var(--color-contrast-lower);
  transition: all 0.2s ease;

  &::placeholder {
    opacity: 1;  
    color: var(--color-contrast-low);
  }

  &:focus, &:focus-within {
    background: var(--color-bg);
    box-shadow: inset 0 0 0 1px alpha(var(--color-contrast-lower), 0), 
                0 0 0 2px var(--color-primary), 
                var(--shadow-sm);
  }
}

.form-control--disabled, .form-control[disabled], .form-control[readonly] {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-control[aria-invalid="true"], .form-control.form-control--error {
  box-shadow: inset 0 0 0 1px alpha(var(--color-contrast-lower), 0), 
              0 0 0 2px var(--color-error);

  &:focus, &:focus-within {
    box-shadow: inset 0 0 0 1px alpha(var(--color-contrast-lower), 0), 
                0 0 0 2px var(--color-error), 
                var(--shadow-sm);
  }
}

.form-legend {}
.form-label {}

// --------------------------------

// (END) Global editor code

// --------------------------------