/* Admin console Keycloak - tema Banco Mercantil
 * React + PatternFly 5. Overrides pesados para encaixar na identidade Mercantil:
 *   - Azul Mercantil no header
 *   - Sidebar branca com acento ciano
 *   - Tipografia Inter
 *   - Cantos arredondados e cores quentes
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700;800&display=swap");

:root {
  /* tokens da marca */
  --kc-brand-500: #1B3BDB;
  --kc-brand-600: #1230BF;
  --kc-brand-700: #0C2591;
  --kc-brand-800: #0B2054;
  --kc-brand-900: #091845;
  --kc-accent-cyan: #18E6E6;
  --kc-accent-pink: #E2076F;

  /* tipografia */
  --pf-v5-global--FontFamily--sans-serif:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pf-v5-global--FontFamily--heading--sans-serif:
    "Inter", ui-sans-serif, system-ui, sans-serif;
  --pf-v5-global--FontFamily--text: var(--pf-v5-global--FontFamily--sans-serif);
  --pf-v5-global--FontFamily--heading: var(--pf-v5-global--FontFamily--heading--sans-serif);

  /* paleta primaria -> azul Mercantil */
  --pf-v5-global--primary-color--100: var(--kc-brand-600);
  --pf-v5-global--primary-color--200: var(--kc-brand-700);
  --pf-v5-global--primary-color--300: var(--kc-brand-800);
  --pf-v5-global--primary-color--400: var(--kc-brand-500);
  --pf-v5-global--primary-color--light-100: var(--kc-brand-500);
  --pf-v5-global--primary-color--dark-100: var(--kc-brand-700);

  --pf-v5-global--link--Color: var(--kc-brand-600);
  --pf-v5-global--link--Color--hover: var(--kc-brand-700);
  --pf-v5-global--link--Color--light: var(--kc-brand-500);
  --pf-v5-global--link--Color--light--hover: var(--kc-brand-400);

  --pf-v5-global--active-color--100: var(--kc-brand-500);
  --pf-v5-global--active-color--200: var(--kc-brand-600);
  --pf-v5-global--active-color--300: var(--kc-accent-cyan);
  --pf-v5-global--active-color--400: var(--kc-brand-700);

  /* fundos escuros usados em masthead/sidebar */
  --pf-v5-global--BackgroundColor--dark-100: var(--kc-brand-800);
  --pf-v5-global--BackgroundColor--dark-200: var(--kc-brand-900);
  --pf-v5-global--BackgroundColor--dark-300: var(--kc-brand-900);
  --pf-v5-global--BackgroundColor--dark-400: #061236;

  /* cantos arredondados mais presentes */
  --pf-v5-global--BorderRadius--sm: 8px;
  --pf-v5-global--BorderRadius--lg: 14px;
}

body {
  font-family: var(--pf-v5-global--FontFamily--sans-serif) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ MASTHEAD (header azul Mercantil) ============ */
.pf-v5-c-masthead,
.pf-v5-c-page>.pf-v5-c-masthead,
.pf-v5-c-page__header,
.pf-v5-c-page__header .pf-v5-c-masthead {
  background: linear-gradient(90deg, var(--kc-brand-800) 0%, var(--kc-brand-700) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.pf-v5-c-masthead .pf-v5-c-button,
.pf-v5-c-masthead .pf-v5-c-menu-toggle,
.pf-v5-c-masthead .pf-v5-c-dropdown__toggle,
.pf-v5-c-masthead .pf-v5-c-context-selector {
  color: #fff !important;
}

.pf-v5-c-masthead .pf-v5-c-button.pf-m-plain:hover,
.pf-v5-c-masthead .pf-v5-c-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* Brand: o logo vem de theme.properties (logo=img/logo.svg) */
.pf-v5-c-brand {
  max-height: 36px !important;
  height: 36px !important;
  width: auto !important;
}

/* ============ SIDEBAR (navegacao lateral) ============ */
.pf-v5-c-page__sidebar,
.pf-v5-c-page__sidebar.pf-m-light,
.pf-v5-c-page__sidebar .pf-v5-c-page__sidebar-body {
  background-color: #FFFFFF !important;
  border-right: 1px solid rgb(226 232 240) !important;
  color: #0f172a !important;
}

.pf-v5-c-nav {
  --pf-v5-c-nav__link--Color: #334155;
  --pf-v5-c-nav__link--BackgroundColor: transparent;
  --pf-v5-c-nav__link--hover--Color: var(--kc-brand-700);
  --pf-v5-c-nav__link--hover--BackgroundColor: #F1F5F9;
  --pf-v5-c-nav__link--m-current--Color: var(--kc-brand-700);
  --pf-v5-c-nav__link--m-current--BackgroundColor: #EEF2FF;
  --pf-v5-c-nav__link--focus--Color: var(--kc-brand-700);
  --pf-v5-c-nav__link--focus--BackgroundColor: #EEF2FF;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link,
.pf-v5-c-page__sidebar .pf-v5-c-nav__link:link,
.pf-v5-c-page__sidebar .pf-v5-c-nav__link:visited {
  color: #334155 !important;
  background-color: transparent !important;
  font-weight: 500;
  border-radius: 8px;
  margin: 2px 8px;
  padding: 0.5rem 0.75rem;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link:hover {
  color: var(--kc-brand-700) !important;
  background-color: #F1F5F9 !important;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link.pf-m-current,
.pf-v5-c-page__sidebar .pf-v5-c-nav__link.pf-m-current:hover,
.pf-v5-c-page__sidebar .pf-v5-c-nav__item.pf-m-current:not(.pf-m-expanded) .pf-v5-c-nav__link {
  color: var(--kc-brand-700) !important;
  background-color: #EEF2FF !important;
  font-weight: 600;
}

/* Indicador lateral do item ativo */
.pf-v5-c-page__sidebar .pf-v5-c-nav__link.pf-m-current::before {
  background: linear-gradient(180deg, var(--kc-brand-500), var(--kc-accent-cyan)) !important;
  width: 3px !important;
  border-radius: 2px;
}

/* Divisores / headings dentro da sidebar */
.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title {
  color: #64748b !important;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem 0.25rem;
}

/* ============ CONTEUDO PRINCIPAL ============ */
.pf-v5-c-page__main,
.pf-v5-c-page__main-section:not([class*="pf-m-dark"]) {
  background-color: #F8FAFC !important;
}

/* ============ CARDS & PANELS ============ */
.pf-v5-c-card,
.pf-v5-c-panel,
.pf-v5-c-empty-state {
  border-radius: var(--pf-v5-global--BorderRadius--lg) !important;
  border: 1px solid rgb(226 232 240) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* ============ BOTOES ============ */
.pf-v5-c-button {
  border-radius: var(--pf-v5-global--BorderRadius--sm) !important;
  font-weight: 500 !important;
}

.pf-v5-c-button.pf-m-primary {
  background-color: var(--kc-brand-600) !important;
  border-color: var(--kc-brand-600) !important;
  color: #fff !important;
}
.pf-v5-c-button.pf-m-primary:hover {
  background-color: var(--kc-brand-700) !important;
  border-color: var(--kc-brand-700) !important;
}

.pf-v5-c-button.pf-m-secondary {
  border-color: rgb(203 213 225) !important;
  color: var(--kc-brand-700) !important;
}
.pf-v5-c-button.pf-m-secondary:hover {
  background-color: #EEF2FF !important;
  border-color: var(--kc-brand-500) !important;
}

.pf-v5-c-button.pf-m-link {
  color: var(--kc-brand-600) !important;
}
.pf-v5-c-button.pf-m-link:hover {
  color: var(--kc-brand-700) !important;
}

/* ============ INPUTS / FORMS ============ */
.pf-v5-c-form-control,
.pf-v5-c-form-control input,
.pf-v5-c-form-control select,
.pf-v5-c-form-control textarea,
input.pf-v5-c-form-control {
  border-radius: var(--pf-v5-global--BorderRadius--sm) !important;
}
.pf-v5-c-form-control:focus-within {
  --pf-v5-c-form-control--focus--BorderBottomColor: var(--kc-brand-500);
  box-shadow: 0 0 0 3px rgba(27, 59, 219, 0.12) !important;
}

/* ============ TABS (pill rounded estilo moderno) ============ */
.pf-v5-c-tabs {
  --pf-v5-c-tabs--before--BorderColor: transparent;
}
.pf-v5-c-tabs::before,
.pf-v5-c-tabs__list::before,
.pf-v5-c-tabs__list::after {
  border: 0 !important;
  display: none !important;
}
.pf-v5-c-tabs__list {
  gap: 6px;
  padding: 4px;
  background: #F1F5F9;
  border-radius: 12px;
  display: inline-flex;
  width: auto;
}
.pf-v5-c-tabs__item {
  background: transparent !important;
  border: 0 !important;
}
.pf-v5-c-tabs__link {
  border-radius: 8px !important;
  padding: 0.55rem 1rem !important;
  color: #475569 !important;
  font-weight: 500 !important;
  background: transparent !important;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.pf-v5-c-tabs__link::before,
.pf-v5-c-tabs__link::after {
  border: 0 !important;
  display: none !important;
}
.pf-v5-c-tabs__link:hover {
  color: var(--kc-brand-700) !important;
  background: rgba(255, 255, 255, 0.6) !important;
}
.pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link {
  color: var(--kc-brand-700) !important;
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(11, 32, 84, 0.10), 0 1px 2px rgba(11, 32, 84, 0.06) !important;
}

/* ============ BADGES (ex: "Current realm") ============ */
.pf-v5-c-label.pf-m-blue,
.pf-v5-c-badge.pf-m-read {
  background-color: #EEF2FF !important;
  color: var(--kc-brand-700) !important;
}

/* ============ LINKS GENERICOS ============ */
a, a:visited {
  color: var(--kc-brand-600);
}
a:hover {
  color: var(--kc-brand-700);
}

/* ============ SPINNER / LOADING ============ */
.pf-v5-c-spinner {
  --pf-v5-c-spinner--Color: var(--kc-brand-500);
}

/* Remove efeito dark-theme caso SO esteja em dark (garantia) */
html.pf-v5-theme-dark,
:where(.pf-v5-theme-dark) {
  color-scheme: light;
}
