/* Login Page - Ultra Sophisticated CSS */
:root {
  --primary-gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  --secondary-gradient: linear-gradient(135deg, #4895ef 0%, #4cc9f0 100%);
  --accent-color: #f72585;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4cc9f0;
  --error-color: #f72585;
  --border-radius-xl: 20px;
  --border-radius-lg: 15px;
  --border-radius-md: 10px;
  --box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
  --box-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --text-gradient: linear-gradient(90deg, #4361ee, #3a0ca3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.login-page {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
  color: var(--dark-color);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow-x: hidden;
}

body.login-page::before {
  content: '';
  position: absolute;
  top: -50vh;
  right: -50vw;
  width: 100vw;
  height: 100vh;
  background: var(--primary-gradient);
  opacity: 0.03;
  border-radius: 50%;
  z-index: -1;
}

/* Container */
.container {
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem;
  background-color: white;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  animation: fadeInUp 0.8s ease-out;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--primary-gradient);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
h2 {
  color: transparent;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 2rem;
  font-weight: 700;
  font-size: 2.5rem;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* Form */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  background-color: #f8f9fa;
}

input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(247, 37, 133, 0.2);
  background-color: white;
  transform: translateY(-2px);
}

input::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

/* Button */
button[type="submit"] {
  background: var(--primary-gradient);
  color: white;
  padding: 1rem;
  border: none;
  border-radius: var(--border-radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--secondary-gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-hover);
}

button[type="submit"]:hover::before {
  opacity: 1;
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* Messages */
.error {
  padding: 1.25rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
  animation: fadeIn 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.error {
  background-color: rgba(247, 37, 133, 0.15);
  color: var(--error-color);
  border-left: 4px solid var(--error-color);
}

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

/* Footer */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  color: #6c757d;
  font-size: 0.9rem;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.footer a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Floating Animation */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  body.login-page {
    padding: 1.5rem;
  }
  
  .container {
    padding: 2rem;
  }
  
  h2 {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  body.login-page {
    padding: 1rem;
    background: white;
  }
  
  .container {
    padding: 1.5rem;
    box-shadow: none;
    border-radius: 0;
  }
  
  .container::before {
    height: 5px;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  form {
    gap: 1rem;
  }
  
  input, button[type="submit"] {
    padding: 0.9rem 1.25rem;
  }
}

/* Micro-interactions */
input:not(:placeholder-shown) {
  background-color: white;
}

/* Loading State */
button[type="submit"].loading {
  position: relative;
  color: transparent;
}

button[type="submit"].loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Password Toggle */
.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #adb5bd;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--accent-color);
}

footer {
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    border-top: 1px solid rgba(0, 0, 0, 0.08); /* subtle top border */
}

footer p {
    color: #718096; /* soft gray */
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    line-height: 1.6;
    margin: 0;
}

footer a {
    color: #3498db; /* primary blue */
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

footer a:hover {
    color: #2c3e50; /* darker blue on hover */
    text-decoration: underline;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    footer {
        padding: 1rem 0;
    }
    
    footer p {
        font-size: 0.85rem;
    }
}