/* Charte hellocare des pages de connexion, déclarée après css/styles.css de keycloak.v2 (styles=). */
/* Reprend la page « Se connecter » du site : page blanche, carte grise, champs et bouton du design system. */
html:root {
  --kc-brand-primary: #e45869;
  --kc-brand-primary-hover: #cc4a5b;
  --kc-brand-on-primary: #ffffff;
  --kc-brand-logo: url("../img/logo.svg");
  --kc-text: #0a0a0a;
  --kc-text-muted: #9ca3af;
  --kc-surface: #f5f5f4;
  --kc-border: #e5e5e5;
  --kc-ring: #737373;
  --kc-icon: #6b7280;
  --kc-error: #dc2626;
  --kc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --kc-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --kc-eye-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49'/%3E%3Cpath d='M14.084 14.158a3 3 0 0 1-4.242-4.242'/%3E%3Cpath d='M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

@font-face {
  font-display: swap;
  font-family: "Satoshi";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/Satoshi-Regular.woff2") format("woff2");
}
@font-face {
  font-display: swap;
  font-family: "Satoshi";
  font-style: normal;
  font-weight: 500;
  src: url("../fonts/Satoshi-Medium.woff2") format("woff2");
}
@font-face {
  font-display: swap;
  font-family: "Satoshi";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/Satoshi-Bold.woff2") format("woff2");
}
@font-face {
  font-display: swap;
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  src: url("../fonts/outfit-v11-latin-600.woff2") format("woff2");
}

html:root {
  color-scheme: light;
  --pf-v5-global--FontFamily--text: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --pf-v5-global--FontFamily--heading: "Outfit", system-ui, sans-serif;
  --pf-v5-global--primary-color--100: var(--kc-brand-primary);
  --pf-v5-global--primary-color--200: var(--kc-brand-primary-hover);
  --pf-v5-global--link--Color: var(--kc-text-muted);
  --pf-v5-global--link--Color--hover: var(--kc-text);
  --pf-v5-global--BackgroundColor--100: #ffffff;
  --pf-v5-global--BackgroundColor--200: #ffffff;
  --pf-v5-global--Color--100: var(--kc-text);
  --pf-v5-global--FontSize--md: 0.875rem;
  --keycloak-bg-logo-url: none;
  --keycloak-card-top-color: transparent;
}

#keycloak-bg {
  background: #ffffff;
  color: var(--kc-text);
  font-family: var(--pf-v5-global--FontFamily--text);
}

html .pf-v5-c-login {
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

html #kc-header {
  margin-top: 0;
}

/* Logo de la marque ; le nom en texte reste lisible par les lecteurs d'écran. */
#kc-header #kc-header-wrapper {
  background: var(--kc-brand-logo) no-repeat center / contain;
  color: transparent !important;
  height: 2.5rem;
  margin: 0 auto 1.25rem;
  max-width: 14rem;
  overflow: hidden;
}

html .pf-v5-c-login__main {
  background: var(--kc-surface);
  border: 1px solid var(--kc-border);
  border-radius: 18px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  margin-inline: auto;
  max-width: 32.375rem;
  overflow: hidden;
  width: 100%;
}

html .pf-v5-c-login__main-header {
  padding: 2.25rem 3rem 2.25rem;
}

/* keycloak.v2 fixe 70 % / 30 % : avec l'écart de colonnes, le sélecteur de langue sortait de la carte. */
html div.pf-v5-c-login__main-header:has(.pf-v5-c-login__main-header-utilities) {
  grid-template-columns: minmax(0, 1fr) auto;
}

html .pf-v5-c-login__main-body,
html .pf-v5-c-login__main-footer {
  padding-inline: 3rem;
}

html .pf-v5-c-login__main-body {
  padding-bottom: 2.25rem;
}

html .pf-v5-c-title {
  --pf-v5-c-title--m-3xl--FontSize: 1.5rem;
  --pf-v5-c-title--m-3xl--LineHeight: 2rem;
  --pf-v5-c-title--m-3xl--FontWeight: 600;
  color: var(--kc-text);
  font-family: var(--pf-v5-global--FontFamily--heading);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 2rem;
}

html .pf-v5-c-form__label,
html .pf-v5-c-form__label-text {
  color: var(--kc-text);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Champs : fond blanc, bordure fine et arrondie, sans le soulignement de PatternFly. */
html .pf-v5-c-form-control {
  --pf-v5-c-form-control--BackgroundColor: #ffffff;
  --pf-v5-c-form-control--before--BorderColor: var(--kc-border);
  --pf-v5-c-form-control--after--BorderColor: transparent;
  --pf-v5-c-form-control--hover--after--BorderBottomColor: transparent;
  --pf-v5-c-form-control--focus--after--BorderBottomColor: transparent;
  border-radius: 8px;
  box-shadow: var(--kc-shadow-sm);
  font-size: 0.875rem;
  min-height: 2.5rem;
}

/* Le select natif garde un fond blanc carré, qui dépassait des coins arrondis du sélecteur de langue. */
html .pf-v5-c-form-control > select {
  background-color: transparent;
}

html .pf-v5-c-form-control::before {
  border: 1px solid var(--kc-border);
  border-radius: 8px;
}

html .pf-v5-c-form-control::after {
  border: 0;
}

html .pf-v5-c-input-group {
  border-radius: 8px;
  box-shadow: var(--kc-shadow-sm);
}

html .pf-v5-c-input-group .pf-v5-c-form-control {
  border-radius: 8px 0 0 8px;
  box-shadow: none;
}

html .pf-v5-c-input-group .pf-v5-c-form-control::before {
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

html .pf-v5-c-button.pf-m-control {
  --pf-v5-c-button--m-control--BackgroundColor: #ffffff;
  --pf-v5-c-button--m-control--after--BorderColor: var(--kc-border);
  --pf-v5-c-button--m-control--after--BorderBottomColor: var(--kc-border);
  border-radius: 0 8px 8px 0;
}

html .pf-v5-c-button.pf-m-control::after {
  border: 1px solid var(--kc-border);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

html .pf-v5-c-button.pf-m-control i.fas {
  display: inline-flex;
  font-size: 0;
}

html .pf-v5-c-button.pf-m-control i.fas::before {
  background-color: var(--kc-icon);
  content: "";
  height: 18px;
  -webkit-mask: var(--kc-eye) center / contain no-repeat;
  mask: var(--kc-eye) center / contain no-repeat;
  width: 18px;
}

html .pf-v5-c-button.pf-m-control i.fa-eye-slash::before {
  -webkit-mask-image: var(--kc-eye-off);
  mask-image: var(--kc-eye-off);
}

html .pf-v5-c-form-control:focus-within,
html .pf-v5-c-input-group:focus-within {
  box-shadow: 0 0 0 1px var(--kc-ring), var(--kc-shadow-sm);
  outline: 2px solid var(--kc-ring);
  outline-offset: 2px;
}

html .pf-v5-c-input-group .pf-v5-c-form-control:focus-within {
  box-shadow: none;
  outline: none;
}

html .pf-v5-c-check__input:focus-visible {
  outline: 2px solid var(--kc-ring);
  outline-offset: 2px;
}

/* L'anneau est porté par le conteneur : sinon le bleu natif du champ s'y ajoute. */
html .pf-v5-c-form-control > :is(input, select, textarea):focus-visible {
  outline: none;
}

html .pf-v5-c-button.pf-m-primary {
  --pf-v5-c-button--BorderRadius: 8px;
  --pf-v5-c-button--m-primary--BackgroundColor: var(--kc-brand-primary);
  --pf-v5-c-button--m-primary--Color: var(--kc-brand-on-primary);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--kc-brand-primary-hover);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--kc-brand-primary-hover);
  --pf-v5-c-button--m-primary--active--BackgroundColor: var(--kc-brand-primary-hover);
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 2.5rem;
}

html .pf-v5-c-form__helper-text a,
html .pf-v5-c-login__main-footer a {
  color: var(--kc-text-muted);
  font-size: 0.875rem;
  text-decoration: underline;
}

html .pf-v5-c-form__helper-text a:hover,
html .pf-v5-c-login__main-footer a:hover {
  color: var(--kc-text);
}

html .pf-v5-c-helper-text__item.pf-m-error {
  --pf-v5-c-helper-text__item-text--Color: var(--kc-error);
}

html .pf-v5-c-form-control__icon.pf-m-status {
  display: none;
}

html .pf-v5-c-check__label {
  color: var(--kc-text);
  font-size: 0.875rem;
}

/* Page de connexion (login.ftl) : « Retour », onglets au-dessus de la carte et liens d'inscription en dessous, comme sur le site. */
html .pf-v5-c-login__main:has(#hc-tabs) {
  margin-block: 3.4375rem 7.5rem;
  overflow: visible;
  position: relative;
}

#hc-subtitle {
  color: #a8a29e;
  font-size: 1rem;
  line-height: 1.75rem;
  margin: -2rem 0 1.5rem;
}

/* Le bandeau de Keycloak se glisse avant : la marge négative ferait passer le sous-titre dessous, ou y collerait « compte créé ». */
.pf-v5-c-alert ~ #hc-subtitle,
.pf-v5-c-alert ~ #hc-inscription {
  margin-top: 0;
}

/* Bandeau « compte créé » : à la place du sous-titre, sous le titre. */
#hc-inscription {
  margin: -1rem 0 1.5rem;
}

#hc-back {
  align-items: center;
  color: #a8a29e;
  display: flex;
  font-size: 1rem;
  font-weight: 500;
  gap: 0.25rem;
  left: 1.5rem;
  line-height: 1.5rem;
  padding: 0.5rem 1rem;
  position: fixed;
  text-decoration: none;
  top: 1.5rem;
}

#hc-back:hover {
  color: var(--kc-text);
}

#hc-tabs {
  background: #e7e5e4;
  border-radius: 10px;
  bottom: calc(100% + 0.625rem);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  display: flex;
  gap: 0.5rem;
  left: 50%;
  padding: 0.5rem;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

#hc-tabs .hc-tab {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #a8a29e;
  display: flex;
  font-size: 1rem;
  font-weight: 500;
  height: 29px;
  line-height: 1.75rem;
  padding: 0 0.5rem;
  text-decoration: none;
}

#hc-tabs a.hc-tab:hover {
  color: var(--kc-text);
}

#hc-tabs .hc-tab-active {
  background: #ffffff;
  border-color: var(--kc-border);
  box-shadow: var(--kc-shadow-sm);
  color: var(--kc-text);
  font-weight: 600;
}

/* Les liens vivent dans le pied de la carte (#kc-info) : sortis sous elle, sans fond ni bordure. */
html #kc-info:has(#hc-signup) {
  background: none;
  border: 0;
  left: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  right: 0;
  top: calc(100% + 1.25rem);
}

html #kc-info:has(#hc-signup) #kc-info-wrapper {
  padding: 0;
}

#hc-signup {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}

#hc-signup p {
  color: var(--kc-text-muted);
  font-size: 1rem;
  line-height: 1.75rem;
  margin: 0;
}

html #hc-signup a {
  color: var(--kc-text-muted);
  font-size: 1rem;
  margin-left: 0.5rem;
  text-decoration: underline;
}

html #hc-signup a:hover {
  color: var(--kc-text);
}

/* Petits écrans : marges du site, et cible tactile de 44 px (les apps mobiles ouvrent ces pages). */
@media (max-width: 767px) {
  html .pf-v5-c-login__main-header {
    padding: 1.5rem 1.5rem 1.5rem;
  }

  html .pf-v5-c-login__main-body,
  html .pf-v5-c-login__main-footer {
    padding-inline: 1.5rem;
  }

  html .pf-v5-c-login__main-body {
    padding-bottom: 1.5rem;
  }

  html .pf-v5-c-button,
  html .pf-v5-c-form-control {
    min-height: 2.75rem;
  }

  html .pf-v5-c-login__main:has(#hc-tabs) {
    margin-top: 4.5rem;
  }

  #hc-subtitle {
    margin-top: -1.25rem;
  }
}

/* Page « Compte mis à jour » (info.ftl) : le bouton « Se connecter » sous le message. */
#hc-info-login {
  margin-top: 1.5rem;
}
