@font-face {
  font-family: "AppFont";
  src: url("../fonts/lato/LatoLatin-Regular.eot"); /* IE9 Compat Modes */
  src: url("../fonts/lato/LatoLatin-Regular.eot?#iefix")
      format("embedded-opentype"),
    /* IE6-IE8 */ url("../fonts/lato/LatoLatin-Regular.woff2") format("woff2"),
    /* Modern Browsers */ url("../fonts/lato/LatoLatin-Regular.woff")
      format("woff"),
    /* Modern Browsers */ url("../fonts/lato/LatoLatin-Regular.ttf")
      format("truetype");
  font-style: normal;
  font-weight: normal;
  text-rendering: optimizeLegibility;
}

/* Bold */
@font-face {
  font-family: "AppFont";
  src: url("../fonts/lato/LatoLatin-Bold.eot"); /* IE9 Compat Modes */
  src: url("../fonts/lato/LatoLatin-Bold.eot?#iefix")
      format("embedded-opentype"),
    /* IE6-IE8 */ url("../fonts/lato/LatoLatin-Bold.woff2") format("woff2"),
    /* Modern Browsers */ url("../fonts/lato/LatoLatin-Bold.woff")
      format("woff"),
    /* Modern Browsers */ url("../fonts/lato/LatoLatin-Bold.ttf")
      format("truetype");
  font-style: normal;
  font-weight: bold;
  text-rendering: optimizeLegibility;
}

:root {
  --color-primary: #41b9be;
  --color-text: #0a1e1e;
  --color-bg-lite: #f8f8f8;
  --color-border: #d8dbdb;
  --color-label: #6c7878;
  --color-bg: #eeeeee;
}

body {
  background-image: url("../img/login-background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100dvh;
}

@media screen and (max-width: 600px) {
  body {
    background-image: url("../img/login-background-mobile.jpg");
  }
}

#kc-header {
  margin: 2em auto 3em;
  padding: 0 2em;
  max-width: calc(1288px - 4em);
}

#kc-header-wrapper {
  background-image: url("../img/logo.svg");
  background-repeat: no-repeat;
  color: transparent;
  width: 160px;
  height: 31px;
}

.pf-v5-c-login__container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

main {
  background: #fff;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 10px 13px #0003;
  padding-block-end: 2rem;
  border-radius: 5px;
  margin: 0 1rem;
}

@media screen and (max-width: 768px) {
  main {
    margin: 0 0.5rem;
  }

  .kc-tab {
    font-size: 18px;
  }

  #kc-header {
    margin: 1.5em 0 2em;
    padding: 0 1em;
  }
}



.pf-v5-c-login__main-header {
  margin-bottom: 1.5rem;
  border-radius: 5px;
}

.pf-v5-c-title {
  margin: 0;
}

/* Tabs styling */
.kc-tabs {
  display: flex;
  margin-bottom: 2rem;
  padding-bottom: 0;
}

.kc-tab {
  color: var(--color-primary);
  border-radius: 5px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 71px;
  font-family: AppFont;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.kc-tab-active {
  color: var(--color-primary);
  height: 81px;
  transform: translateY(-10px);
  background-color: white;
}

.kc-tab-inactive {
  background-color: #e8e8e8;
}

.kc-tab-inactive:hover {
  background-color: white;
}

#kc-username {
  padding-inline: 2rem;
}

#kc-form-login,
#kc-passwd-update-form {
  display: flex;
  flex-direction: column;
  padding-inline: 2rem;
}

.pf-v5-c-form__group {
  display: flex;
  flex-direction: column;
  margin-bottom: 22px;
}

.pf-v5-c-form__group label {
  margin-bottom: 0.25rem;
}

.pf-v5-c-form__group .pf-v5-c-form__label-text {
  display: block;
  font-weight: 400;
  color: var(--color-label);
  font-size: 16px;
}

.pf-v5-c-form__label-required {
  color: var(--color-primary);
  margin-left: 0.25rem;
}

/* Password label row with forgot password link */
.kc-password-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kc-forgot-password {
  font-size: 16px;
  text-decoration: underline;
  color: var(--color-primary);
}

.kc-forgot-password:hover {
  opacity: 0.8;
}

/* Password input group with reveal button */
.pf-v5-c-input-group {
  position: relative;
  display: block;
}

.pf-v5-c-form-control {
  width: 100%;
}

.pf-v5-c-input-group input[type="password"],
.pf-v5-c-input-group input[type="text"] {
  padding-right: 3.5rem;
}

[data-password-toggle] {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-password-toggle] i {
  width: 24px;
  height: 18px;
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.fa-eye-slash {
  background-image: url("../img/RevealPassword.svg");
}

.fa-eye {
  background-image: url("../img/HidePassword.svg");
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 24px;
}

.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  cursor: pointer;
  border: 2px solid var(--color-label);
  border-radius: 3px;
  background-color: white;
  position: relative;
  transition: all 0.2s ease;
  padding: 0;
}

/* Hover state */
.checkbox input[type="checkbox"]:hover {
  border-color: #b8baba;
  background-color: #fafafa;
}

/* Checked state */
.checkbox input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(65, 185, 190, 0.2);
}

/* Checkmark */
.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox label {
  margin: 0;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text);
  user-select: none;
}

label {
  color: var(--color-label);
  font-family: AppFont;
  font-size: 16px;
  display: inline-block;;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

input {
  box-sizing: border-box;
  height: 48px;
  width: 100%;
  background-color: var(--color-bg-lite);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0 1rem;
  font-family: AppFont;
  font-size: 16px;
}

input:focus {
  border: 1px solid var(--color-primary);
  outline: none;
}

/* Login button */
#kc-login,
input[type="submit"],
#kc-update-password {
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 3px;
  height: 48px;
  padding: 0 1rem;
  font-size: 16px;
  font-weight: 600;
  font-family: AppFont;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 0.5rem;
  max-width: 295px;
}

#kc-register-form {
  padding: 0 2rem;
}

#kc-login:hover,
#kc-update-password:hover {
  background-color: #389a9e;
}

#kc-form-buttons {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Social providers divider */
.kc-social-divider {
  position: relative;
  text-align: center;
  margin: 2rem 0 1.5rem;
}

.kc-social-divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
}

.kc-social-divider span {
  position: relative;
  background-color: white;
  padding: 0 1rem;
  color: var(--color-label);
  font-size: 14px;
}

/* Social providers styling */
#kc-social-providers {
  margin-top: 1.5rem;
}

#kc-social-providers ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

#kc-social-providers li {
  margin: 0;
}

/* Social button styling - matching Angular component */
.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 40px;
  padding: 8px;
  border: 1px solid rgb(218, 220, 224);
  border-radius: 4px;
  background-color: white;
  color: var(--color-text);
  font-family: 'AppFont', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-button:hover {
  background-color: rgba(210, 227, 252, 0.25);
  border-color: #d2e3fc;
}

.social-button svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.social-button span {
  width: 100%;
  text-align: center;
}

/* Google button container styling - matching Angular component */
.google-button-container {
  width: 280px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Override Google's button iframe styles to match our design */
.google-button-container > div {
  width: 280px !important;
}

.google-button-container iframe {
  border-radius: 4px !important;
}

/* 2FA TOTP Setup Page Styles */
#kc-totp-settings {
  list-style: none;
  counter-reset: step-counter;
  padding: 0 2rem;
  margin: 0 0 2rem 0;
}

#kc-totp-settings > li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 2rem;
}

#kc-totp-settings > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: -4px;
  width: 32px;
  height: 32px;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  font-family: AppFont;
}

.kc-totp-step-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 1rem 0;
  font-family: AppFont;
}

.kc-totp-step-description {
  font-size: 16px;
  color: var(--color-label);
  margin: 0.5rem 0 0 0;
  font-family: AppFont;
}

/* Supported apps list */
#kc-totp-supported-apps {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
}

#kc-totp-supported-apps li {
  font-size: 16px;
  color: var(--color-label);
  padding-bottom: 0.5rem;
  font-family: AppFont;
}

/* QR Code Container */
.kc-totp-qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#kc-totp-secret-qr-code {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.kc-totp-manual-link {
  text-align: center;
  margin: 0.5rem 0 0 0;
}

.kc-totp-manual-link a {
  font-size: 16px;
  color: var(--color-primary);
  text-decoration: underline;
  font-family: AppFont;
}

.kc-totp-manual-link a:hover {
  opacity: 0.8;
}

/* Manual mode secret key */
#kc-totp-secret-key {
  display: inline-block;
  background-color: var(--color-bg-lite);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.75rem 1rem;
  font-family: monospace;
  font-size: 16px;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: 0.05em;
  user-select: all;
  -webkit-user-select: all;
  -moz-user-select: all;
}

/* Form styling for TOTP page */
#kc-totp-settings-form {
  padding-inline: 4rem 2rem;
}

.kc-totp-form-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Primary button for TOTP (matches login button) */
#saveTOTPBtn {
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 3px;
  height: 48px;
  padding: 0 2rem;
  font-size: 16px;
  font-weight: 600;
  font-family: AppFont;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 150px;
}

#saveTOTPBtn:hover {
  background-color: #389a9e;
}

/* Secondary button style for Cancel */
.kc-button-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  height: 48px;
  padding: 0 2rem;
  font-size: 16px;
  font-weight: 600;
  font-family: AppFont;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

.kc-button-secondary:hover {
  border-color: var(--color-primary);
  background-color: #fafafa;
}

#input-error,
#input-error-otp-code,
#input-error-otp-label,
.pf-m-error {
    color: red;
    font-size: 14px;
    font-family: AppFontR;
}

/* OTP Login Form Styles */
#kc-otp-login-form {
  display: flex;
  flex-direction: column;
  padding-inline: 2rem;
}

#kc-otp-login-form .col-xs-12 {
  width: 100%;
}

/* OTP Login page header styling - only applies when OTP form is present */
.pf-v5-c-login__main:has(#kc-otp-login-form) .pf-v5-c-title {
  color: var(--color-primary);
  font-family: 'AppFont';
  font-weight: bold;
  margin-left: 2rem;
  margin-top: 1rem;
}

.pf-v5-c-alert__title {
  display: inline-block;
  padding-inline: 2rem;
  padding-block-end: 2rem;
  font-family: AppFont;
  color: var(--color-text);
}

/* Radio button styling */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  background: transparent;
  margin: 0;
  padding: 0;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  border: 2px solid #5a5a5a;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Inner filled circle (scales in when checked) */
input[type="radio"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  background-color: var(--color-primary);
}

/* Ripple effect background */
input[type="radio"]::after {
  content: "";
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-primary);
  opacity: 0;
  position: absolute;
  z-index: -10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

/* Active state when clicking (not checked) */
input[type="radio"]:active:not(:checked):not(:disabled) {
  background-color: rgba(65, 185, 190, 0.1);
}

/* Checked state */
input[type="radio"]:checked {
  border-color: var(--color-primary);
}

input[type="radio"]:checked::after {
  opacity: 0;
}

input[type="radio"]:checked::before {
  transform: translate(-50%, -50%) scale(1);
}

/* Hover and focus on checked radio */
input[type="radio"]:checked:hover::after,
input[type="radio"]:checked:focus::after {
  background-color: var(--color-primary);
  opacity: 0.1;
}

/* Active state on checked radio */
input[type="radio"]:checked:active::after {
  background-color: rgba(65, 185, 190, 0.1);
  opacity: 1;
}

/* Focus state */
input[type="radio"]:checked:focus::after {
  outline: none;
}

/* Disabled checked state */
input[type="radio"]:checked:disabled {
  cursor: not-allowed;
  border-color: var(--color-border);
  opacity: 0.4;
}

/* Disabled state */
input[type="radio"]:disabled {
  cursor: not-allowed;
  border-color: var(--color-border);
  opacity: 0.4;
}

input[type="radio"]:disabled + label {
  opacity: 0.4;
  cursor: default;
}

/* Responsive adjustments for TOTP page */
@media screen and (max-width: 768px) {
  #kc-totp-settings,
  #kc-totp-settings-form {
    padding: 0 1rem;
  }

  #kc-totp-settings > li {
    padding-left: 2rem;
  }

  #kc-totp-settings > li::before {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .kc-totp-step-title {
    font-size: 16px;
  }

  .kc-totp-qr-container {
    padding: 0.5rem;
  }

  .kc-totp-form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  #saveTOTPBtn,
  .kc-button-secondary {
    width: 100%;
    min-width: auto;
  }

  /* Responsive social buttons */
  .social-button,
  .google-button-container {
    max-width: 100%;
  }

  /* Responsive OTP login form */
  #kc-otp-login-form {
    padding-inline: 1rem;
  }
}


