/*
 * homelab-flat — account console override
 * Direction "A" to match the login theme: flat near-black page, solid
 * #111113 surfaces, one indigo accent. Account Console v3 is a React SPA
 * on PatternFly v5; the theme only adds a stylesheet.
 *
 * Same approach as homelab-glass: direct component-class overrides,
 * because PatternFly's .pf-m-light modifier on the main section hardcodes
 * a white background that the global --pf-v5-global--* tokens don't reach.
 */

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

:root {
  --hf-bg: #0a0a0b;
  --hf-surface: #111113;
  --hf-border: #1f1f23;
  --hf-text: #ededef;
  --hf-text-muted: #9b9ba6;
  --hf-input-bg: #0d0d0f;
  --hf-input-border: #232327;
  --hf-accent: #5e5ef0;
  --hf-accent-hover: #6e6ef5;
  --hf-link: #8b8bf5;
  --hf-danger: #ff8a9b;
}

html,
body,
#app,
.pf-v5-c-page {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--hf-text);
  background: var(--hf-bg) !important;
}

/* Top masthead / nav sidebar */
.pf-v5-c-masthead,
.pf-v5-c-page__sidebar,
.pf-v5-c-page__sidebar-body,
.pf-v5-c-nav {
  background: var(--hf-surface) !important;
  border-color: var(--hf-border) !important;
  color: var(--hf-text);
}
.pf-v5-c-masthead {
  border-bottom: 1px solid var(--hf-border);
}
.pf-v5-c-masthead__main,
.pf-v5-c-masthead__content,
.pf-v5-c-masthead__brand,
.pf-v5-c-masthead .pf-v5-c-toolbar {
  background: transparent !important;
}

/* Masthead logo: the emblem set by `logo` in theme.properties, plus the name. */
.pf-v5-c-masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.pf-v5-c-masthead__brand img {
  height: 40px;
  width: 40px;
  max-height: none;
  border-radius: 8px;
  border: 1px solid var(--hf-border);
}
.pf-v5-c-masthead__brand::after {
  content: "tmm-it.dk";
  color: var(--hf-text);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.pf-v5-c-page__sidebar {
  border-right: 1px solid var(--hf-border);
}

.pf-v5-c-nav__link {
  color: var(--hf-text-muted) !important;
}
.pf-v5-c-nav__link.pf-m-current,
.pf-v5-c-nav__link:hover {
  color: var(--hf-text) !important;
}
.pf-v5-c-nav__link.pf-m-current::before {
  border-color: var(--hf-accent) !important;
}
.pf-v5-c-nav__link.pf-m-current,
.pf-v5-c-nav__link:hover {
  background: #18181b !important;
}
.pf-v5-c-nav__item {
  border-color: var(--hf-border) !important;
}

/* "Jump to section" links: PatternFly's dark text vanishes on this page. */
.pf-v5-c-jump-links__link-text {
  color: var(--hf-text-muted) !important;
}
.pf-v5-c-jump-links__item.pf-m-current .pf-v5-c-jump-links__link-text,
.pf-v5-c-jump-links__link:hover .pf-v5-c-jump-links__link-text {
  color: var(--hf-text) !important;
}
.pf-v5-c-jump-links__item.pf-m-current .pf-v5-c-jump-links__link::before {
  border-color: var(--hf-accent) !important;
}

/* Main content area; .pf-m-light hardcodes white here. */
.pf-v5-c-page__main,
.pf-v5-c-page__main-section,
.pf-v5-c-page__main-section.pf-m-light {
  background: transparent !important;
  color: var(--hf-text);
}

.pf-v5-c-title,
.pf-v5-c-content h1,
.pf-v5-c-content h2,
.pf-v5-c-content h3 {
  color: var(--hf-text) !important;
  letter-spacing: -0.01em;
}
.pf-v5-c-content,
.pf-v5-c-content p {
  color: var(--hf-text-muted);
}

/* Content cards: profile, security, applications, etc. */
.pf-v5-c-card {
  background: var(--hf-surface) !important;
  border: 1px solid var(--hf-border);
  border-radius: 12px;
  color: var(--hf-text);
}
.pf-v5-c-card__title,
.pf-v5-c-card__body,
.pf-v5-c-card__footer {
  color: var(--hf-text);
}

/* Modals (error/confirm dialogs) and dropdown menus are white in
   PatternFly; with the light .pf-v5-c-title above they were unreadable. */
.pf-v5-c-modal-box,
.pf-v5-c-menu,
.pf-v5-c-dropdown__menu,
.pf-v5-c-select__menu {
  background: var(--hf-surface) !important;
  border: 1px solid var(--hf-border);
  border-radius: 12px;
  color: var(--hf-text);
}
.pf-v5-c-modal-box__body,
.pf-v5-c-menu__item,
.pf-v5-c-menu__item-text,
.pf-v5-c-dropdown__menu-item {
  color: var(--hf-text) !important;
}
.pf-v5-c-menu__item:hover,
.pf-v5-c-dropdown__menu-item:hover {
  background: #18181b !important;
}

/* Form labels/controls, matching the login theme */
.pf-v5-c-form__label-text,
.pf-v5-c-form__label {
  color: var(--hf-text-muted);
}
.pf-v5-c-form-control {
  /* PatternFly colours the inner <input> with this variable, not with the
     wrapper's `color`; with darkMode=false it is the light theme's #151515. */
  --pf-v5-c-form-control--Color: var(--hf-text);
  --pf-v5-c-form-control--BackgroundColor: var(--hf-input-bg);
  background: var(--hf-input-bg) !important;
  border: 1px solid var(--hf-input-border) !important;
  border-radius: 8px;
  color: var(--hf-text) !important;
}
.pf-v5-c-form-control > :is(input, select, textarea) {
  color: var(--hf-text) !important;
  caret-color: var(--hf-text);
}
.pf-v5-c-form-control > :is(input, textarea)::placeholder {
  color: var(--hf-text-muted);
  opacity: 0.7;
}
.pf-v5-c-form-control > input:-webkit-autofill,
.pf-v5-c-form-control > input:-webkit-autofill:hover,
.pf-v5-c-form-control > input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--hf-text);
  -webkit-box-shadow: 0 0 0 1000px var(--hf-input-bg) inset;
  caret-color: var(--hf-text);
}
/* PatternFly draws its own light border on the wrapper's ::before and an
   accent line on ::after; use the wrapper's border and focus ring only. */
.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after {
  border: none !important;
}
.pf-v5-c-form-control:focus,
.pf-v5-c-form-control:focus-within {
  outline: none;
  border-color: var(--hf-accent) !important;
  box-shadow: 0 0 0 3px rgba(94, 94, 240, 0.3);
}

.pf-v5-c-button.pf-m-primary {
  background: var(--hf-accent) !important;
  border: none;
  border-radius: 8px;
  font-weight: 600;
}
.pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus {
  background: var(--hf-accent-hover) !important;
}
.pf-v5-c-button.pf-m-link {
  color: var(--hf-link) !important;
}

/* Data lists / description lists used throughout account security pages */
.pf-v5-c-description-list__term,
.pf-v5-c-description-list__text {
  color: var(--hf-text);
}
.pf-v5-c-description-list__description {
  color: var(--hf-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
