/* AI OS — login branding.
 *
 * This stylesheet is served at /static/dist/custom.css and adopted into the sign-in flow's shadow roots, so it
 * restyles the login form itself. Goal: make the SSO login look like part of AI OS Control (blue Aura theme,
 * dark backdrop, Lato type) and strip the upstream vendor's own branding. Selectors target PatternFly (pf-c-*),
 * the UI framework the flow is built on.
 *
 * NB: this file is delivered to the browser — keep comments vendor-neutral (don't name the IdP here). The
 * deployment wiring is documented repo-side (compose + SSO blueprints), not in this file.
 *
 * We DON'T rebuild login in the app (it has no login page — auth is fully delegated to the front-door SSO gate).
 * Restyling the real flow keeps MFA/consent/recovery and survives upstream upgrades. Mirrors the app's PrimeNG/Aura
 * tokens: blue primary (app/src/app.config.ts) + Lato (app/src/assets/layout/_core.scss).
 *
 * NOTE: tweak visually after deploy — exact PatternFly classes vary slightly per release.
 */

/* Match the app's body font. Best-effort web import (same source app/src/index.html uses); if the page CSP
 * blocks it, the Lato → sans-serif fallback below still reads correctly — nothing breaks. */
@import url("https://fonts.cdnfonts.com/css/lato");

:root,
:host {
    /* Brand blue — matches app/src/app.config.ts (Aura "blue" primary 500/600/700). */
    --ak-accent: #3b82f6;
    --pf-global--primary-color--100: #3b82f6;
    --pf-global--primary-color--200: #2563eb;
    --pf-global--link--Color: #3b82f6;
    --pf-global--link--Color--hover: #1d4ed8;
    --pf-global--active-color--100: #3b82f6;
    --pf-global--BackgroundColor--100: #3b82f6;
    --pf-c-button--m-primary--BackgroundColor: #3b82f6;
    --pf-c-button--m-primary--hover--BackgroundColor: #2563eb;
    --pf-c-button--m-primary--active--BackgroundColor: #1d4ed8;
    --pf-c-button--m-primary--focus--BackgroundColor: #2563eb;
    /* Lato everywhere the flow uses its global font token. */
    --pf-global--FontFamily--sans-serif: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Apply the app font to the flow shell + card (covers spots that don't read the PF token). */
:host,
body,
.pf-c-login,
.pf-c-login__main,
.pf-c-form-control,
.pf-c-button {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Backdrop — soft blue→slate gradient instead of the default image. */
.pf-c-background-image {
    background: radial-gradient(1200px 620px at 50% -12%, #1e3a8a 0%, #0f172a 58%, #0b1220 100%) !important;
}
.pf-c-background-image__filter,
.pf-c-background-image svg,
.pf-c-background-image::before { display: none !important; }

/* Brand logo sits above the card on the dark backdrop. */
.pf-c-login__header img,
.pf-c-brand { max-height: 58px !important; height: 58px !important; }

/* Login card — rounded with a soft shadow, like an Aura surface card. */
.pf-c-login__main {
    border-radius: 16px !important;
    box-shadow: 0 22px 60px rgba(2, 6, 23, .5) !important;
    border: 1px solid rgba(148, 163, 184, .14) !important;
    overflow: hidden;
}
.pf-c-login__main-header { padding-top: 1.6rem; }

/* Flow title ("Sign in to AI OS") — tighten to the app's heading weight. */
.pf-c-login__main-header .pf-c-title,
.pf-c-login__main-body .pf-c-title {
    font-weight: 700 !important;
    letter-spacing: -.01em;
}

/* Inputs — app's rounded look + a brand-blue focus ring (Aura's focus affordance). */
.pf-c-form-control {
    border-radius: 10px !important;
    transition: border-color .15s, box-shadow .15s;
}
.pf-c-form-control:focus,
.pf-c-form-control:focus-within {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25) !important;
    outline: none !important;
}

/* Primary button — rounded, weighted, brand blue (set via the PF tokens above). */
.pf-c-button.pf-m-primary {
    border-radius: 10px !important;
    font-weight: 600;
    letter-spacing: .2px;
}

/* Links (forgot password, etc.) pick up the brand blue. */
.pf-c-login a,
.pf-c-login__main a { color: #3b82f6 !important; }

/* ===== Strip the upstream vendor's own credit/branding ===== */
/* The "powered by" footer band + the vendor link, plus any default footer links. */
.pf-c-login__main-footer-band,
.pf-c-login__footer,
.pf-c-login__main-footer-links,
a[href*="goauthentik.io"] { display: none !important; }
