/*
 * Econocom login theme.
 *
 * Tokens derived from "Econocom Graphics Guidelines", Dec. 2025:
 * bright blue #573EEF, dark violet #3E0D81, bright violet #8727D8,
 * soft cyan #89DEE0 and salmon #FF957F. Montserrat is the corporate font.
 * The official logo is intentionally not recreated here: add the approved
 * Communications asset before using a logo lock-up in a production theme.
 */

:root {
  --econocom-bright-blue: #573eef;
  --econocom-dark-violet: #3e0d81;
  --econocom-bright-violet: #8727d8;
  --econocom-soft-cyan: #89dee0;
  --econocom-salmon: #ff957f;
  --econocom-ink: #22133e;
  --econocom-surface: #ffffff;
  --econocom-muted: #6f6580;
}

body.login-pf,
.login-pf body {
  min-height: 100vh;
  background: var(--econocom-dark-violet) url("../img/login-bg-dark-violet.svg") center / cover fixed no-repeat;
  color: var(--econocom-ink);
  font-family: Montserrat, Arial, sans-serif;
}

.login-pf-page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

#kc-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

#kc-header-wrapper {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.03em;
}

#kc-header-wrapper::before {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .75rem 0 .75rem .75rem;
  background: linear-gradient(145deg, var(--econocom-bright-blue), var(--econocom-bright-violet));
  box-shadow: 0 .5rem 1.25rem rgb(87 62 239 / 26%);
  content: "";
}

.card-pf {
  border: 1px solid rgb(62 13 129 / 12%);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 1.25rem 3.75rem rgb(62 13 129 / 13%);
}

#kc-page-title,
.login-pf-page .card-pf-title {
  color: var(--econocom-dark-violet);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.035em;
}

.pf-c-form-control,
.form-control {
  min-height: 2.75rem;
  border: 1px solid #d9d2e6;
  border-radius: .6rem;
  box-shadow: none;
  font-family: Montserrat, Arial, sans-serif;
}

.pf-c-form-control:focus,
.form-control:focus {
  border-color: var(--econocom-bright-blue);
  box-shadow: 0 0 0 .2rem rgb(87 62 239 / 18%);
}

.pf-c-button.pf-m-primary,
#kc-login {
  min-height: 2.75rem;
  border: 0;
  border-radius: .6rem;
  background: var(--econocom-bright-blue);
  color: #fff;
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 700;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.pf-c-button.pf-m-primary:hover,
#kc-login:hover {
  background: var(--econocom-dark-violet);
  box-shadow: 0 .5rem 1rem rgb(62 13 129 / 25%);
  transform: translateY(-1px);
}

/*
 * Social identity provider buttons, aligned with the official branding
 * guidelines of each provider:
 * - Google: https://developers.google.com/identity/branding-guidelines
 *   (light theme: #fff fill, 1px #747775 stroke, #1f1f1f Roboto Medium
 *   14/20 text, 20px G mark, 12px/10px/12px paddings, 4px radius)
 * - Microsoft: https://learn.microsoft.com/en-us/entra/identity-platform/howto-add-branding-in-apps
 *   (light scheme: #fff fill, 1px #8c8c8c stroke, #5e5e5e Segoe UI text,
 *   unaltered four-square mark — values extracted from the official
 *   ms-symbollockup_signin_light.svg asset)
 * Every third-party button keeps the same size and visual weight, as
 * required by the Google guidelines ("at least as prominently").
 */

/* Roboto Medium, bundled locally (Apache 2.0 license). */
@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/roboto-medium-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/roboto-medium-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Shared geometry: same height, paddings, gap and text size for all
   third-party buttons. */
#kc-social-providers .kc-social-item {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  transition: background-color .15s ease, box-shadow .15s ease;
}

/* Provider marks: fixed 20px box, never stretched nor recoloured. */
#kc-social-providers .kc-social-provider-logo {
  position: static !important;
  display: inline-block !important;
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  line-height: 1 !important;
  transform: none !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/*
 * Fixed label width, sized for the longest label ("Se connecter avec
 * Microsoft"): every logo sits on the same vertical rail while the
 * logo+label group stays centered in the button.
 */
#kc-social-providers .kc-social-icon-text {
  flex: 0 0 auto;
  position: static !important;
  left: auto !important;
  min-width: 13.5em;
  text-align: left;
}

/* Google — light theme. */
#kc-social-providers #social-google.kc-social-item {
  border: 1px solid #747775;
  background: #fff;
  color: #1f1f1f;
  font-family: Roboto, Arial, sans-serif;
}

#kc-social-providers #social-google.kc-social-item:hover {
  border-color: #747775;
  background: #f8f8f8;
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
}

/* Microsoft — light scheme, square corners per the official asset. */
#kc-social-providers #social-entra.kc-social-item,
#kc-social-providers #social-microsoft-personal.kc-social-item {
  border: 1px solid #8c8c8c;
  border-radius: 0;
  background: #fff;
  color: #5e5e5e;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 600;
}

#kc-social-providers #social-entra.kc-social-item:hover,
#kc-social-providers #social-microsoft-personal.kc-social-item:hover {
  border-color: #8c8c8c;
  background: #f5f5f5;
}

#kc-social-providers .kc-social-item:focus-visible {
  outline: 2px solid var(--econocom-bright-blue);
  outline-offset: 2px;
}

/*
 * Account-type hints below every social button (branding DO for Microsoft,
 * extended to Google for visual consistency). Each button gets the same
 * caption style and the same bottom spacing so the gaps between buttons
 * are uniform regardless of whether a caption is present. Localized
 * through the lang attribute that Keycloak sets on <html> from the
 * current locale; French is the realm default.
 */
#kc-social-providers li:has(> #social-google),
#kc-social-providers li:has(> #social-entra),
#kc-social-providers li:has(> #social-microsoft-personal) {
  padding-bottom: 1.1rem;
}

#kc-social-providers #social-google::after,
#kc-social-providers #social-entra::after,
#kc-social-providers #social-microsoft-personal::after {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: .2rem;
  color: var(--econocom-muted);
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

html[lang^="en"] #kc-social-providers #social-google::after {
  content: "Google account";
}

html:not([lang^="en"]) #kc-social-providers #social-google::after {
  content: "Compte Google";
}

html[lang^="en"] #kc-social-providers #social-entra::after {
  content: "Work or school account";
}

html:not([lang^="en"]) #kc-social-providers #social-entra::after {
  content: "Compte professionnel ou scolaire";
}

html[lang^="en"] #kc-social-providers #social-microsoft-personal::after {
  content: "Personal Microsoft account";
}

html:not([lang^="en"]) #kc-social-providers #social-microsoft-personal::after {
  content: "Compte Microsoft personnel";
}

/* Official Microsoft four-square mark (unaltered Microsoft asset). */
.econocom-microsoft-logo {
  background-image: url("../img/microsoft-logo.svg");
}

/* Official Google "G" mark (unaltered Google asset). */
.econocom-google-logo {
  background-image: url("../img/google-g.png");
}

a,
.login-pf a {
  color: var(--econocom-dark-violet);
  font-weight: 600;
}

.pf-c-alert,
.alert {
  border-radius: .6rem;
}

@media (max-width: 640px) {
  .login-pf-page {
    padding: 1.5rem 1rem;
  }

  .card-pf {
    border-radius: 1rem;
  }
}
