
@st-namespace 'Fieldset-deprecated-st-css';
:import {
  -st-from: '../../../common/formatters.st';
  -st-named: color, fallback, font, calculate, unit;
}

:import {
  -st-from: '../../../common/fonts.st.css';
  -st-named: fontFamily;
}

:import {
  -st-from: "../../../common/palette.st.css";
  -st-named: errorColor as paletteErrorColor;
}

/* Defaults */
:vars {
  DefaultErrorColor: value(paletteErrorColor);
  defaultMainLabelTextColor: color-5;
  defaultMainLabelFont: "{theme: 'Body-M', size: '14px', lineHeight: '1.4'}";
  defaultMinMessageHeight: 0;
  defaultLabelBottomSpacing: 8px;
}

/* Overrides */
:vars {
  /*
    Error message color
    @default #DF3131
  */
  ErrorColor: --overridable;
  /*
    The font of the label
    @default {theme: 'Body-M', size: '14px', lineHeight: '1.4'}
  */
  MainLabelFont: --overridable;
  /*
    The color of the label. 60% opacity when disabled
    @default color-5
  */
  MainLabelTextColor: --overridable;
  /*
    Space between input's bottom with the error. Used to prevent layout jumping when error message is shown.
    @default 0
  */
  MinMessageHeight: --overridable;
  /*
    Space between label's bottom and the children.
    @default 8px
  */
  LabelBottomSpacing: --overridable;
}
/*
 * Error message color
 * @type color
 * @default #DF3131
 */
@property st-global(--wix-ui-tpa-fieldset-error-color);
/*
 * The font of the label
 * @type font
 * @default preset: 'Body-M' | overrides: { size: '14px', lineHeight: '1.4'}
 */
@property st-global(--wix-ui-tpa-fieldset-main-label-font);
/*
 * The color of the label. 60% opacity when disabled
 * @type color
 * @default --wix-color-5
 */
@property st-global(--wix-ui-tpa-fieldset-main-label-text-color);
/*
 * Space between input's bottom with the error. Used to prevent layout jumping when error message is shown.
 * @type size
 * @default 0
 */
@property st-global(--wix-ui-tpa-fieldset-min-message-height);
/*
 * Space between label's bottom and the children.
 * @type size
 * @default 8px
 */
@property st-global(--wix-ui-tpa-fieldset-label-bottom-spacing);

:vars {
  errorColor: color(fallback(value(ErrorColor), value(DefaultErrorColor)));
  mainLabelFont: fallback(font(value(MainLabelFont)), font(value(defaultMainLabelFont)));
  mainLabelTextColor: color(fallback(value(MainLabelTextColor), value(defaultMainLabelTextColor)));
  minErrorMessageHeight: fallback(value(MinMessageHeight), value(defaultMinMessageHeight));
  labelBottomSpacing: fallback(value(LabelBottomSpacing), value(defaultLabelBottomSpacing));
  errorMinHeight: 20px;
  errorMarginTop: 8px;
}

.root {
  -st-states: error;
}

.root {
  border: none;
  padding: 0;
  margin: 0;
}

.root:not(:error) {
  margin-bottom: value(minErrorMessageHeight);
}
.root:error {
  margin-bottom: calculate("-", value(minErrorMessageHeight), value(errorMinHeight), value(errorMarginTop));
}

.error {
  margin-top: value(errorMarginTop);
  min-height: value(errorMinHeight);
  display: flex;
  align-items: center;
  color: value(errorColor);
  font-family: value(fontFamily);
  font-size: 14px;
  line-height: 1.4;
}

.errorIcon {
  margin-right: 2px;
}

.label {
  padding-bottom: value(labelBottomSpacing);
  padding-inline-start: 0;
  padding-inline-end: 0;
  font: value(mainLabelFont);
  color: value(mainLabelTextColor);
}

/* st-namespace-reference="../../../../../src/components/internal/Fieldset/Fieldset.deprecated.st.css" */
    