:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #4cc9f0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4bb543;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.login-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gradient);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--dark-color);
  overflow-x: hidden;
  position: relative;
}

/* Background Animation */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 15s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  top: 50%;
  right: -50px;
  animation-delay: 3s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  bottom: -50px;
  left: 20%;
  animation-delay: 6s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  top: 20%;
  left: 40%;
  animation-delay: 9s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-20px) rotate(120deg);
  }
  66% {
    transform: translateY(20px) rotate(240deg);
  }
}

/* Back Button */
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  z-index: 10;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateX(-5px);
}

/* Login Section */
.login-section {
  flex: 1;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px 30px;
  max-width: 450px;
  width: 100%;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--gradient);
}

/* Logo */
.logo-container {
  margin-bottom: 20px;
}

.logo-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}

.logo-circle img {
  width: 70%;
  height: auto;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  color: var(--secondary-color);
  font-size: 28px;
  letter-spacing: 1px;
}

.brand-highlight {
  color: var(--primary-color);
  font-weight: 700;
}

/* Tabs */
.nav-pills {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 15px;
}

.nav-pills .nav-link {
  border-radius: 50px;
  padding: 10px 20px;
  margin: 0 5px;
  color: var(--dark-color);
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.nav-pills .nav-link.active {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow);
}

.nav-pills .nav-link:not(.active):hover {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary-color);
}

/* Forms */
.form-floating {
  margin-bottom: 20px;
  position: relative;
}

.form-floating > .form-control {
  padding-left: 45px;
  height: 60px;
  border-radius: 10px;
  border: 1px solid #e1e5ee;
  transition: var(--transition);
}

.form-floating > label {
  padding-left: 45px;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.form-floating > .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.form-floating > .form-control:focus ~ label {
  color: var(--primary-color);
}

.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary-color);
}

.form-floating > .form-control.is-invalid {
  border-color: var(--error-color);
}

.form-floating > .form-control.is-valid {
  border-color: var(--success-color);
}

.invalid-feedback, .valid-feedback {
  display: none;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-control:valid ~ .valid-feedback {
  display: block;
}

.form-check {
  margin-bottom: 20px;
}

.forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
}

.forgot-password:hover {
  text-decoration: underline;
}

.terms-link {
  color: var(--primary-color);
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Buttons */
.login-btn, .register-btn {
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-btn {
  background: var(--gradient);
}

.login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.register-btn {
  background: var(--success-color);
}

.register-btn:hover {
  background: #3fa23a;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(75, 181, 67, 0.4);
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Divider */
.divider {
  position: relative;
  text-align: center;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e1e5ee;
}

.divider span {
  background: white;
  padding: 0 15px;
  color: #6c757d;
  font-size: 14px;
}

/* Social Login */
.social-login {
  margin-bottom: 10px;
}

.social-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: 1px solid #e1e5ee;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Modal */
.modal-content {
  border-radius: 15px;
  border: none;
  box-shadow: var(--shadow);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  background: var(--gradient);
  color: white;
  border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* Footer */
.login-footer {
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* Success Animation */
.success-animation {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #4bb543;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #4bb543;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #4bb543;
  fill: none;
  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;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill {
  100% {
    box-shadow: inset 0px 0px 0px 30px #4bb543;
  }
}

/* Responsive */
@media (max-width: 576px) {
  .login-card {
    padding: 30px 20px;
  }
  
  .back-btn {
    top: 10px;
    left: 10px;
    font-size: 14px;
    padding: 8px 12px;
  }
  
  .logo-circle {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
  
  .brand-name {
    font-size: 24px;
  }
  
  .nav-pills .nav-link {
    padding: 8px 15px;
    font-size: 14px;
  }
}