/* Only apply to login page */
body[data-view="/Apps/Auth/userlogin"] {
  min-height: 100vh;
  height: auto;
  padding: 0;
  margin: 0;
  color: rgba(255,255,255,.75);
  font-family: 'Anonymous Pro', monospace;  
  background-color: #1a1d2e;
  /*background: linear-gradient(135deg, #1a1d2e 0%, #16213e 100%);*/
  background: linear-gradient(135deg, #0b0d173d 0%, #06194c47 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8%;
  position: relative;
  overflow: hidden;
}

/* Move the typewriter text inside loginbox */
body[data-view="/Apps/Auth/userlogin"] .loginbox::before {
  content: "AI Integrated Data Centers ";
  position: absolute;
  bottom: 112%;   /* lock it to top of box */
  left: 0;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  font-size: 20px;
  color: #79c548;
  border-right: 2px solid #9ACD32;
  padding-bottom: 2px;
  animation: typewriter 6s steps(47) infinite,
             blinkTextCursor 500ms infinite;
}

/* Subtext just under the first headline */
body[data-view="/Apps/Auth/userlogin"] .loginbox::after {
  content: "Login to manage, monitor and control infrastructure.";
  position: absolute;
  bottom: calc(100% - 25px); /* slightly closer */
  left: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  bottom: 106%;
}

body[data-view="/Apps/Auth/userlogin"]::before {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1150px;
  height: 1150px;
  background-image: url(https://ibms.khaznacloud.com/Resources/Khazna/login-page-globe.png);
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
  margin-bottom: -312px;
  margin-left: -141px;
}

/* Globe Layer 2: Middle globe (globe2.png) */
body[data-view="/Apps/Auth/userlogin"]::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
   /* width: 1180px;
    height: 1180px;*/
    width: 1941px;
    height: 1960px;
    background-image: url(https://ibms.khaznacloud.com/Resources/Khazna/login-page-globe-overlay.png);
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 2;
    /*margin-bottom: -420px;
    margin-left: -365px;*/
    margin-bottom: -772px;
    margin-left: -560px;
   animation: rotateGlobe 60s linear infinite;
}

/* Rotation animation */
@keyframes rotateGlobe {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Ensure login box stays above all globe layers */
body[data-view="/Apps/Auth/userlogin"] .loginbox {
  position: relative;
  z-index: 10;
}


/* Ensure login box stays above the GIF */
body[data-view="/Apps/Auth/userlogin"] .loginbox {
  position: relative;
  z-index: 10;
}

/* Animation with typing, pause, then instant clear */
@keyframes typewriter {
  0%, 83.34%, 100% { 
    width: 0;
    border-right-color: #9ACD32;
  }
  50%, 83.33% { 
    width: 17.3em;
    border-right-color: #9ACD32;
  }
}

@keyframes blinkTextCursor {
  0%, 100% { border-right-color: #9ACD32; }
  50% { border-right-color: transparent; }
}

/* Login Box Styling - Only on login page */
body[data-view="/Apps/Auth/userlogin"] .loginbox {
  color: #ffffff;
  right: 28%;
  margin: 0 auto;
  max-width: 480px;
  width: 180%;
  padding: 4px 18px;
  position: relative;
  border-radius: 24px;
  background: rgb(0 0 0 / 19%);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  margin-bottom: -60px;
}

div.loginbox {
    /*bottom: 20px;*/
    position: fixed;
    /*right: 150%;*/
}

body[data-view="/Apps/Auth/userlogin"] .loginlogo {
  display: block;
  margin: 20px 0 10px 0;
  text-align: left;
  width: 180px;
  height: 60px;
  background-image: url(../Resources/Khazna/khazna-logo-light.png);
  background-size: contain;
  background-position: left center;
  background-repeat: no-repeat;
}

/* Hide "Welcome to iviva" */
body[data-view="/Apps/Auth/userlogin"] .appheader {
  display: none;
}

body[data-view="/Apps/Auth/userlogin"] .accountlabel {
  display: none;
}

/* Form Field Styling */
body[data-view="/Apps/Auth/userlogin"] .fieldlist {
  width: 100%;
  border-collapse: collapse;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-row {
  margin-bottom: 20px;
  display: block;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-row td {
  display: block;
  width: 100%;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-name {
    text-align: left !important;
  padding: 0 0 8px 0;
  vertical-align: top;
  display: block;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  display: block;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-content {
  padding: 0;
  display: block;
}

/* Hide first row if it contains subtxt */
body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:first-child {
  display: none;
}

/* Override "User ID" label text with "Email Address" */
body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:nth-child(2) .fieldlist-title {
  font-size: 0;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:nth-child(2) .fieldlist-title::before {
  content: "Email Address";
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Input Fields */
body[data-view="/Apps/Auth/userlogin"] .textfield_medium {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

body[data-view="/Apps/Auth/userlogin"] .textfield_medium:focus {
  outline: none;
  border-color: #9ACD32;
  background: rgba(255, 255, 255, 0.08);
}

body[data-view="/Apps/Auth/userlogin"] .textfield_medium::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Checkbox row styling - place checkbox and forgot password on same line */
body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:nth-child(4) {
  margin-bottom: 25px;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:nth-child(4) td {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Checkbox Styling */
body[data-view="/Apps/Auth/userlogin"] .cb_container {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-view="/Apps/Auth/userlogin"] .cb_container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

body[data-view="/Apps/Auth/userlogin"] .cb_container label {
  font-size: 0;
}

/* Override "Keep me logged in" to "Remember me" */
body[data-view="/Apps/Auth/userlogin"] .cb_container label::before {
  content: "Remember me";
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  user-select: none;
}

/* Action Link - Forgot Password */
body[data-view="/Apps/Auth/userlogin"] .actionlink {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0;
}

body[data-view="/Apps/Auth/userlogin"] .actionlink::before {
  content: "Forgot Password?";
  font-size: 13px;
  margin-right: 45px;
}

body[data-view="/Apps/Auth/userlogin"] .actionlink:hover {
  color: #79c548;
  /* text-decoration: underline; */
  text-decoration: none;
}

/* Position forgot password link next to Remember me */
body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:last-child {
  position: absolute;
  top: 0;
  right: 0;
  margin-top: 280px;
  display: block;
  width: auto;;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:last-child .fieldlist-name {
  display: none;
}

body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:last-child .fieldlist-content {
  display: block;
  text-align: right;
  padding: 0;
}

/* Submit Button */
body[data-view="/Apps/Auth/userlogin"] .normal_action {
  min-width: 480px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #79c548 0%, #79c548 100%);
  border: none;
  border-radius: 30px;
  color: #1a1d2e;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 14px;
}

body[data-view="/Apps/Auth/userlogin"] .normal_action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(154, 205, 50, 0.4);
}

body[data-view="/Apps/Auth/userlogin"] .normal_action:active {
  transform: translateY(0);
}

/* Error Message */
body[data-view="/Apps/Auth/userlogin"] .errormessage {
  background-color: #eb85638f !important;
  color: white !important;
  font-weight: 700;
  padding: 12px;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Adjust Forgot Password position when error message is visible */
body[data-view="/Apps/Auth/userlogin"] .errormessage.false ~ table .fieldlist-row:last-child,
body[data-view="/Apps/Auth/userlogin"] .errormessage:not(.invisible) ~ table .fieldlist-row:last-child {
  margin-top: 357px;
}

/* Adjust loginbox position when error message is visible */
body[data-view="/Apps/Auth/userlogin"]:has(.errormessage.false) div.loginbox,
body[data-view="/Apps/Auth/userlogin"]:has(.errormessage:not(.invisible)) div.loginbox {
  right: 28%;
}


/* Subtxt styling */
body[data-view="/Apps/Auth/userlogin"] .subtxt {
  display: none;
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
  body[data-view="/Apps/Auth/userlogin"] {
    justify-content: center;
    padding-right: 5%;
    padding-left: 5%;
  }
  
  body[data-view="/Apps/Auth/userlogin"] .loginbox {
    max-width: 90%;
    padding: 0px 45px;
    margin-top: 40px;
    right: auto;
  }
  
  body[data-view="/Apps/Auth/userlogin"] .loginbox::before {
    font-size: 16px;
  }
  
  body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:nth-child(4) td {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  /* Position forgot password link next to Remember me */
    body[data-view="/Apps/Auth/userlogin"] .fieldlist-row:last-child {
      margin-top: 286px;
    }
}

@media only screen and (min-width: 1224px) {
  body[data-view="/Apps/Auth/userlogin"] .loginbox {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}