/* =============================================
   S.Digital Keycloak Theme - Login Page
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
  --primary-color: #e91e8c;
  --icon-color: var(--primary-color);
  --accent-bar-color: var(--primary-color);
}

/* ---------- Reset & Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #fff url('../img/bg-login.png') no-repeat center center / cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #333;
}

/* ---------- Logo above the card ---------- */
#kc-logo-header {
  text-align: center;
  margin-bottom: 30px;
  margin-top: 32px;
}

#kc-header-logo {
  max-width: 280px;
  max-height: 80px;
  height: auto;
}

/* ---------- Header / Realm name ---------- */
#kc-header {
  text-align: center;
  margin-bottom: 10px;
}

#kc-header-wrapper {
  font-size: 12px;
  color: #999;
}

/* ---------- Main wrapper ---------- */
body > div {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Card container ---------- */
.kc-form-card {
  width: 100%;
  padding: 40px 50px;
  position: relative;
  background: #FAFAFA;
  border: 1px solid #F6F7F9;
  box-shadow: 0px 32px 48px -12px rgba(17, 24, 39, 0.06), 0px 32px 48px -12px rgba(17, 24, 39, 0.08);
  border-radius: 16px;
}

/* (Logo is now in #kc-header above the card) */

/* ---------- Locale selector ---------- */
#kc-locale {
  position: absolute;
  top: 15px;
  right: 20px;
}

#kc-current-locale-link {
  background: none;
  border: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

#kc-current-locale-link::after {
  content: ' \25BE';
}

#kc-locale-dropdown ul {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  list-style: none;
  padding: 5px 0;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

#kc-locale-dropdown[aria-expanded="true"] ul,
#kc-locale-dropdown button[aria-expanded="true"] ~ ul {
  display: block;
}

#kc-locale-dropdown ul li a {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
}

#kc-locale-dropdown ul li a:hover {
  background: #f5f5f5;
}

/* ---------- Page title ---------- */
#kc-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a3a5c;
  text-align: center;
  margin: 0 0;
}

/* ---------- Form ---------- */
#kc-form {
  margin-top: 20px;
}

#kc-form-login > div {
  margin-bottom: 18px;
  
}

#kc-form-login label {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 22px;
/* identical to box height */

color: #002F4A;


}

/* ---------- Icon + input layout ---------- */
/* Wrapper for username and password fields: label on top, icon + input below */
#kc-form-login > div:has(#username),
#kc-form-login > div:has(#password) {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
}

/* Label aligned with input (column 2) */
#kc-form-login > div:has(#username) > label,
#kc-form-login > div:has(#password) > label {
  grid-column: 2;
  grid-row: 1;
}

/* Username icon */
#kc-form-login > div:has(#username)::after {
  content: '';
  grid-column: 1;
  grid-row: 2;
  width: 30px;
  height: 30px;
  background-color: var(--icon-color);
  mask: url('../img/user.svg') no-repeat center / contain;
  -webkit-mask: url('../img/user.svg') no-repeat center / contain;
}

/* Password icon */
#kc-form-login > div:has(#password)::after {
  content: '';
  grid-column: 1;
  grid-row: 2;
  width: 30px;
  height: 30px;
  background-color: var(--icon-color);
  mask: url('../img/key.svg') no-repeat center / contain;
  -webkit-mask: url('../img/key.svg') no-repeat center / contain;
}

/* Input in second column */
#username {
  grid-column: 2;
  grid-row: 2;
}

#kc-form-login div[dir="ltr"] {
  grid-column: 2;
  grid-row: 2;
}

#kc-form-login input[type="text"],
#kc-form-login input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
}

#kc-form-login input[type="text"]:focus,
#kc-form-login input[type="password"]:focus {
  border-color: var(--primary-color);
  background: #fff;
}

/* Password field container */
#kc-form-login input[type="password"] {
  padding-right: 44px;
}

#kc-form-login div[dir="ltr"] {
  position: relative;
}

/* Show/hide password button */
button[data-password-toggle] {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 16px;
  padding: 4px;
}

/* ---------- Remember me & Forgot password row ---------- */
#kc-form-options {
  display: inline-block;
}

.checkbox label {
  font-size: 13px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox input[type="checkbox"] {
  accent-color: var(--primary-color);
}

#kc-form-login > div:nth-last-of-type(2) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 46px;
}

/* Mot de passe oublié ? */
#kc-form-login > div:nth-last-of-type(2) > div:last-child a {

font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 19px;

color: #009EE3;


}

#kc-form-login > div:nth-last-of-type(2) > div:last-child a:hover {
  text-decoration: underline;
}

/* ---------- Login button ---------- */
#kc-login {
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  display: flex;
	/*
  width: 100%;
  padding: 14px;
  border-radius: 30px;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;*/
  /* Frame 6 */

/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 4px 180px;
gap: 10px;

background: var(--primary-color);
/* shadow/sm */
box-shadow: 0px 2px 4px -2px rgba(17, 24, 39, 0.1), 0px 0px 2px rgba(17, 24, 39, 0.06);
border-radius: 8px;

/* Inside auto layout */
flex: none;
order: 2;
flex-grow: 0;

}

#kc-login:hover {
  background: color-mix(in srgb, var(--primary-color) 80%, black);
}

#kc-login:active {
  transform: scale(0.98);
}

/* ---------- Registration link ---------- */
#kc-info {
  margin-top: 20px;
  text-align: center;
}

#kc-registration span {
  font-family: 'Open Sans';
  font-size: 14px;
  color: #666;
}

#kc-registration a {
  font-family: 'Open Sans';
  font-size: 14px;
  color: #009EE3;
  text-decoration: none;
  font-weight: 400;
}

#kc-registration a:hover {
  text-decoration: underline;
}

/* ---------- Registration page ---------- */
#kc-register-form > div {
  margin-bottom: 16px;
}

#kc-register-form label {
  font-family: 'Open Sans';
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: #002F4A;
  display: inline;
  margin-bottom: 6px;
}

#kc-register-form input[type="text"],
#kc-register-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
}

#kc-register-form input[type="text"]:focus,
#kc-register-form input[type="password"]:focus {
  border-color: var(--primary-color);
  background: #fff;
}

#kc-register-form div[dir="ltr"] {
  position: relative;
}

#kc-register-form button[data-password-toggle] {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 16px;
  padding: 4px;
}

#kc-register-form input[type="password"] {
  padding-right: 44px;
}

/* "Retour à la connexion" link on registration */
#kc-register-form #kc-form-options a {
  font-family: 'Open Sans';
  font-size: 14px;
  color: #009EE3;
  text-decoration: none;
}

#kc-register-form #kc-form-options a:hover {
  text-decoration: underline;
}

#kc-register-form #kc-form-options {
  margin: 12px 0;
}

/* Submit button on registration page */
#kc-register-form input[type="submit"] {
  width: 100%;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: var(--primary-color);
  box-shadow: 0px 2px 4px -2px rgba(17, 24, 39, 0.1), 0px 0px 2px rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 16px;
}

#kc-register-form input[type="submit"]:hover {
  background: color-mix(in srgb, var(--primary-color) 80%, black);
}

/* Required fields indicator */
.subtitle {
  font-family: 'Open Sans';
  font-size: 13px;
  color: #888;
}

.subtitle .required {
  color: var(--primary-color);
}

/* ---------- Reset password page ---------- */
/* Input field styling for reset password form */
#kc-reset-password-form input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
}

#kc-reset-password-form input[type="text"]:focus {
  border-color: var(--primary-color);
  background: #fff;
}

#kc-reset-password-form label {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: #002F4A;
  display: block;
  margin-bottom: 6px;
}

/* "Retour à la connexion" link */
#kc-reset-password-form #kc-form-options a {
  font-family: 'Open Sans';
  font-size: 14px;
  color: #009EE3;
  text-decoration: none;
}

#kc-reset-password-form #kc-form-options a:hover {
  text-decoration: underline;
}

#kc-reset-password-form #kc-form-options {
  margin: 12px 0;
}

/* Submit button on reset password page */
#kc-reset-password-form input[type="submit"] {
  width: 100%;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: var(--primary-color);
  box-shadow: 0px 2px 4px -2px rgba(17, 24, 39, 0.1), 0px 0px 2px rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 16px;
}

#kc-reset-password-form input[type="submit"]:hover {
  background: color-mix(in srgb, var(--primary-color) 80%, black);
}

/* Info text at the bottom */
#kc-info-wrapper {
  font-family: 'Open Sans';
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-top: 20px;
}

/* ---------- Footer ---------- */
.digital-footer {
  width: 100%;
  background: transparent;
  padding: 15px 0;
  margin-top: auto;
}

.digital-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.digital-footer-logo img {
  height: 45px;
  width: auto;
}

.digital-footer-separator {
  width: 1px;
  height: 50px;
  background: #ccc;
}

.digital-footer-text {
  font-family: 'Open Sans';
  font-size: 12px;
  color: #888;
  line-height: 1.6;
}


/* ---------- Accent bar ---------- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 100px;
  width: 4px;
  height: 100vh;
  background-color: var(--accent-bar-color);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body::before {
    display: none;
  }

  body {
    padding: 10px;
    min-height: 100vh;
    background-size: cover;
    align-items: stretch;
  }

  body > div {
    max-width: none;
    width: auto;
    margin: auto 0;
  }

  .kc-form-card {
    padding: 25px 20px;
    border-radius: 12px;
  }

  /* Logo */
  #kc-header-logo {
    max-width: 180px;
  }

  /* Title */
  #kc-page-title {
    font-size: 18px;
  }

  /* Icons + inputs grid */
  #kc-form-login > div:has(#username),
  #kc-form-login > div:has(#password) {
    grid-template-columns: 28px 1fr;
    column-gap: 8px;
  }

  #kc-form-login > div:has(#username)::after,
  #kc-form-login > div:has(#password)::after {
    width: 24px;
    height: 24px;
  }

  /* Remember me + forgot password row */
  #kc-form-login > div:nth-last-of-type(2) {
    margin-left: 36px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Login button - remove fixed padding */
  #kc-login {
    padding: 10px 20px;
    width: 100%;
  }

  /* Locale */
  #kc-locale {
    top: 10px;
    right: 10px;
  }

  /* Header */
  #kc-header {
    margin-bottom: 20px;
  }

  /* Labels */
  #kc-form-login label {
    font-size: 14px;
  }
}


/* form button */
#kc-form-buttons {
  margin-top: 64px;
  display: flex;
}
#kc-form-buttons >* {
  flex-grow: 1;
  font-size: 14px;
  padding: 10px 20px;
}


.kc-form-card header {
  margin-bottom: 64px;
}

#kc-social-providers {
  color: #1a3a5c;
}

#kc-social-providers h2 {
  font-size: 22px;
}

#kc-social-providers ul {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-top: 32px;
  gap: 8px;
}


#kc-social-providers li {
  display: block;
}

#kc-social-providers ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s;
}

#kc-social-providers ul li a:hover {
  border-color: #999;
}

#kc-social-providers img {
  display: block;
    width: 24px;
    height: 24px;
}

#kc-header {
  position: absolute;
  right: 0;
  top: 0;
}
