* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, #e6f2ff, #f0f7ff);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  position: relative;
  overflow: visible;
}

/* Background Animation */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.background-animation .shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 100, 200, 0.05);
  backdrop-filter: blur(5px);
}

.background-animation .shape:nth-child(1) {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  animation: float 15s infinite ease-in-out;
}

.background-animation .shape:nth-child(2) {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: -50px;
  animation: float 12s infinite ease-in-out reverse;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(20px, 30px) rotate(5deg);
  }
}

/* Logo Container */
.logo-container {
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.logo-container img {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  box-shadow: 0 6px 25px rgba(0, 80, 150, 0.15);
  object-fit: contain;
  background: white;
  padding: 10px;
  transition: transform 0.3s ease;
}

.logo-container img:hover {
  transform: scale(1.05) rotate(5deg);
}

.platform-name {
  color: #003366;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.5px;
}

/* Login Container */
.login-container {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 60, 120, 0.15);
  padding: 40px 35px;
  width: 100%;
  max-width: 450px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 45px rgba(0, 80, 160, 0.2);
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #0070cc, #00a0ff);
}

.login-container h2 {
  color: #003366;
  margin-bottom: 30px;
  font-weight: 700;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Form Elements */
form {
  text-align: right;
}

.form-group {
  position: relative;
  margin-bottom: 28px;
}

.form-group input {
  width: 100%;
  padding: 16px 50px 16px 16px;
  border: 2px solid #e0e9f2;
  border-radius: 14px;
  font-size: 1rem;
  background-color: #f8fafc;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
  outline: none;
  border-color: #0070cc;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 112, 204, 0.2);
}

.form-group label {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(to top, #f8fafc 50%, white 50%);
  padding: 0 8px;
  color: #6b7280;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  pointer-events: none;
  border-radius: 4px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
  top: 0;
  right: 40px;
  font-size: 0.8rem;
  color: #0070cc;
  background: white;
  padding: 0 5px;
}

.form-group i {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.form-group input:focus ~ i {
  color: #0070cc;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #0070cc, #004080);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 80, 160, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #0060b3, #003366);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 80, 160, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn .btn-loader {
  display: none;
  gap: 6px;
}

.submit-btn.loading .btn-text {
  display: none;
}

.submit-btn.loading .btn-loader {
  display: flex;
}

.loader-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.4s infinite ease-in-out;
}

.loader-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  30% {
    transform: translateY(-8px);
    opacity: 0.7;
  }
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 25px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #e0e9f2, transparent);
}

.divider-text {
  padding: 0 15px;
  color: #6b7280;
  font-size: 0.9rem;
}

/* LTerrazi Button */
.lterrazi-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 25px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #4285f4, #3367d6);
  color: white;
  border: none;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.lterrazi-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
  background: linear-gradient(135deg, #3367d6, #2a56c4);
}

.lterrazi-login-btn:active {
  transform: translateY(0);
}

.lterrazi-logo {
  height: 24px;
  width: auto;
  margin-left: 10px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Error Messages */
.error-message {
  background-color: #fff0f0;
  color: #d32f2f;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  font-size: 0.95rem;
  text-align: right;
  border-left: 4px solid #d32f2f;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Footer */
.footer-note {
  margin-top: 35px;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  color: #6b7280;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: rgba(0, 112, 204, 0.1);
}

.social-links a:hover {
  color: white;
  background: #0070cc;
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 112, 204, 0.3);
}

/* Responsive Design */
@media (max-width: 480px) {
  .login-container {
    padding: 30px 20px;
    border-radius: 18px;
  }
  
  .platform-name {
    font-size: 1.8rem;
  }
  
  .login-container h2 {
    font-size: 1.6rem;
  }
  
  .form-group input {
    padding: 14px 45px 14px 14px;
    font-size: 0.95rem;
  }
  
  .submit-btn, .lterrazi-login-btn {
    padding: 14px;
  }
}

/* Loading Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}