/* mixins & extensions */

@keyframes in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes in-down {
  0% {
    opacity: 0;
    transform: translate3D(0, -5px, 0);
  }

  100% {
    opacity: 1;
    transform: translate3D(0, 0, 0);
  }
}

@keyframes in-up {
  0% {
    opacity: 0;
    transform: translate3D(0, 5px, 0);
  }

  100% {
    opacity: 1;
    transform: translate3D(0, 0, 0);
  }
}

@keyframes in-scale {
  0% {
    opacity: 0;
    transform: scale3D(0.95, 0.95, 1);
  }

  100% {
    opacity: 1;
    transform: scale3D(1, 1, 1);
  }
}

/**
* Currently only used in Checkbox.
*/

:root {
  --calcite-popper-transition: 150ms ease-in-out;
}

:host([hidden]) {
  display: none;
}

:host-context([theme=dark]) {
  --calcite-ui-blue-1: #00A0FF;
  --calcite-ui-blue-2: #0087D7;
  --calcite-ui-blue-3: #47BBFF;
  --calcite-ui-green-1: #36DA43;
  --calcite-ui-green-2: #11AD1D;
  --calcite-ui-green-3: #44ED51;
  --calcite-ui-yellow-1: #FFC900;
  --calcite-ui-yellow-2: #F4B000;
  --calcite-ui-yellow-3: #FFE24D;
  --calcite-ui-red-1: #FE583E;
  --calcite-ui-red-2: #F3381B;
  --calcite-ui-red-3: #FF7465;
  --calcite-ui-background: #202020;
  --calcite-ui-foreground-1: #2b2b2b;
  --calcite-ui-foreground-2: #353535;
  --calcite-ui-foreground-3: #404040;
  --calcite-ui-text-1: #ffffff;
  --calcite-ui-text-2: #bfbfbf;
  --calcite-ui-text-3: #9f9f9f;
  --calcite-ui-border-1: #4a4a4a;
  --calcite-ui-border-2: #404040;
  --calcite-ui-border-3: #353535;
  --calcite-ui-border-4: #757575;
  --calcite-ui-border-5: #9f9f9f;
}

:host([alignment=start]),
:host([alignment=end][dir=rtl]) {
  text-align: left;
}

:host([alignment=end]),
:host([alignment=start][dir=rtl]) {
  text-align: right;
}

:host([alignment=center]) {
  text-align: center;
}

:host([scale=s]) {
  --calcite-label-margin-bottom: 12px;
}

:host([scale=s]) label {
  font-size: var(--calcite-font-size--2);
}

:host([scale=m]) {
  --calcite-label-margin-bottom: 14px;
}

:host([scale=m]) label {
  font-size: var(--calcite-font-size--1);
}

:host([scale=l]) {
  --calcite-label-margin-bottom: 18px;
}

:host([scale=l]) label {
  font-size: var(--calcite-font-size-1);
}

:host label {
  cursor: pointer;
  width: 100%;
  margin: 0 0 var(--calcite-label-margin-bottom, 1.5rem) 0;
  line-height: 1.3;
}

:host([layout=default]) label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:host([layout=inline]) label,
:host([layout=inline-space-between]) label {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

:host([layout=inline-space-between]) label {
  justify-content: space-between;
}

:host([disabled]) > label {
  pointer-events: none;
  opacity: var(--calcite-ui-opacity-disabled);
}

:host([disabled]) ::slotted(*) {
  pointer-events: none;
}

:host([disabled]) ::slotted(*[disabled]),
:host([disabled]) ::slotted(*[disabled] *) {
  opacity: 1;
}

:host([disabled]) ::slotted(calcite-input-message:not([active])) {
  opacity: 0;
}

:host([status=invalid]) label {
  color: var(--calcite-ui-red-1);
}

:host([status=valid]) label {
  color: var(--calcite-ui-text-2);
}

:host([status=idle]) label {
  color: var(--calcite-ui-text-2);
}

:host([disable-spacing]) label {
  gap: 0;
  margin: 0;
}