/*
 * Thème Keycloak inspiré de l'espace AGIRC-ARRCO
 * Compatible avec la structure HTML Keycloak 21.1.2
 *
 * Images attendues :
 * - ../img/logo.svg
 * - ../img/background-login.jpg
 */

:root {
    --header-height: 100px;

    --primary: #a71988;
    --primary-dark: #83116d;
    --primary-light: #c51a9d;

    --text: #151515;
    --muted: #555b66;

    --field-background: #edf3ff;
    --field-border: #a5afbd;

    --card-background: rgba(255, 255, 255, 0.88);
    --card-border: rgba(255, 255, 255, 0.65);

    --shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:hover,
a:focus {
    color: var(--primary);
}

.login-pf {
    min-height: 100%;
    background: none;
}

.login-pf body {
    min-height: 100vh;
    background-image: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07)), url("../img/background-login.jpg");
    background-position: center var(--header-height);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.login-pf body::before {
    position: fixed;
    z-index: 0;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    content: "";
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.22));
    pointer-events: none;
}

.login-pf-page {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    padding: calc(var(--header-height) + 92px) 24px 60px;
}

#kc-header {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: var(--header-height);
    margin: 0;
    padding: 0;
    color: #ffffff;
    background: linear-gradient(105deg, #8d1a83 0%, #a4138b 40%, #c80791 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

#kc-header-wrapper {
    display: block;
    flex: 0 0 240px;
    width: 240px;
    height: var(--header-height);
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
    background-color: #ffffff;
    background-image: url("../img/logo.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 175px auto;
}

#kc-header::after {
    display: flex;
    flex: 1;
    align-items: center;
    padding-left: min(16vw, 240px);
    content: "PLATEFORME COLLABORATIVE - RECETTE";
    color: #ffffff;
    font-size: 23px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
}

.card-pf,
.login-pf-page .card-pf {
    position: relative;
    width: min(860px, 100%);
    max-width: 860px;
    margin: 0;
    padding: 30px 42px 38px;
    background: var(--card-background);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.login-pf-header {
    margin: 0;
    padding: 0;
}

h1#kc-page-title {
    margin: 0 0 35px;
    padding: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
}

#kc-content,
#kc-content-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

#kc-content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
    gap: 44px;
    align-items: center;
}

#kc-form,
#kc-form-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

.form-group {
    margin: 0 0 16px;
}

.pf-c-form__label,
.pf-c-form__label-text,
.control-label {
    display: block;
    margin: 0 0 7px;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
}

.pf-c-form-control,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 12px;
    color: var(--text);
    background: var(--field-background);
    border: 1px solid var(--field-border);
    border-radius: 5px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.pf-c-form-control:hover,
.form-control:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: #818c9d;
}

.pf-c-form-control:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(167, 25, 136, 0.15);
}

.pf-c-form-control[aria-invalid="true"],
.has-error .pf-c-form-control,
.has-error .form-control {
    border-color: #c9190b;
}

.login-pf-settings {
    min-height: 18px;
    margin-top: 2px;
    margin-bottom: 17px;
}

#kc-form-options {
    color: var(--muted);
    font-size: 13px;
}

#kc-form-options .checkbox {
    margin: 0;
}

#kc-form-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

#kc-form-options input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--primary);
}

#kc-form-buttons {
    margin: 18px 0 0;
    text-align: center;
}

.pf-c-button.pf-m-primary,
.btn-primary,
#kc-login,
input[type="submit"] {
    display: inline-flex;
    width: auto;
    min-width: 225px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 10px 28px;
    color: #ffffff;
    background: linear-gradient(100deg, var(--primary-dark), var(--primary-light));
    border: 0;
    border-radius: 24px;
    box-shadow: 0 7px 16px rgba(131, 17, 109, 0.22);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.pf-c-button.pf-m-primary::before,
#kc-login::before {
    margin-right: 7px;
    font-size: 9px;
}

.pf-c-button.pf-m-primary:hover,
.pf-c-button.pf-m-primary:focus,
.btn-primary:hover,
.btn-primary:focus,
#kc-login:hover,
#kc-login:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
    color: #ffffff;
    filter: brightness(1.06);
    box-shadow: 0 9px 20px rgba(131, 17, 109, 0.3);
    text-decoration: none;
    transform: translateY(-1px);
}

.pf-c-button.pf-m-primary:active,
#kc-login:active,
input[type="submit"]:active {
    box-shadow: 0 4px 10px rgba(131, 17, 109, 0.22);
    transform: translateY(1px);
}

.pf-c-button.pf-m-block#kc-login {
    display: inline-flex;
    width: auto;
}

#kc-social-providers {
    min-width: 0;
    margin: 0;
    padding: 2px 0 2px 34px;
    border-left: 1px solid rgba(60, 60, 60, 0.18);
}

#kc-social-providers hr {
    display: none;
}

#kc-social-providers h4 {
    margin: 0 0 17px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    text-transform: uppercase;
}

#kc-social-providers h4::before {
    margin-right: 7px;
    content: "●";
    color: var(--primary);
    font-size: 9px;
    vertical-align: 2px;
}

.kc-social-links {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kc-social-links li {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Boutons de droite : même design que 'Se connecter' */
.kc-social-item,
a.kc-social-item {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px 28px;
    color: #ffffff;
    background: linear-gradient(100deg, var(--primary-dark), var(--primary-light));
    border: 0;
    border-radius: 24px;
    box-shadow: 0 7px 16px rgba(131, 17, 109, 0.22);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.kc-social-item::before,
a.kc-social-item::before {
    margin-right: 7px;
    font-size: 9px;
}

.kc-social-item::after,
a.kc-social-item::after {
    content: none;
}

.kc-social-item:hover,
.kc-social-item:focus,
a.kc-social-item:hover,
a.kc-social-item:focus {
    color: #ffffff;
    background: linear-gradient(100deg, var(--primary-dark), var(--primary-light));
    border: 0;
    filter: brightness(1.06);
    box-shadow: 0 9px 20px rgba(131, 17, 109, 0.3);
    text-decoration: none;
    transform: translateY(-1px);
}

.kc-social-item:active,
a.kc-social-item:active {
    box-shadow: 0 4px 10px rgba(131, 17, 109, 0.22);
    transform: translateY(1px);
}

.kc-social-provider-name {
    display: block;
	color:white !important;
}

.pf-c-alert,
.alert {
    margin: 0 0 22px;
    padding: 13px 15px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.4;
}

.pf-m-danger,
.alert-error {
    color: #8a1f17;
    background: #fff2f1;
    border: 1px solid #e8aaa4;
}

.pf-m-success,
.alert-success {
    color: #285b32;
    background: #edf8ef;
    border: 1px solid #9dcea7;
}

#kc-totp-secret-qr-code {
    display: block;
    width: 175px;
    max-width: 100%;
    margin: 18px auto;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
}

#kc-totp-secret-key {
    margin: 12px 0;
    padding: 10px;
    overflow-wrap: anywhere;
    background: var(--field-background);
    border: 1px solid var(--field-border);
    border-radius: 5px;
    font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 800px) {
    :root {
        --header-height: 88px;
    }

    #kc-header-wrapper {
        flex-basis: 205px;
        width: 205px;
        height: var(--header-height);
        background-size: 150px auto;
    }

    #kc-header::after {
        padding-left: 45px;
        font-size: 19px;
    }

    .login-pf-page {
        padding: calc(var(--header-height) + 55px) 18px 40px;
    }

    .card-pf,
    .login-pf-page .card-pf {
        max-width: 600px;
        padding: 28px 30px 32px;
    }

    #kc-content-wrapper {
        grid-template-columns: 1fr;
        gap: 29px;
    }

    #kc-social-providers {
        padding: 25px 0 0;
        border-top: 1px solid rgba(60, 60, 60, 0.18);
        border-left: 0;
    }

    #kc-social-providers h4 {
        text-align: center;
    }
}

@media (max-width: 560px) {
    :root {
        --header-height: 140px;
    }

    #kc-header {
        display: block;
        height: var(--header-height);
    }

    #kc-header-wrapper {
        width: 100%;
        height: 78px;
        background-size: 145px auto;
    }

    #kc-header::after {
        display: flex;
        height: 62px;
        align-items: center;
        justify-content: center;
        padding: 0 15px;
        font-size: 17px;
        text-align: center;
    }

    .login-pf body {
        background-position: center var(--header-height);
    }

    .login-pf-page {
        padding: calc(var(--header-height) + 30px) 12px 30px;
    }

    .card-pf,
    .login-pf-page .card-pf {
        width: 100%;
        padding: 25px 20px 27px;
        background: rgba(255, 255, 255, 0.94);
        border-radius: 8px;
    }

    h1#kc-page-title {
        margin-bottom: 26px;
        font-size: 18px;
    }

    .pf-c-button.pf-m-primary,
    #kc-login,
    input[type="submit"] {
        width: 100%;
        min-width: 0;
    }

    .kc-social-item,
    a.kc-social-item {
        min-height: 48px;
    }
}

/* =========================
   Mot de passe oublié
   ========================= */

#forgot-password-wrapper {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

#forgetPassword.forgot-password-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    color: #ffffff;
    background: linear-gradient(100deg, var(--primary-dark), var(--primary-light));
    border: 0;
    border-radius: 24px;
    box-shadow: 0 5px 12px rgba(131, 17, 109, 0.18);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 150ms ease, filter 150ms ease;
}

#forgetPassword.forgot-password-button:hover,
#forgetPassword.forgot-password-button:focus {
    color: #ffffff;
    filter: brightness(1.06);
    box-shadow: 0 7px 16px rgba(131, 17, 109, 0.26);
    text-decoration: none;
    transform: translateY(-1px);
}

#forgetPassword.forgot-password-button:active {
    box-shadow: 0 3px 8px rgba(131, 17, 109, 0.2);
    transform: translateY(1px);
}

@media (max-width: 560px) {
    #forgetPassword.forgot-password-button {
        width: 100%;
    }
}
/* **** confirm code **** */
input[name="resend"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: unset !important;
  color: #bb1996 !important;
}

input[name="cancel"] {
  background: transparent !important;
  color: #66696e !important;
  border: 1px solid #bbb !important;
}

input[type="submit"]:not(input[name="cancel"]) {
  width: 58% !important;
}

#kc-content-wrapper:not(:has(input[name="login"])) {
  display: unset !important;
  align-items: unset !important;
}

#kc-content-wrapper:not(:has(input[name="login"])) .pf-c-button {
  display: flex;
}

#kc-content-wrapper:not(:has(input[name="login"])) .form-group {
  max-width: 60%;
  margin: 0 auto;
  margin-bottom: 1.8em;
  margin-top: 2.3em;
}

input[type="submit"][name="resend"] {
  font-size: 0 !important;
}

#kc-content-wrapper:not(:has(input[name="login"]))
  form:has(input[name="resend"])::after {
  content: "Renvoyer un nouveau code";
  top: 63%;
  left: 37%;
  position: absolute;
  font-size: 15px;
  font-weight: 600;
  color: #8a1272;
}

#kc-content-wrapper:not(:has(input[name="login"])) .form-group > label {
  display: none;
}

#kc-content-wrapper:not(:has(input[name="login"])) > p {
  font-size: 0;
  position: relative;
}

#kc-content-wrapper:not(:has(input[name="login"])) > p:after {
  content: "Entrez le code reçu";
  position: absolute;
  font-size: 16px;
  left: 9.6em;
  color: #353535;
  font-weight: 500;
}

.login-pf a:hover {
    color: #c80891;
}