.body-container {
  background-image: linear-gradient(#6baace, #264783);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.carousel-item>div {
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* these rules are used to make sure in mobile devices, tab panes are not all the same height (for example 'forgot' pane is not as tall as 'signup' pane) */

@media (max-width: 1199.98px) {
  .tab-sliding .tab-pane:not(.active) {
    max-height: 0 !important;
  }

  .tab-sliding .tab-pane.active {
    min-height: 80vh;
    max-height: none !important;
  }
}

/* Reset all potential Yii2 styling */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow-x: hidden;
}

/* Remove any container restrictions */
.container,
.container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* Ensure full viewport usage */
.body-container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  min-height: 100vh !important;
}

/* Override any Yii2 content wrapper styling */
.main-container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

.main-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* Ensure template styling takes precedence */
.row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

[class*="col-"] {
  padding-left: 15px;
  padding-right: 15px;
}

#id-login-periode,
#id-login-tahun {
  font-size: 1rem !important;
}

#id-login-password {
  padding-right: 2.5rem !important;
}

.input-floating-label .fa-key {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

#toggle-login-password {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
  z-index: 2;
  background: transparent;
  border: none;
  outline: none;
}

#icon-login-password {
  font-size: 1.25rem;
  color: #4099ff;
}

/* Captcha styling */
.captcha-container {
  position: relative !important;
  display: inline-block !important;
  width: 100% !important;
}

.captcha-refresh-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  z-index: 10 !important;
}

.captcha-container:hover .captcha-refresh-overlay {
  opacity: 1 !important;
}

.captcha-refresh-overlay i {
  font-size: 1.5rem !important;
  margin-bottom: 0.25rem !important;
  animation: spin 2s linear infinite;
}

.captcha-refresh-overlay small {
  font-size: 0.7rem !important;
  text-align: center !important;
}

#captcha-image {
  transition: transform 0.2s ease !important;
  width: 100% !important;
  height: 60px !important;
  object-fit: contain !important;
}

.captcha-container:hover #captcha-image {
  transform: scale(1.02) !important;
}

/* When captcha is being refreshed */
.captcha-loading .captcha-refresh-overlay {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.8) !important;
}

.captcha-loading .captcha-refresh-overlay i {
  animation: spin 1s linear infinite !important;
  color: #4099ff !important;
}

.captcha-loading #captcha-image {
  opacity: 0.3 !important;
}

/* Better spin animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Captcha refresh button styling */
.captcha-refresh-overlay {
  transition: all 0.3s ease !important;
}

.captcha-refresh-overlay:hover {
  background: rgba(0, 0, 0, 0.85) !important;
}

.captcha-refresh-overlay:hover i {
  transform: scale(1.1);
  color: #4099ff !important;
}

/* Loading state improvements */
.captcha-loading .captcha-refresh-overlay small {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

/* Error state for form inputs */
.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Focus state improvements */
.form-control:focus {
  border-color: #4099ff !important;
  box-shadow: 0 0 0 0.2rem rgba(64, 153, 255, 0.25) !important;
}

/* Captcha input styling */
#login-captcha {
  font-weight: bold !important;
  letter-spacing: 2px !important;
  text-align: center !important;
}

/* Mobile responsive captcha */
@media (max-width: 767.98px) {
  .captcha-refresh-overlay {
    font-size: 0.8rem !important;
  }

  .captcha-refresh-overlay i {
    font-size: 1.2rem !important;
  }

  .captcha-refresh-overlay small {
    font-size: 0.6rem !important;
  }
}

.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.captcha-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.captcha-refresh-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 4px;
  cursor: pointer;
}

.captcha-container:hover .captcha-refresh-overlay {
  opacity: 1;
}

.captcha-refresh-overlay i {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.captcha-refresh-overlay small {
  font-size: 0.7rem;
  text-align: center;
}

#captcha-image {
  transition: transform 0.2s ease;
}

.captcha-container:hover #captcha-image {
  transform: scale(1.02);
}