:root {
  --primary: #952c2d;
  --primary-dark: #7a2425;
  --white: #fff;
  --light: #f8f9fa;
  --dark: #212529;
}

body {
  min-height: 100vh;
  background: linear-gradient(rgba(33, 37, 41, 0.8), rgba(149, 44, 45, 0.9)),
    url("../img/loginbg.png");
  background-size: cover;
  background-position: center;
  font-family: "Poppins", sans-serif;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 360px; /* Reduced from 400px */
  background: var(--primary);
  padding: 30px; /* Reduced from 40px */
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--white);
}

.login-logo {
  width: 100px; /* Reduced from 120px */
  height: auto;
  margin-bottom: 15px; /* Reduced from 20px */
}

.welcome-text {
  color: var(--white);
  font-size: 1.5rem; /* Reduced from 1.8rem */
  font-weight: 600;
  margin-bottom: 8px; /* Reduced from 10px */
}

.login-subtitle {
  color: var(--light);
  font-size: 0.85rem; /* Reduced from 0.9rem */
  opacity: 0.9;
  margin-bottom: 25px; /* Reduced from 30px */
}

.form-group {
  margin-bottom: 15px; /* Reduced from 20px */
}

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.input-group .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--white);
  padding: 0.6rem 1rem; /* Reduced padding */
  height: 45px; /* Reduced from 50px */
}

.input-group .form-control:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-text {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--white);
  padding: 0.6rem 1rem; /* Match form-control padding */
}

.password-toggle {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  cursor: pointer;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.password-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.password-toggle i {
  font-size: 1rem;
  line-height: 1;
}

/* Remove default button styles */
.password-toggle {
  margin: 0;
  border: none;
  outline: none !important;
  box-shadow: none !important;
}

/* Ensure consistent height */
.input-group-text,
.form-control,
.password-toggle {
  height: 45px;
  line-height: 1;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
  color: var(--white);
}

.form-check-label {
  color: var(--light);
  font-size: 0.9rem;
}

.form-check-input {
  border-color: rgba(255, 255, 255, 0.4);
}

.form-check-input:checked {
  background-color: var(--white);
  border-color: var(--white);
}

.btn-login {
  background: var(--white);
  color: var(--primary);
  padding: 10px; /* Reduced from 12px */
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin-top: 1.1em;
}

.btn-login:hover {
  background: var(--light);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Back to home button - Updated Formal Style */
.back-to-home {
  position: fixed;
  top: 30px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  backdrop-filter: blur(10px);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-to-home i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.back-to-home:hover {
  background: var(--white);
  color: var(--primary);
  transform: translateX(-5px);
}

.back-to-home:hover i {
  transform: translateX(-3px);
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  color: #fff;
  font-weight: 500;
  transform: translateX(150%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 9999;
  min-width: 300px;
  max-width: 450px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.notification.success {
  background: rgba(40, 167, 69, 0.95);
}

.notification.error {
  background: rgba(220, 53, 69, 0.95);
}

.notification.success .error-icon,
.notification.error .success-icon {
  display: none;
}

.notification.show {
  transform: translateX(0);
}

/* Success Modal */
.success-modal {
  z-index: 99999999;
}

.modal-backdrop {
  z-index: 9999999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.success-modal .modal-dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 1rem);
}

.success-modal .modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: none;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  max-width: 450px;
  margin: auto;
}

.success-modal .modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.success-modal .modal-body {
  padding: 3.5rem 2.5rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
}

.success-animation {
  margin: 0 auto 2rem;
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
}

.success-animation::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle,
    rgba(149, 44, 45, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.checkmark {
  width: 90px;
  height: 90px;
  margin: 0 auto;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: var(--primary);
  stroke-miterlimit: 10;
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 12px rgba(149, 44, 45, 0.2));
  position: relative;
  z-index: 1;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--primary);
  fill: rgba(149, 44, 45, 0.05);
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--primary);
  stroke-width: 3;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-modal h4 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  animation: slideUp 0.5s ease-out 0.3s both;
}

.success-modal .user-fullname {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: 0.75rem;
  animation: slideUp 0.5s ease-out 0.4s both;
}

.success-modal .role-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: var(--white);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(149, 44, 45, 0.3);
  animation: slideUp 0.5s ease-out 0.5s both;
  transition: all 0.3s ease;
}

.success-modal .role-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(149, 44, 45, 0.4);
}

.success-modal .last-login {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: rgba(149, 44, 45, 0.05);
  border: 1px solid rgba(149, 44, 45, 0.1);
  border-radius: 12px;
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.5rem;
  animation: slideUp 0.5s ease-out 0.6s both;
}

.success-modal .last-login::before {
  content: "\f017";
  font-family: "Font Awesome 6 Free";
  font-weight: 400;
  color: var(--primary);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .login-container {
    padding: 30px 20px;
  }

  .welcome-text {
    font-size: 1.5rem;
  }

  .login-subtitle {
    font-size: 0.8rem;
  }

  .login-logo {
    width: 100px;
  }

  .back-to-home {
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .back-to-home i {
    font-size: 0.9rem;
  }

  .notification {
    left: 50%;
    right: auto;
    transform: translate(-50%, -150%);
    top: 10px;
    width: calc(100% - 40px);
    min-width: 0;
    max-width: 320px;
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .notification.show {
    transform: translate(-50%, 0);
  }

  .notification-icon {
    font-size: 1.2rem;
  }

  .notification-content {
    gap: 10px;
  }

  .modal-dialog {
    margin: 1rem;
  }

  .checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto;
  }

  .input-group-text,
  .form-control,
  .password-toggle {
    height: 42px;
  }

  .password-toggle {
    padding: 0.5rem 0.8rem;
  }

  .success-modal .modal-content {
    border-radius: 20px;
    max-width: 90%;
    margin: 1rem auto;
  }

  .success-modal .modal-body {
    padding: 2.5rem 1.5rem !important;
  }

  .success-animation {
    margin-bottom: 1.5rem;
  }

  .success-animation::before {
    width: 90px;
    height: 90px;
  }

  .checkmark {
    width: 70px;
    height: 70px;
  }

  .success-modal h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .success-modal .user-fullname {
    font-size: 1rem;
    margin-bottom: 0.625rem;
  }

  .success-modal .role-badge {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  .success-modal .last-login {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .success-modal .modal-body {
    padding: 2rem 1.25rem !important;
  }

  .success-animation {
    margin-bottom: 1.25rem;
  }

  .checkmark {
    width: 60px;
    height: 60px;
  }

  .success-animation::before {
    width: 75px;
    height: 75px;
  }

  .success-modal h4 {
    font-size: 1.35rem;
  }

  .success-modal .user-fullname {
    font-size: 0.95rem;
  }

  .success-modal .role-badge {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
  }
}
