/* Info section */

/*
 * Dhia.Bouaziz@vsb.cz
 */

:root {
  --keycloak-logo-url: url("../img/keycloak-logo-text.svg");
  --keycloak-bg-logo-url: url("../img/keycloak-bg-darken.svg");
  --keycloak-logo-height: 63px;
  --keycloak-logo-width: 300px;
  --keycloak-card-top-color: var(--pf-v5-global--palette--blue-400);
}

/* Override margin-block properties with maximum specificity */
html body.login-pf .pf-v5-c-login .pf-v5-c-login__header,
html body .pf-v5-c-login .pf-v5-c-login__header,
.pf-v5-c-login__header {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

html body.login-pf .pf-v5-c-login .pf-v5-c-login__header .pf-v5-c-brand,
html body .pf-v5-c-login .pf-v5-c-login__header .pf-v5-c-brand,
.pf-v5-c-login__header .pf-v5-c-brand {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Override at all breakpoints with maximum specificity */
@media (min-width: 1200px) {
  html body.login-pf .pf-v5-c-login .pf-v5-c-login__header,
  html body .pf-v5-c-login .pf-v5-c-login__header,
  .pf-v5-c-login__header {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (min-width: 992px) {
  html body.login-pf .pf-v5-c-login .pf-v5-c-login__header,
  html body .pf-v5-c-login .pf-v5-c-login__header,
  .pf-v5-c-login__header {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (min-width: 768px) {
  html body.login-pf .pf-v5-c-login .pf-v5-c-login__header,
  html body .pf-v5-c-login .pf-v5-c-login__header,
  .pf-v5-c-login__header {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (min-width: 576px) {
  html body.login-pf .pf-v5-c-login .pf-v5-c-login__header,
  html body .pf-v5-c-login .pf-v5-c-login__header,
  .pf-v5-c-login__header {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

.pf-v5-c-login__container {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(1200px, 95vw);
  width: 100%;
  margin-top: -30px;
  padding: 0 1rem;
  grid-template-areas:
    "header"
    "main";
}

.pf-v5-c-login__main {
  border-radius: 1rem;
  background: white;
  width: 100%;
  box-sizing: border-box;
  transform: scale(0.85);
  margin-top: -60px;
}

.login-pf body {
  background: url("../img/it4i-cluster.jpg") no-repeat center center fixed;
  background-size: cover;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.login-pf body::before {
  content: "";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  opacity: 0.2;
  z-index: -1;
}

/* Two-column equal layout - Responsive */
.kc-two-column-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(1rem, 2vw, 2rem);
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

/* Vertical separator between columns */
.kc-column-separator {
  width: 1px;
  background-color: #e5e7eb;
  margin: 0 clamp(0.5rem, 1.5vw, 1.5rem);
  align-self: stretch;
}

.kc-left-column {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  min-width: 0;
}

.kc-right-column {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  min-width: 0;
}

.kc-column-header {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  color: #333 !important;
}

/* Recommended sign-in section at top */

.kc-recommended-label {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  color: #333 !important;
  margin-bottom: 1.5rem;
}
#instruction {
  color: #333 !important;
}
.instruction {
  color: #333 !important;
}
.pf-v5-c-login__main-body {
  color: #333;
}
/* MyAccessID button - Blue styled like Sign In button */
.kc-myaccessid-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.75rem, 1.5vw, 1rem);
  border: none;
  border-radius: 0.375rem;
  background-color: var(--pf-v5-global--link--Color);
  color: white !important;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  gap: 0.75rem;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.kc-myaccessid-button:hover {
  background-color: var(--pf-v5-global--link--Color);
  text-decoration: none;
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kc-myaccessid-button i {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: white !important;
}

/* Separator with "or" text */
.kc-separator {
  text-align: center;
  position: relative;
}

.kc-separator::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #e5e7eb;
}

.kc-separator span {
  position: relative;
  background-color: white;
  padding: 0 1rem;
  color: #6b7280;
  font-size: clamp(0.75rem, 1.2vw, 0.875rem);
  font-weight: 500;
  text-transform: lowercase;
}

.kc-recommended-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kc-social-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.75rem, 1.5vw, 1rem);
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  gap: 0.75rem;
  box-sizing: border-box;
}

.kc-social-button:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  text-decoration: none;
  color: #374151;
}

.kc-social-button i {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}

/* Social providers list */
.kc-social-providers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Remove default social providers styling */
#kc-social-providers {
  margin-top: 0;
}

#kc-social-providers hr {
  display: none;
}

/* Form styling */
#kc-form-wrapper {
  width: 100%;
}

/* Header with LEXIS logo - Responsive */
/* Header with LEXIS logo - Responsive with better visibility */
#kc-header-wrapper {
  height: clamp(100px, 15vw, 190px);
  width: 100%;
  max-width: 100%;
  text-align: center;
  margin-top: clamp(-20px, -2vw, -30px);
  margin-bottom: 2rem;
  position: relative;
  padding: 1rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Add semi-transparent background behind logo for better visibility */
#kc-header-wrapper::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 50%;
  height: 80%;
  background: rgba(255, 255, 255, 0.586);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  z-index: 1;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Logo image in front of blur */
#kc-header-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url("../img/LEXIS2.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  width: 80%;
  max-width: 500px;
  height: 70%;
  z-index: 2000;
}
/* IT4I Logo - Responsive */
#kc-header-it4i {
  background-image: url("../img/it4i-logo-white.png");
  background-size: contain;
  background-repeat: no-repeat;
  height: clamp(60px, 10vw, 120px);
  width: clamp(200px, 30vw, 400px);
  position: fixed;
  top: clamp(10px, 2vw, 20px);
  left: clamp(10px, 2vw, 20px);
  margin: 0 !important;
  z-index: 10;
}

#kc-page-title {
  text-align: center;
  padding: 5px;
  width: auto;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: #333 !important;
}

hr {
  margin-top: var(--pf-v5-global--spacer--sm);
  margin-bottom: var(--pf-v5-global--spacer--md);
}

#kc-social-providers svg:not(.google) {
  filter: invert(47%) sepia(88%) saturate(7486%) hue-rotate(199deg)
    brightness(91%) contrast(101%);
}

#kc-social-providers svg {
  height: var(--pf-v5-global--FontSize--xl);
}

/* Login button - Blue styled to match MyAccessID button */
#kc-form-login button[type="submit"],
#kc-form-login.pf-m-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.75rem, 1.5vw, 1rem);
  border: none;
  border-radius: 0.375rem;
  background-color: var(--pf-v5-global--link--Color);
  color: white;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
.pf-v5-c-form__label-text {
  color: #333 !important;
}

#kc-form-login button[type="submit"]:hover,
#kc-form-login .pf-m-primary:hover {
  background-color: var(--pf-v5-global--link--Color);
  text-decoration: none;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#kc-form-login button[type="submit"]:disabled,
#kc-form-login :disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

#tby-2a0696 {
  margin-left: clamp(1rem, 3vw, 3rem);
  margin-right: clamp(1rem, 3vw, 3rem);
  margin-bottom: 2rem;
}

#tby-201d13 {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

#tby-7234d7 {
  margin-top: 0.25rem;
}

#tby-7705fa {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kc-login-tooltip {
  position: relative;
  display: inline-block;
}

.kc-login-tooltip .kc-tooltip-text {
  top: -3px;
  left: 160%;
  background-color: black;
  visibility: hidden;
  color: #fff;
  min-width: 130px;
  text-align: center;
  border-radius: 2px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  padding: 5px;
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s;
  font-size: clamp(0.75rem, 1vw, 0.875rem);
}

.kc-login-tooltip:hover .kc-tooltip-text {
  visibility: visible;
  opacity: 0.7;
}

.kc-login-tooltip .kc-tooltip-text::after {
  content: " ";
  position: absolute;
  top: 15px;
  right: 100%;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent black transparent transparent;
}

#kc-recovery-codes-list {
  columns: 2;
}

#certificate_subjectDN {
  overflow-wrap: break-word;
}

#kc-verify-email-form {
  margin-top: 24px;
  margin-bottom: 24px;
}

/** Button Layout: Pushes buttons to the right **/
#terms-buttons-container {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Primary Button (Accept) */
.terms-btn-accept {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: white !important;
  padding: 0.5rem 1.5rem;
  font-weight: bold;
  border-radius: 0.3rem;
  transition: background-color 0.2s;
}

.terms-btn-accept:hover {
  background-color: #218838 !important;
}

/* Secondary Button (Do Not Accept/Cancel) */
.terms-btn-cancel {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
  padding: 0.5rem 1.5rem;
  font-weight: normal;
  border-radius: 0.3rem;
  transition: background-color 0.2s;
}

.terms-btn-cancel:hover {
  background-color: #5a6268 !important;
}

.terms-btn-accept,
.terms-btn-cancel {
  margin: 0 !important;
}

/* Tablet breakpoint */
@media (max-width: 992px) {
  .kc-two-column-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  #kc-main-content {
    transform: scale(0.8);
    margin-top: -20px;
  }

  /* Hide vertical separator on mobile */
  .kc-column-separator {
    display: none;
  }

  .kc-right-column {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
  }

  #kc-header-it4i {
    height: clamp(50px, 8vw, 100px);
    width: clamp(150px, 25vw, 300px);
  }

  #kc-header-wrapper {
    height: clamp(80px, 12vw, 150px);
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .pf-v5-c-login__container {
    padding: 0 0.5rem;
  }

  #kc-main-content {
    transform: scale(0.8);
    margin-top: -20px;
  }

  .kc-two-column-layout {
    padding: 1rem;
    gap: 1.5rem;
  }

  #kc-header-it4i {
    height: 50px;
    width: 150px;
    top: 10px;
    left: 10px;
  }

  #kc-header-wrapper {
    height: 80px;
    margin-top: -10px;
  }

  .kc-column-header {
    font-size: 1rem;
  }

  .kc-myaccessid-button,
  .kc-social-button {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
  }

  #tby-2a0696 {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .kc-two-column-layout {
    padding: 0.75rem;
  }

  #kc-main-content {
    transform: scale(0.8);
    margin-top: -20px;
  }

  #kc-header-it4i {
    height: 40px;
    width: 120px;
  }

  #kc-header-wrapper {
    height: 60px;
  }

  .kc-myaccessid-button,
  .kc-social-button {
    font-size: 0.8125rem;
    padding: 0.5rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #kc-social-providers svg:not(.google) {
    filter: invert(54%) sepia(96%) saturate(2028%) hue-rotate(174deg)
      brightness(99%) contrast(97%);
  }
}

/* Large screen optimization */
@media (min-width: 1400px) {
  .pf-v5-c-login__container {
    max-width: 1200px;
  }
}
