/* ============================================================
   ELUNA Keycloak Login Theme — Aligned with el-una-2 Design System
   Design Tokens:
     Deep Navy:    #12283F
     Classic Navy: #1B3A5C
     Warm Amber:   #C97A34
     Dark Amber:   #9C5B22
     Background:   #F3F5F7
     Border:       #DFE3E8
     Text Dark:    #22272E
     Text Soft:    #5C6470
   ============================================================ */

/* --- Page Background --- */
html.login-pf,
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  background: radial-gradient(circle at top center, #FFFFFF 0%, #F3F5F7 60%, #E6EBF0 100%) !important;
  background-attachment: fixed !important;
  min-height: 100vh;
  color: #22272E !important;
}

/* --- Override PF5 Login Layout to Stack Vertically --- */
.pf-v5-c-login {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh;
  padding: 1.5rem 1rem !important;
}

.pf-v5-c-login__container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  max-width: 500px !important;
  width: 100% !important;
  padding: 1rem 0 !important;
}

/* --- Header / Logo Area — Force Above Card --- */
.pf-v5-c-login__header {
  order: -1 !important;
  width: 100% !important;
  text-align: center !important;
  margin-bottom: 1.75rem !important;
  flex: none !important;
  padding: 0 !important;
}

#kc-header-wrapper.pf-v5-c-brand {
  background-image: url("../img/eluna-logo.jpg") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: contain !important;
  height: 76px !important;
  width: 290px !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  display: block !important;
  /* Hide the text */
  font-size: 0 !important;
  color: transparent !important;
  overflow: hidden !important;
  text-indent: -9999px !important;
}

/* --- Login Card --- */
.pf-v5-c-login__main {
  background: #ffffff !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 36px rgba(18, 40, 63, 0.09), 0 2px 6px rgba(18, 40, 63, 0.04) !important;
  border: 1px solid #DFE3E8 !important;
  border-top: 5px solid #C97A34 !important;
  width: 100% !important;
  max-width: 480px !important;
  overflow: hidden;
}

/* --- Card Header --- */
.pf-v5-c-login__main-header {
  padding: 1.75rem 2rem 0.5rem !important;
  text-align: center !important;
}

#kc-page-title {
  color: #12283F !important;
  font-family: 'Newsreader', Georgia, serif, 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 1.6rem !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em !important;
}

/* --- Card Body (form area) --- */
.pf-v5-c-login__main-body {
  padding: 0.5rem 2rem 1.25rem !important;
}

/* --- Form Labels --- */
.pf-v5-c-form__label-text {
  color: #12283F !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
}

/* --- Form Inputs --- */
.pf-v5-c-form-control input,
.pf-v5-c-form-control {
  border-radius: 8px !important;
  border: 1.5px solid #DFE3E8 !important;
  font-size: 0.95rem !important;
  padding: 0.55rem 0.85rem !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.pf-v5-c-form-control:focus-within,
.pf-v5-c-form-control input:focus {
  border-color: #1B3A5C !important;
  box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.15) !important;
  outline: none !important;
}

/* --- Primary Button (Sign In) --- */
.pf-v5-c-button.pf-m-primary {
  background-color: #C97A34 !important;
  border-color: #C97A34 !important;
  color: #ffffff !important;
  min-height: 48px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  padding: 0.7rem 1.5rem !important;
  letter-spacing: 0.01em;
  box-shadow: 0 3px 10px rgba(201, 122, 52, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus {
  background-color: #9C5B22 !important;
  border-color: #9C5B22 !important;
  box-shadow: 0 4px 14px rgba(156, 91, 34, 0.45) !important;
  transform: translateY(-1px);
}

/* --- "Or sign in with" separator --- */
.pf-v5-c-login__main-footer-band {
  padding: 0.5rem 2rem !important;
}

.pf-v5-c-login__main-footer-band-item {
  color: #5C6470 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

/* --- Social / Identity Provider Buttons (Microsoft SSO) --- */
#kc-social-providers {
  padding: 0.25rem 2rem 1.25rem !important;
}

#kc-social-providers ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* High-visibility Microsoft SSO Button */
#kc-social-providers a.pf-v5-c-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.85rem !important;
  border: 2px solid #1B3A5C !important;
  border-radius: 8px !important;
  background: #1B3A5C !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.98rem !important;
  padding: 0.8rem 1.25rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-decoration: none !important;
  min-height: 52px !important;
  box-shadow: 0 4px 12px rgba(27, 58, 92, 0.2) !important;
}

#kc-social-providers a.pf-v5-c-button:hover {
  background: #12283F !important;
  border-color: #C97A34 !important;
  box-shadow: 0 6px 18px rgba(18, 40, 63, 0.3) !important;
  transform: translateY(-1px);
}


/* --- Full-color Official Microsoft 4-Square Logo --- */
#social-microsoft svg {
  display: none !important;
}

#social-microsoft::before {
  content: "" !important;
  display: inline-block !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 21"><rect x="1" y="1" width="9" height="9" fill="%23f25022"/><rect x="11" y="1" width="9" height="9" fill="%237fba00"/><rect x="1" y="11" width="9" height="9" fill="%2300a4ef"/><rect x="11" y="11" width="9" height="9" fill="%23ffb900"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  flex-shrink: 0 !important;
}

/* --- Constrain SVG icons inside social buttons --- */
#kc-social-providers svg {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex-shrink: 0 !important;
}

/* The text label next to the icon */
#kc-social-providers span.pf-v5-u-m-auto {
  margin: 0 !important;
  flex: none !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
}

/* --- Links --- */
a {
  color: #1B3A5C !important;
  font-weight: 500 !important;
  text-decoration: underline;
  transition: color 0.15s ease !important;
}

a:hover {
  color: #C97A34 !important;
  text-decoration: underline !important;
}

/* --- "Remember me" checkbox --- */
.pf-v5-c-check__label {
  color: #5C6470 !important;
  font-size: 0.88rem !important;
}

/* --- "Forgot Password?" link --- */
.pf-v5-c-helper-text__item-text a {
  font-size: 0.85rem !important;
  color: #5C6470 !important;
}

.pf-v5-c-helper-text__item-text a:hover {
  color: #C97A34 !important;
}

/* --- Footer area (New user? Register, etc.) --- */
.pf-v5-c-login__main-footer {
  padding: 0.5rem 2rem 1.5rem !important;
  text-align: center !important;
}

#kc-registration {
  font-size: 0.92rem !important;
  color: #5C6470 !important;
  background: #F3F5F7 !important;
  padding: 0.85rem 1rem !important;
  border-radius: 8px !important;
  border: 1px solid #DFE3E8 !important;
}

#kc-registration a {
  font-weight: 600 !important;
  color: #1B3A5C !important;
}

#kc-registration a:hover {
  color: #C97A34 !important;
}

/* --- Password visibility toggle button --- */
.pf-v5-c-button.pf-m-control {
  border-radius: 0 8px 8px 0 !important;
  border: 1.5px solid #DFE3E8 !important;
  border-left: none !important;
  background: #F3F5F7 !important;
  color: #5C6470 !important;
}

.pf-v5-c-button.pf-m-control:hover {
  background: #e5e9ee !important;
  color: #12283F !important;
}

/* --- Alert / Error Messages --- */
.pf-v5-c-alert {
  border-radius: 8px !important;
  margin-bottom: 1.25rem !important;
  border: 1px solid #DFE3E8 !important;
}

/* --- Keyboard focus visibility --- */
.pf-v5-c-button:focus-visible,
a:focus-visible {
  outline: 3px solid #1B3A5C !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* --- Responsive Tweaks --- */
@media (max-width: 576px) {
  .pf-v5-c-login__container {
    padding: 1rem 0.5rem !important;
  }

  #kc-header-wrapper.pf-v5-c-brand {
    height: 60px !important;
    width: 230px !important;
  }

  .pf-v5-c-login__main {
    border-radius: 10px !important;
  }

  .pf-v5-c-login__main-header,
  .pf-v5-c-login__main-body,
  .pf-v5-c-login__main-footer,
  .pf-v5-c-login__main-footer-band,
  #kc-social-providers {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}
