:root {
  --bg-gradient: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 25%,
    #f093fb 50%,
    #4facfe 75%,
    #00f2fe 100%
  );
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-gradient-hover: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --text-main: #1e293b;
  --text-secondary: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(148, 163, 184, 0.3);
  --error: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

/* Background Animation */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #f093fb 0%, #4facfe 100%);
  bottom: -150px;
  right: -150px;
  animation-delay: 5s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Login Container */
.login-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 56px 48px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  width: 100%;
  max-width: 440px;
  text-align: center;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Brand Section */
.brand {
  margin-bottom: 40px;
}

.logo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.logo-img {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  margin-bottom: 0;
  position: relative;
  z-index: 2;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
}

.logo-img:hover {
  transform: scale(1.05) rotate(2deg);
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.4) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

h2 {
  color: white;
  margin: 0 0 8px 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.tagline {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  margin-top: 0;
  font-weight: 500;
}

/* Form Styles */
.form-group {
  margin-bottom: 28px;
  text-align: left;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  color: white;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.input-icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
}

.input-wrapper {
  position: relative;
}

input {
  width: 100%;
  padding: 16px 48px 16px 16px;
  border-radius: 12px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

input::placeholder {
  color: var(--text-secondary);
  font-weight: 400;
}

input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.input-wrapper.focused input {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.input-focus-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  border-radius: 2px;
}

.input-wrapper.focused .input-focus-line {
  width: 100%;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-radius: 6px;
}

.toggle-password:hover {
  color: var(--primary);
  background: rgba(102, 126, 234, 0.1);
}

.toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

/* Button Styles */
.btn-login {
  width: 100%;
  padding: 16px 24px;
  border-radius: 12px;
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4),
    0 0 0 0 rgba(102, 126, 234, 0.5);
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.3px;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
  width: 300px;
  height: 300px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(102, 126, 234, 0.5),
    0 0 0 0 rgba(102, 126, 234, 0.7);
  background: var(--accent-gradient-hover);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-text {
  position: relative;
  z-index: 1;
  display: inline-block;
  transition: opacity 0.3s;
}

.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.btn-login.loading .btn-text {
  opacity: 0;
}

.btn-login.loading .btn-loader {
  opacity: 1;
  animation: spin 1s linear infinite;
}

.btn-login.success {
  background: var(--success);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Error Message */
.error-message {
  display: none;
  padding: 14px 18px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #fee2e2;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  text-align: left;
  backdrop-filter: blur(10px);
  animation: slideDown 0.3s ease-out;
}

.error-message.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shake Animation */
#login-form.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-8px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(8px);
  }
}

/* Loading Animation */
.loading {
  display: none;
  margin-top: 20px;
  color: white;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
}

.loading.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Back Link */
.back-link {
  margin-top: 32px;
  font-size: 14px;
}

.back-link a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.3s;
  padding: 8px 12px;
  border-radius: 8px;
}

.back-link a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-4px);
}

.back-link a svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.back-link a:hover svg {
  transform: translateX(-2px);
}

/* Responsive */
@media (max-width: 480px) {
  .login-container {
    padding: 40px 32px;
    border-radius: 20px;
  }

  .logo-img {
    width: 80px;
    height: 80px;
  }

  h2 {
    font-size: 28px;
  }

  .form-group {
    margin-bottom: 24px;
  }
}
