@font-face {
  font-family: Poppins;
  src: url(../font/Poppins-Light.ttf);
  font-weight: 300;
  font-display: swap;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
}

#fond {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0; /* Masqué par défaut pour éviter de voir l'image de base quand ça change */
  transition: opacity 0.5s ease-in;
}

#logo {
  display: block;
  margin: 0 auto 30px;
  max-width: 150px;
  height: auto;
}

#motPasseOublie {
  color: black;
  margin-left: 5px;
}

#retourConnexion,
#lienInscription {
  color: #336b9a;
  text-decoration: none;
  font-weight: 500;
}

#retourConnexion:hover,
#lienInscription:hover {
  text-decoration: underline;
}

#textInfoInput {
  color: #383838;
  font-weight: 500;
}

#textInfoInput p {
  margin-block-end: 5px;
}

#textInfoPwd {
  color: #336b9a;
}

#input-error,
#input-error-username,
.error-message {
  color: #dd640d;
  font-size: 14px;
  display: block;
  margin-top: -10px;
  margin-bottom: 10px;
}

.alert {
  display: none;
}

.alert-error {
  color: #dd640d;
}

.alert-success {
  color: #388e3c;
}

#boutonConnexion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  color: #ffffff;
  padding: 18px 12px;
  margin-top: 10px;
  border: 1px solid #f7f5f5;
  border-radius: 6px;
  background: grey;
  box-shadow: 0 0 15px #0000000d;
  font-weight: 500;
  font-size: medium;
  cursor: pointer;
}

#boutonConnexion:hover {
  background: lightgrey;
}

#boutonConnexion img {
  width: 16px;
}

.login-card .login-field {
  margin: 15px 0;
  width: 100%;
}

.login-card .login-field input,
.login-card .login-field button {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #f7f5f5;
  border-radius: 8px;
  padding: 20px 24px;
  background: #ffffff;
  box-shadow: 0px 0px 15px 0px #0000000d;
  font-family: inherit;
}

.login-card .login-action {
  display: flex;
  justify-content: space-between;
  flex-direction: row-reverse;
}

.login-card .login-action span {
  order: 2;
}

.password-wrapper {
  position: relative;
}

.password-wrapper img {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 20px;
  transform: translateY(-50%);
  cursor: pointer;
}

.profile-type-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #f7f5f5;
  border-radius: 8px;
  padding: 12px 16px;
  background: #ffffff;
  box-shadow: 0px 0px 15px 0px #0000000d;
  font-family: inherit;
  font-size: 16px;
  min-height: 150px;
}

.profile-type-select option {
  padding: 8px;
  margin: 2px 0;
}

.profile-type-select option:checked {
  background: #336b9a;
  color: white;
}

@media screen and (max-width: 640px) {
  #image-gauche {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    overflow: hidden;
  }

  #fond {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  #container-droite {
    position: fixed;
    width: 98vw;
    max-height: 98vh;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
    overflow-y: auto;
    padding: 15px 12px;
    border-radius: 8px;
  }

  #logo {
    max-width: 120px;
    margin-bottom: 20px;
  }

  #kc-form {
    margin: 0;
  }

  #textInfoInput {
    font-size: 16px;
  }

  #motPasseOublie,
  #retourConnexion,
  #lienInscription {
    font-size: 14px;
  }

  #boutonConnexion {
    font-size: 16px;
    padding: 16px 12px;
  }

  #username,
  #id_password,
  #email,
  #name,
  #password,
  #password-confirm {
    font-size: 16px;
    padding: 16px 20px;
  }

  #boutonConnexion img {
    width: 18px;
  }

  .password-wrapper img {
    width: 20px;
  }

  .login-card .login-field input {
    padding: 16px 20px;
  }

  .error-message {
    font-size: 13px;
  }

  .profile-type-select {
    font-size: 14px;
    min-height: 130px;
  }
  .group-title {
    font-size: 16px;
  }

  .group-description {
    font-size: 13px;
  }

  .input-helper-before,
  .input-helper-after {
    font-size: 11px;
  }

  textarea {
    padding: 16px 20px;
  }

  select:not(.profile-type-select) {
    padding: 16px 20px;
    font-size: 14px;
  }
}

#backToApplication {
  text-decoration: none;
  display: block;
}

#backToApplication button {
  width: 100%;
}

#kc-error-message {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (min-width: 641px) and (max-width: 1279px) {
  #image-gauche {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
  }

  #fond {
    width: 100%;
    height: 100%;
  }

  #container-droite {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    max-width: 500px;
    height: auto;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 40px 30px;
    z-index: 10;
    overflow-y: auto;
  }

  #logo {
    max-width: 140px;
    margin-bottom: 25px;
  }

  #kc-form {
    margin: 0;
  }

  #textInfoInput {
    font-size: 18px;
  }

  #motPasseOublie,
  #retourConnexion,
  #lienInscription {
    font-size: 15px;
  }

  #boutonConnexion {
    font-size: 17px;
    padding: 17px 12px;
  }

  #username,
  #id_password,
  #email,
  #name,
  #password,
  #password-confirm {
    font-size: 16px;
  }

  #boutonConnexion img {
    width: 20px;
  }

  .password-wrapper img {
    width: 22px;
  }
}

@media screen and (min-width: 1280px) {
  #image-gauche {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
  }

  #fond {
    width: 100%;
    height: 100%;
  }

  #container-droite {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 550px;
    min-width: 450px;
    height: auto;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    z-index: 10;
    overflow-y: auto;
  }

  #logo {
    max-width: 160px;
    margin-bottom: 30px;
  }

  #kc-form {
    margin: 0;
  }
}

.form-group-header {
  margin: 25px 0 15px 0;
}

.group-title {
  color: #383838;
  font-weight: 600;
  font-size: 18px;
  display: block;
  margin-bottom: 5px;
}

.group-description {
  color: #336b9a;
  font-size: 14px;
  margin-bottom: 15px;
}

/* Helper texts */
.input-helper-before,
.input-helper-after {
  color: #336b9a;
  font-size: 12px;
  margin: 5px 0;
  line-height: 1.4;
}

.input-helper-before {
  margin-bottom: 8px;
}

.input-helper-after {
  margin-top: 8px;
}

textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #f7f5f5;
  border-radius: 8px;
  padding: 20px 24px;
  background: #ffffff;
  box-shadow: 0px 0px 15px 0px #0000000d;
  font-family: inherit;
  min-height: 100px;
  resize: vertical;
}

.radio-option,
.checkbox-option {
  margin: 10px 0;
  display: flex;
  align-items: center;
}

.radio-input,
.checkbox-input {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
}

.radio-label,
.checkbox-label {
  color: #383838;
  cursor: pointer;
  user-select: none;
}

.radio-label.disabled,
.checkbox-label.disabled {
  color: #999;
  cursor: not-allowed;
}

select:not(.profile-type-select) {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #f7f5f5;
  border-radius: 8px;
  padding: 20px 24px;
  background: #ffffff;
  box-shadow: 0px 0px 15px 0px #0000000d;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

#boutonConnexion svg {
  margin-left: 5px;
  transition: transform 0.2s;
}

#boutonConnexion:hover svg {
  transform: translateX(3px);
}
