/* Adm portal — Mud Outlined fields: visible border + a static label on top (not "floating" inside the border).
   Ynex usa .mud-input.mud-input-outlined (alta especificidade); combinamos body + mesma cadeia. */

:root {
  --adm-label-gap: 0.35rem;
  /* PMS brand — substitui o Material blue do template original.
     Não dependem mais de data-theme-mode (atributo removido com o Ynex). */
  --adm-input-border-rest: rgba(117, 133, 146, 0.45);
  --adm-input-border-hover: rgba(35, 96, 146, 0.70);
  --adm-input-border-focus: #4197CB;
}

html[data-theme-mode="dark"] {
  --adm-input-border-rest: rgba(255, 255, 255, 0.35);
  --adm-input-border-hover: rgba(255, 255, 255, 0.55);
  --adm-input-border-focus: #4197CB;
}

/* --- Label fixed above the rectangle (DOM: InputContent -> Label) --- */
body .mud-input-control > .mud-input-control-input-container {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
}

body .mud-input-control > .mud-input-control-input-container > label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
  transform: none !important;
  position: relative !important;
  inset: auto !important;
  margin: 0 0 var(--adm-label-gap) 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: auto !important;
  pointer-events: auto !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  transition: none !important;
  background-color: transparent !important;
}

/* Neutralize the Mud "shrink" animation in every state */
body .mud-input-control > .mud-input-control-input-container > .mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined,
body .mud-input-control > .mud-input-control-input-container > .mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
  transform: none !important;
  max-width: 100% !important;
}

/* No notch in the fieldset — the label no longer lines up with the Material legend */
body .mud-input.mud-input-outlined > .mud-input-outlined-border legend,
body .mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border legend,
body .mud-input.mud-input-outlined.mud-shrink > .mud-input-outlined-border legend {
  width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

body .mud-input-control:not(.mud-input-error)
  > .mud-input-control-input-container
  > .mud-input:focus-within
  ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
  color: var(--adm-input-border-focus) !important;
}

body .mud-input-control.mud-input-required > .mud-input-control-input-container > label.mud-input-label-inputcontrol.mud-input-label-outlined::after {
  margin-inline-start: 0.125rem;
}

/* --- Outlined borders always legible --- */
body .mud-input.mud-input-outlined .mud-input-outlined-border,
body .mud-input.mud-input-outlined fieldset.mud-input-outlined-border {
  border-style: solid !important;
  border-width: 1px !important;
  border-color: var(--adm-input-border-rest) !important;
  opacity: 1 !important;
}

body .mud-input.mud-input-outlined:hover .mud-input-outlined-border,
body .mud-input.mud-input-outlined:hover fieldset.mud-input-outlined-border {
  border-color: var(--adm-input-border-hover) !important;
}

body .mud-input.mud-input-outlined.mud-input-focused .mud-input-outlined-border,
body .mud-input.mud-input-outlined.mud-input-focused fieldset.mud-input-outlined-border,
body .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
body .mud-input.mud-input-outlined:focus-within fieldset.mud-input-outlined-border {
  border-color: var(--adm-input-border-focus) !important;
  border-width: 2px !important;
}

body .mud-input.mud-input-outlined.mud-input-error .mud-input-outlined-border,
body .mud-input.mud-input-outlined.mud-input-error fieldset.mud-input-outlined-border {
  border-color: var(--mud-palette-error) !important;
}

body .mud-select-outlined .mud-input.mud-input-outlined .mud-input-outlined-border,
body .mud-select-outlined .mud-input.mud-input-outlined fieldset.mud-input-outlined-border,
body .mud-picker-outlined .mud-input.mud-input-outlined .mud-input-outlined-border,
body .mud-picker-outlined .mud-input.mud-input-outlined fieldset.mud-input-outlined-border,
body .mud-numeric-field-outlined .mud-input.mud-input-outlined .mud-input-outlined-border,
body .mud-numeric-field-outlined .mud-input.mud-input-outlined fieldset.mud-input-outlined-border {
  border-style: solid !important;
  border-width: 1px !important;
  border-color: var(--adm-input-border-rest) !important;
}

body .mud-select-outlined.mud-input-focused .mud-input-outlined-border,
body .mud-select-outlined:focus-within .mud-input-outlined-border {
  border-color: var(--adm-input-border-focus) !important;
  border-width: 2px !important;
}
