/* ===========================================================================
   Freepod account-console skin
   ---------------------------------------------------------------------------
   Brands Keycloak's keycloak.v3 account console, a PatternFly 5 React SPA.
   js/dark.js always applies PatternFly's dark theme, and this sheet retunes
   that theme's global variables to the Freepod palette and type, so components
   inherit the brand instead of being restyled one by one.

   A settings surface, not a hero: dark Freepod palette, brand fonts and
   gradient primary buttons, without the landing page's animated aurora.

   Palette and type mirror ui/src/components/landing/landingTokens.ts.
   ========================================================================== */

/* ── Self-hosted brand fonts ───────────────────────────────────────────── */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('../fonts/schibsted-grotesk-wght-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/space-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Brand tokens ──────────────────────────────────────────────────────── */
:root {
  --ink-abyss: #070A14;
  --ink-base: #0B1020;
  --ink-raised: #10162B;
  --ink-panel: #141B33;

  --accent-blue: #5B8CFF;
  --accent-cyan: #38BDF8;
  --accent-pink: #F472B6;

  --fg-primary: #F4F6FB;
  --fg-muted: #A6B0CC;
  --fg-faint: #6F7C9B;

  --line-soft: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.30);

  --display: 'Fraunces', Georgia, serif;
  --sans: 'Schibsted Grotesk', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;

  --cta-gradient: linear-gradient(120deg, #2563EB, #7C5BFF 55%, #EC4899);
  --cta-gradient-hover: linear-gradient(120deg, #1d4fd0, #6d4bf0 55%, #db3b89);
}

/* ── PatternFly dark theme, retuned ─────────────────────────────────────────
   PatternFly declares its dark values on :where(.pf-v5-theme-dark), which has
   no specificity, so these win without !important. */
:root.pf-v5-theme-dark {
  --pf-v5-global--BackgroundColor--100: var(--ink-raised);
  --pf-v5-global--BackgroundColor--150: var(--ink-raised);
  --pf-v5-global--BackgroundColor--200: var(--ink-base);
  --pf-v5-global--BackgroundColor--300: var(--ink-panel);
  --pf-v5-global--BackgroundColor--400: var(--ink-panel);
  --pf-v5-global--BackgroundColor--dark-100: var(--ink-abyss);
  --pf-v5-global--BackgroundColor--dark-200: var(--ink-base);
  --pf-v5-global--BackgroundColor--dark-300: var(--ink-raised);

  --pf-v5-global--Color--100: var(--fg-primary);
  --pf-v5-global--Color--200: var(--fg-muted);
  --pf-v5-global--Color--300: var(--fg-faint);

  --pf-v5-global--BorderColor--100: var(--line-soft);
  --pf-v5-global--BorderColor--300: var(--line-soft);
  --pf-v5-global--BorderColor--200: var(--line-strong);

  --pf-v5-global--primary-color--100: var(--accent-blue);
  --pf-v5-global--active-color--100: var(--accent-blue);
  --pf-v5-global--link--Color: var(--accent-blue);
  --pf-v5-global--link--Color--hover: var(--accent-pink);
  --pf-v5-global--link--Color--visited: var(--accent-blue);

  --pf-v5-global--FontFamily--text: var(--sans);
  --pf-v5-global--FontFamily--text--vf: var(--sans);
  --pf-v5-global--FontFamily--heading: var(--display);
  --pf-v5-global--FontFamily--heading--vf: var(--display);

  --pf-v5-global--BorderRadius--sm: 8px;
  --pf-v5-global--BorderRadius--lg: 12px;

  /* Lists, tables, menus, inputs and alerts re-scope the globals above to
     these "light"/"dark" aliases on themselves, so they need the brand too. */
  --pf-v5-global--BackgroundColor--light-100: var(--ink-raised);
  --pf-v5-global--BackgroundColor--light-200: var(--ink-base);
  --pf-v5-global--BackgroundColor--light-300: var(--ink-panel);
  --pf-v5-global--Color--dark-100: var(--fg-primary);
  --pf-v5-global--Color--dark-200: var(--fg-muted);
  --pf-v5-global--Color--light-100: var(--fg-primary);
  --pf-v5-global--Color--light-200: var(--fg-muted);
  --pf-v5-global--BorderColor--dark-100: var(--line-soft);
  --pf-v5-global--BorderColor--light-100: var(--line-soft);
}

/* ── Surfaces ──────────────────────────────────────────────────────────── */
body {
  background: var(--ink-base);
}
.pf-v5-c-page {
  --pf-v5-c-page--BackgroundColor: var(--ink-base);
  --pf-v5-c-page__sidebar--BackgroundColor: var(--ink-raised);
  --pf-v5-c-page__main-section--BackgroundColor: var(--ink-base);
  --pf-v5-c-page__main-section--m-light--BackgroundColor: var(--ink-base);
}
.pf-v5-c-page__sidebar {
  border-right: 1px solid var(--line-soft);
}

/* Pre-React loading screen: index.ftl's inline style is white unless the OS
   prefers dark. */
.keycloak__loading-container {
  color: var(--fg-muted) !important;
  background-color: var(--ink-base) !important;
}

/* ── Masthead ──────────────────────────────────────────────────────────── */
/* PatternFly's dark masthead and its toolbar are hard-wired to pure black. */
:root.pf-v5-theme-dark .pf-v5-c-masthead {
  --pf-v5-c-masthead--BackgroundColor: var(--ink-abyss);
  border-bottom: 1px solid var(--line-soft);
}
:root.pf-v5-theme-dark .pf-v5-c-masthead .pf-v5-c-toolbar {
  --pf-v5-c-toolbar--BackgroundColor: transparent;
}
/* The signed-in user's menu: a quiet pill rather than a filled box. */
:root.pf-v5-theme-dark .pf-v5-c-masthead .pf-v5-c-menu-toggle:not(.pf-m-plain) {
  --pf-v5-c-menu-toggle--BackgroundColor: transparent;
  --pf-v5-c-menu-toggle--hover--BackgroundColor: rgba(255, 255, 255, 0.04);
  --pf-v5-c-menu-toggle--m-expanded--BackgroundColor: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
:root.pf-v5-theme-dark .pf-v5-c-masthead .pf-v5-c-menu-toggle:not(.pf-m-plain)::before {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
:root.pf-v5-theme-dark .pf-v5-c-masthead .pf-v5-c-menu-toggle:not(.pf-m-plain)::after {
  display: none;
}
/* One row at every width. Below 768px PatternFly stacks the masthead, putting
   the user menu on a second row under the logo; these are the values its
   pf-m-display-inline modifier applies from 768px up. */
:root.pf-v5-theme-dark .pf-v5-c-masthead {
  --pf-v5-c-masthead--GridTemplateColumns: var(--pf-v5-c-masthead--m-display-inline--GridTemplateColumns);
  --pf-v5-c-masthead__main--GridColumn: var(--pf-v5-c-masthead--m-display-inline__main--GridColumn);
  --pf-v5-c-masthead__main--MinHeight: var(--pf-v5-c-masthead--m-display-inline__main--MinHeight);
  --pf-v5-c-masthead__main--Order: var(--pf-v5-c-masthead--m-display-inline__main--Order);
  --pf-v5-c-masthead__main--FlexBasis: var(--pf-v5-c-masthead--m-display-inline__main--FlexBasis);
  --pf-v5-c-masthead__main--PaddingTop: var(--pf-v5-c-masthead--m-display-inline__main--PaddingTop);
  --pf-v5-c-masthead__main--PaddingBottom: var(--pf-v5-c-masthead--m-display-inline__main--PaddingBottom);
  --pf-v5-c-masthead__main--MarginRight: var(--pf-v5-c-masthead--m-display-inline__main--MarginRight);
  --pf-v5-c-masthead__main--before--BorderBottom: var(--pf-v5-c-masthead--m-display-inline__main--BorderBottom);
  --pf-v5-c-masthead__toggle--GridColumn: var(--pf-v5-c-masthead--m-display-inline__toggle--GridColumn);
  --pf-v5-c-masthead__content--GridColumn: var(--pf-v5-c-masthead--m-display-inline__content--GridColumn);
  --pf-v5-c-masthead__content--MinHeight: var(--pf-v5-c-masthead--m-display-inline__content--MinHeight);
  --pf-v5-c-masthead__content--Order: var(--pf-v5-c-masthead--m-display-inline__content--Order);
  --pf-v5-c-masthead__content--PaddingTop: var(--pf-v5-c-masthead--m-display-inline__content--PaddingTop);
  --pf-v5-c-masthead__content--PaddingBottom: var(--pf-v5-c-masthead--m-display-inline__content--PaddingBottom);
  --pf-v5-c-masthead__content--MarginLeft: var(--pf-v5-c-masthead--m-display-inline__content--MarginLeft);
}
/* The toolbar opens with an empty right-aligned spacer, and the avatar item is
   right-aligned too, so below 992px (where pf-v5-u-m-0-on-lg stops cancelling
   it) the free space splits between them and the user menu floats mid-header.
   Keep the avatar beside the menu. */
:root.pf-v5-theme-dark .pf-v5-c-masthead .pf-v5-c-toolbar__item.pf-m-overflow-menu {
  margin-inline-start: 0;
}

/* "Freepod" wordmark beside the logo, in the brand serif. */
.pf-v5-c-masthead__brand::after {
  content: 'Freepod';
  margin-left: 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.pf-v5-c-nav {
  --pf-v5-c-nav__link--Color: var(--fg-muted);
  --pf-v5-c-nav__link--hover--Color: var(--fg-primary);
  --pf-v5-c-nav__link--m-current--Color: var(--fg-primary);
  --pf-v5-c-nav__link--BackgroundColor: transparent;
  --pf-v5-c-nav__link--hover--BackgroundColor: rgba(255, 255, 255, 0.04);
  --pf-v5-c-nav__link--m-current--BackgroundColor: rgba(91, 140, 255, 0.12);
  --pf-v5-c-nav__link--before--BorderColor: transparent;
  --pf-v5-c-nav__link--m-current--after--BorderColor: var(--accent-blue);
  --pf-v5-c-nav__section-title--Color: var(--fg-faint);
}

/* ── Headings ──────────────────────────────────────────────────────────── */
.pf-v5-c-title,
.pf-v5-c-content h1,
.pf-v5-c-content h2 {
  font-family: var(--display);
  letter-spacing: -0.01em;
}

/* ── Panels ────────────────────────────────────────────────────────────── */
.pf-v5-c-card {
  --pf-v5-c-card--BackgroundColor: var(--ink-raised);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

/* Lists of credentials, devices and linked accounts: PatternFly tops them with
   an 8px bar; a hairline reads better on this surface. */
:root.pf-v5-theme-dark .pf-v5-c-data-list {
  --pf-v5-c-data-list--BorderTopWidth: 1px;
  --pf-v5-c-data-list--sm--BorderTopWidth: 1px;
}

/* ── Forms ───────────────────────────────────────────────────────────────
   PatternFly's dark input is a flat box with only an underline. Freepod's is
   a soft rounded field outlined all round, as on the sign-in page. */
:root.pf-v5-theme-dark .pf-v5-c-form-control {
  --pf-v5-c-form-control--BackgroundColor: rgba(255, 255, 255, 0.04);
  --pf-v5-c-form-control--before--BorderTopColor: var(--line-soft);
  --pf-v5-c-form-control--before--BorderRightColor: var(--line-soft);
  --pf-v5-c-form-control--before--BorderLeftColor: var(--line-soft);
  --pf-v5-c-form-control--after--BorderBottomColor: var(--line-soft);
  --pf-v5-c-form-control--hover--after--BorderBottomColor: var(--line-strong);
  --pf-v5-c-form-control--focus--after--BorderBottomColor: var(--accent-blue);
  --pf-v5-c-form-control--m-readonly--BackgroundColor: rgba(255, 255, 255, 0.015);
  --pf-v5-c-form-control--m-readonly--hover--after--BorderBottomColor: var(--line-soft);
  --pf-v5-c-form-control--m-readonly--focus--after--BorderBottomColor: var(--line-soft);
  --pf-v5-c-form-control--m-disabled--BackgroundColor: rgba(255, 255, 255, 0.015);
  --pf-v5-c-form-control--m-disabled--Color: var(--fg-muted);
  border-radius: 10px;
}
:root.pf-v5-theme-dark .pf-v5-c-form-control::before,
:root.pf-v5-theme-dark .pf-v5-c-form-control::after {
  border-radius: 10px;
}
:root.pf-v5-theme-dark .pf-v5-c-form-control.pf-m-readonly,
:root.pf-v5-theme-dark .pf-v5-c-form-control.pf-m-disabled {
  color: var(--fg-muted);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.pf-v5-c-button.pf-m-primary {
  --pf-v5-c-button--m-primary--BackgroundColor: transparent;
  --pf-v5-c-button--m-primary--hover--BackgroundColor: transparent;
  background: var(--cta-gradient);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(124, 91, 255, 0.32);
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}
.pf-v5-c-button.pf-m-primary:hover {
  background: var(--cta-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(124, 91, 255, 0.44);
}
.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-tertiary {
  border-radius: 999px;
}
