/* =========================================================================
   Santé GN — Keycloak login theme
   Extends keycloak.v2 — override only what needs to change
   ========================================================================= */

/* ---- Brand color palette --------------------------------------------------
   Change these three values to rebrand the whole login flow.
--------------------------------------------------------------------------- */
:root {
    --santegn-primary:      #2e7d32;   /* health green */
    --santegn-primary-dark: #1b5e20;
    --santegn-primary-soft: #e8f5e9;
    --santegn-text:         #1c1c1c;
    --santegn-muted:        #5a6a5b;

    --pf-v5-global--primary-color--100: var(--santegn-primary);
    --pf-v5-global--primary-color--200: var(--santegn-primary-dark);
    --pf-v5-global--link--Color: var(--santegn-primary);
    --pf-v5-global--link--Color--hover: var(--santegn-primary-dark);
    --pf-v5-global--active-color--100: var(--santegn-primary);
}

/* ---- Page background ------------------------------------------------------ */
body.login-pf,
.login-pf-page,
.login-pf body {
    background:
        linear-gradient(135deg, var(--santegn-primary-soft) 0%, #ffffff 60%, #f8faf8 100%);
}

/* ---- Layout: override KC's grid so header sits ABOVE main, both centered - */
.pf-v5-c-login__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    gap: 1.5rem !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
}

.pf-v5-c-login__header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    grid-area: unset !important;
}

.pf-v5-c-login__main {
    grid-area: unset !important;
    margin: 0 !important;
}

/* ---- Logo -----------------------------------------------------------------
   Uses ../img/logo.png (relative to this CSS file).
   Tweak height/width if the coat of arms feels too small or too large.
--------------------------------------------------------------------------- */
#kc-header-wrapper {
    background-image: url("../img/logo.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    height: 100px;
    width: 200px;
    font-size: 0 !important;
    color: transparent !important;
    text-indent: -9999px;
}

/* ---- Login card ----------------------------------------------------------- */
.login-pf-page .card-pf,
.login-pf-page main,
.pf-v5-c-login__main {
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(46, 125, 50, 0.08);
    padding: 2rem 2rem 1.5rem;
}

/* ---- Primary button (Se connecter, Continuer, etc.) ---------------------- */
.pf-v5-c-button.pf-m-primary,
.pf-c-button.pf-m-primary,
input[type="submit"].pf-v5-c-button.pf-m-primary {
    background-color: var(--santegn-primary);
    border-color: var(--santegn-primary);
}

.pf-v5-c-button.pf-m-primary:hover,
.pf-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus {
    background-color: var(--santegn-primary-dark);
    border-color: var(--santegn-primary-dark);
}

/* ---- Inputs — focus ring in brand color ----------------------------------- */
.pf-v5-c-form-control:focus,
.pf-c-form-control:focus,
.pf-v5-c-form-control:focus-within {
    border-color: var(--santegn-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* ---- Links (Mot de passe oublié, Se souvenir, etc.) ----------------------- */
.login-pf-page a,
.kc-form-options a,
.pf-v5-c-login__main a {
    color: var(--santegn-primary);
    text-decoration: none;
}

.login-pf-page a:hover,
.pf-v5-c-login__main a:hover {
    color: var(--santegn-primary-dark);
    text-decoration: underline;
}

/* ---- Footer / small text -------------------------------------------------- */
.login-pf-page .login-pf-signup {
    color: var(--santegn-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1rem;
}

/* ---- Alert (error messages) ----------------------------------------------- */
.pf-v5-c-alert.pf-m-danger,
.alert-error {
    border-left: 4px solid #d32f2f;
}

/* ---- Typography ----------------------------------------------------------- */
body.login-pf {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--santegn-text);
}

.login-pf-page-header h1 {
    color: var(--santegn-primary-dark);
    font-weight: 600;
}

/* ---- Small screens -------------------------------------------------------- */
@media (max-width: 480px) {
    .login-pf-page .card-pf,
    .pf-v5-c-login__main {
        padding: 1.5rem 1rem;
        margin: 1rem;
    }
    #kc-header-wrapper {
        height: 70px;
        width: 140px;
    }
    .pf-v5-c-login__container {
        gap: 1rem !important;
        padding: 1rem;
    }
}



/* ---- Layout: override KC's grid so header sits ABOVE main, both centered - */
.pf-v5-c-login__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    width: 100% !important;
    gap: 1.5rem !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    padding: 2rem 1rem !important;
    margin: 0 auto !important;
}

.pf-v5-c-login__header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    align-self: center !important;
    margin: 0 !important;
    width: auto !important;
    grid-area: unset !important;
}

.pf-v5-c-login__main {
    grid-area: unset !important;
    align-self: center !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 480px !important;
}

/* Reset any left-padding or alignment on the outer login wrapper */
.pf-v5-c-login,
.login-pf,
.login-pf-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
}

.pf-v5-c-login__main,
.pf-v5-c-login__main-header,
.pf-v5-c-login__main-body {
    text-align: left !important;
}
