/* Park Sense login skin, layered over keycloak.v2's styles.css (see theme.properties).
 * Background: Noosa Hinterland QLD, Colin Hobson, Unsplash License (see resources/img/SOURCE.txt).
 * Fonts: Ubuntu and Inter, stored in resources/fonts so nothing is fetched from anywhere else (sources in
 * resources/img/SOURCE.txt, licences beside the files). The look is Sara's design of 5 Nov 2026. */

@font-face { font-family: "Ubuntu"; font-weight: 400; font-display: swap; src: url("../fonts/ubuntu-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 500; font-display: swap; src: url("../fonts/ubuntu-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 700; font-display: swap; src: url("../fonts/ubuntu-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
    --ps-dark: #234a2e;      /* forest green: wordmark, heading, card edge, Sign In */
    --ps-green: #3f7a4e;     /* a focused field */
    --ps-amber: #e8a63d;
    --ps-ink: #1f3326;       /* labels and typed text */
    --ps-line: rgba(35, 74, 46, 0.16);
    --ps-fill: #faf9f6;      /* fields */
    --ps-brand: "Ubuntu", "Segoe UI", Arial, sans-serif;
    --ps-text: "Inter", "Segoe UI", Arial, sans-serif;
    --keycloak-card-top-color: var(--ps-dark);
    /* PatternFly's fonts -> ours, so no page falls back to Keycloak's Red Hat fonts */
    --pf-v5-global--FontFamily--text: var(--ps-text);
    --pf-v5-global--FontFamily--heading: var(--ps-brand);
    /* PatternFly primary (Sign In button, links) -> Park Sense greens */
    --pf-v5-global--primary-color--100: var(--ps-dark);
    --pf-v5-global--primary-color--200: #2f6b3f;
    --pf-v5-global--link--Color: #1f6e33;
    --pf-v5-global--link--Color--hover: var(--ps-dark);
}

/* Background anchored at the TOP: the photo's horizon sits about 31% down the image, so with the heading
 * pinned near the top of the window (below) the heading is always in the sky, at any window shape.
 * The first layer is the light wash over the photo; the stone colour shows until the photo has loaded. */
.login-pf body {
    background: linear-gradient(rgba(228, 227, 221, 0.35), rgba(228, 227, 221, 0.35)) no-repeat center top fixed,
                #e4e3dd url("../img/background.jpg") no-repeat center top fixed;
    background-size: cover;
}

/* Desktop / tablet: content starts near the top instead of being centred vertically (centring put the
 * heading on the horizon on tall or 1080p windows). */
.pf-v5-c-login {
    align-items: flex-start;
    padding-top: 6vh;
}

/* Ultrawide (wider than 2.1:1): the photo is scaled by width, so its horizon sits at least ~43% down the
 * window, well below a centred heading. Centre the content again so the card isn't stranded at the top. */
@media (min-aspect-ratio: 21/10) {
    .pf-v5-c-login { align-items: center; padding-top: 0; }
}

/* Heading, top to bottom: the app icon, the "ParkSense" wordmark, "Ranger portal", and on dev the Development
 * badge, all drawn by CSS, so the realm display name doesn't matter.
 * Fixed sizes (not window-relative) so it sits in the same place as the window is resized. The heading and the
 * card together take no more height than the page before this look (203 + 415px), so no window scrolls more. */
#kc-header-wrapper {
    font-size: 0;            /* hide the realm display name text */
    text-transform: none;    /* keycloak.v2 upper-cases the brand */
    letter-spacing: 0;
    white-space: nowrap;     /* keep the wordmark on one line */
    text-align: center;
    width: 100%;
    margin: 0;
}
#kc-header-wrapper::before {
    content: "ParkSense";
    display: block;
    font: 700 72px/1 var(--ps-brand);
    letter-spacing: -0.01em;
    color: var(--ps-dark);
}
#kc-header-wrapper::after {
    content: "Ranger portal";
    display: block;
    margin-top: 8px;
    padding-left: 0.32em;    /* balances the spacing after the last letter, so the line stays centred */
    font: 400 1rem/1.4 var(--ps-brand);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #4f5761;          /* darker than the design's #5e6670, for reading over clouds */
}

#kc-header.pf-v5-c-login__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;               /* the icon takes the 64px PatternFly leaves above the heading on wide windows */
    padding: 0 16px 24px;
}
#kc-header::before {
    content: "";
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 22%;
    background: url("../img/parksense-icon.png") center / cover no-repeat;
    box-shadow: 0 14px 30px -10px rgba(22, 40, 59, 0.45);
}
/* Dev-only environment badge (body class comes from KC_HOSTNAME; prod shows nothing). */
body[class*="ps-host-auth.dev."] #kc-header::after {
    content: "Development";
    display: inline-block;
    margin-top: 12px;
    padding: 4px 14px 4px 28px;
    border: 1px solid rgba(232, 166, 61, 0.55);
    border-radius: 999px;
    background: radial-gradient(circle at 16px 50%, var(--ps-amber) 0 3px, transparent 3.5px), rgba(232, 166, 61, 0.16);
    color: #7a5e18;
    font: 500 0.72rem/1.4 var(--ps-brand);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* Card: white, rounded, a forest-green top edge (keycloak.v2's, from --keycloak-card-top-color), a soft shadow. */
.pf-v5-c-login__main {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(35, 50, 40, 0.06), 0 40px 80px -30px rgba(35, 50, 40, 0.45);
}
/* The fields and button are taller than the page before this look, so the gaps around them are smaller:
 * the card stays 415px tall. */
.pf-v5-c-login__main-header { padding-top: 32px; }
.pf-v5-c-login__main-body { padding-bottom: 25px; }
.pf-v5-c-login__main .pf-v5-c-form { --pf-v5-c-form--GridGap: 16px; }
#kc-page-title {
    font: 500 28px/1.3 var(--ps-brand);
    color: var(--ps-dark);
}
.pf-v5-c-login__main .pf-v5-c-form__label-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ps-ink);
}

/* Fields: 48px, rounded, a pale fill, one thin edge in place of PatternFly's two, a green ring while typing.
 * A field Keycloak marks invalid keeps a red edge. */
.pf-v5-c-login__main .pf-v5-c-form-control {
    --pf-v5-c-form-control--BackgroundColor: var(--ps-fill);
    --pf-v5-c-form-control--Color: var(--ps-ink);
    --pf-v5-c-form-control--PaddingLeft: 14px;
    border: 1px solid var(--ps-line);
    border-radius: 10px;
}
.pf-v5-c-login__main .pf-v5-c-form-control::before,
.pf-v5-c-login__main .pf-v5-c-form-control::after { border: 0; }
.pf-v5-c-login__main .pf-v5-c-form-control > input { min-height: 46px; }
.pf-v5-c-login__main .pf-v5-c-form-control > input:focus { outline: 2px solid transparent; } /* still shows in high contrast */
.pf-v5-c-login__main .pf-v5-c-form-control:focus-within {
    --pf-v5-c-form-control--BackgroundColor: #fff;
    border-color: var(--ps-green);
    box-shadow: 0 0 0 3px rgba(63, 122, 78, 0.18);
    z-index: 1;              /* the ring shows over the eye button beside it */
}
.pf-v5-c-login__main .pf-v5-c-form-control.pf-m-error { border-color: var(--pf-v5-global--danger-color--100); }
/* A field with a button on its right (password and its eye) reads as one rounded field. */
.pf-v5-c-login__main .pf-v5-c-input-group .pf-v5-c-form-control { border-radius: 10px 0 0 10px; }
.pf-v5-c-login__main .pf-v5-c-input-group .pf-v5-c-button.pf-m-control {
    --pf-v5-c-button--m-control--BackgroundColor: var(--ps-fill);
    --pf-v5-c-button--after--BorderColor: var(--ps-line) var(--ps-line) var(--ps-line) transparent;
    border-radius: 0 10px 10px 0;
}
.pf-v5-c-login__main .pf-v5-c-input-group .pf-v5-c-button.pf-m-control::after { border-radius: inherit; }

/* Sign In, and the main button on the other pages. */
.pf-v5-c-login__main .pf-v5-c-button.pf-m-primary {
    --pf-v5-c-button--BorderRadius: 10px;
    min-height: 50px;
    font: 500 1rem/1.5 var(--ps-brand);
    letter-spacing: 0.06em;
    box-shadow: 0 10px 30px -12px rgba(35, 74, 46, 0.6);
}

/* Phones: heading and card centred on the screen, card floating with a margin and rounded corners.
 * (keycloak.v2 fixes the column at 34rem / 544px, wider than a phone.) */
@media (max-width: 600px) {
    .login-pf body { background-attachment: scroll; background-position: center center; }
    .pf-v5-c-login {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 16px;
    }
    .pf-v5-c-login__container { grid-template-columns: minmax(0, 1fr); width: 100%; }
    #kc-header.pf-v5-c-login__header { justify-content: center; height: auto; padding: 0 0 20px; }
    #kc-header::before { width: 56px; height: 56px; margin-bottom: 10px; }
    #kc-header-wrapper::before { font-size: 48px; }
    /* the page can be taller than a small phone: let the photo cover all of it */
    html.login-pf, .login-pf body { height: auto; }
    /* "Sign in to your account" stays on one line: the card's inner width is the window less 96px */
    #kc-page-title { font-size: min(28px, calc((100vw - 96px) / 10.7)); }
}
/* A phone on its side: no room for the icon, and the wordmark drops to the size it had before this look. */
@media (max-height: 500px) {
    #kc-header::before { display: none; }
    #kc-header-wrapper::before { font-size: 64px; }
    #kc-header-wrapper::after { margin-top: 4px; }
}
/* Identity-provider button(s) shrunk to a small link in the card's bottom-right corner (2026-10-21): rangers
 * see a plain username/password card, the internal team still reaches Leakster AD through the link.
 * Presentation only, not access control. */
/* The divider above it: footer-band up to Keycloak 26.7, kc-login-divider from 26.8. */
.pf-v5-c-login__main-footer-band, .kc-login-divider { display: none; }
.pf-v5-c-login__main-footer { padding: 6px 0 6px !important; margin: 0 !important; }
#kc-social-providers ul { padding: 0 !important; margin: 0; list-style: none; }
#kc-social-providers li { padding: 0 !important; text-align: right; }
/* 8px vertical padding keeps a usable tap area on phones */
#kc-social-providers a.pf-v5-c-button {
    display: inline-block !important;
    width: auto;
    min-height: 0;
    padding: 8px 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: #5e6670;
    font: 400 0.88rem/1.4 var(--ps-text);
    text-decoration: underline;
}
#kc-social-providers a.pf-v5-c-button:hover { color: var(--ps-dark); }
#kc-social-providers a.pf-v5-c-button::after,
#kc-social-providers a.pf-v5-c-button svg,
#kc-social-providers a.pf-v5-c-button img { display: none; }   /* img: the provider icon from Keycloak 26.8 */
#social-leakster-ad span { font-size: 0; margin: 0 !important; }
#social-leakster-ad span::after { content: "Leakster staff sign-in"; font-size: 0.88rem; }
