/*
 * Fantastic Modern Login Page
 * Glass morphism, animations, and cutting-edge design
 */

/* Animated Gradient Background */
body.login-page {
  background: linear-gradient(135deg, #4dd0c3 0%, #6ee7d8 25%, #90f7e3 50%, #6ee7d8 75%, #4dd0c3 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating Shapes Background */
body.login-page::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(144, 247, 227, 0.2) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Geometric Shapes */
body.login-page::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.05) 49%, rgba(255, 255, 255, 0.05) 51%, transparent 52%);
  background-size: 50px 50px;
  animation: slidePattern 30s linear infinite;
}

@keyframes slidePattern {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* Glass Morphism Login Container */
.login-box {
  position: relative;
  z-index: 1;
  width: 450px;
  max-width: 95%;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo Section with Glass Effect */
.login-logo {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px 24px 0 0;
  padding: 40px 30px 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.login-logo::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.login-logo a {
  display: block;
  text-align: center;
}

.login-logo img {
  max-width: 65%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.login-logo img:hover {
  transform: scale(1.05) rotate(2deg);
  filter: drop-shadow(0 8px 20px rgba(17, 153, 142, 0.3));
}

/* Glass Morphism Form Card */
.login-box-body,
.register-box-body {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-top: none;
  border-radius: 0 0 24px 24px;
  padding: 45px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* Flash Messages - Modern Style */
.text-danger,
.text-success {
  padding: 14px 20px;
  border-radius: 16px;
  margin-bottom: 25px;
  font-weight: 600;
  text-align: center;
  animation: slideDown 0.4s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Hide empty flash messages */
.text-danger:empty,
.text-success:empty {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}

.text-danger {
  background: rgba(235, 51, 73, 0.15);
  border: 1px solid rgba(235, 51, 73, 0.3);
  border-left: 4px solid #eb3349;
  color: #b8242f;
}

.text-success {
  background: rgba(77, 208, 195, 0.15);
  border: 1px solid rgba(77, 208, 195, 0.3);
  border-left: 4px solid #4dd0c3;
  color: #2d6862;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modern Floating Label Inputs */
.form-group {
  position: relative;
  margin-bottom: 30px;
}

.form-group.has-feedback {
  position: relative;
}

.form-control {
  height: 56px;
  padding: 20px 50px 8px 20px;
  background: rgba(248, 249, 250, 0.8);
  border: 2px solid rgba(77, 208, 195, 0.3);
  border-radius: 16px;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #2d3748;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #4dd0c3;
  box-shadow: 0 0 0 4px rgba(77, 208, 195, 0.15), 0 8px 20px rgba(77, 208, 195, 0.2);
  outline: none;
  transform: translateY(-2px);
}

.form-control::placeholder {
  color: #a0aec0;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-control:focus::placeholder {
  opacity: 0;
  transform: translateY(-10px);
}

/* Form Control Feedback Icons */
.form-control-feedback {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 20px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.has-feedback .form-control:focus ~ .form-control-feedback {
  color: #4dd0c3;
  transform: translateY(-50%) scale(1.1);
}

/* Modern Button Design */
.btn {
  height: 56px;
  padding: 0 32px;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #4dd0c3 0%, #90f7e3 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(77, 208, 195, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(77, 208, 195, 0.4);
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(77, 208, 195, 0.3);
}

/* Loading State */
.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Checkbox/Link Styling */
.checkbox.icheck label {
  font-weight: 500;
  color: #4a5568;
  font-size: 14px;
}

.checkbox.icheck a {
  color: #4dd0c3;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.checkbox.icheck a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #90f7e3;
  transition: width 0.3s ease;
}

.checkbox.icheck a:hover::after {
  width: 100%;
}

.checkbox.icheck a:hover {
  color: #90f7e3;
  text-decoration: none;
}

/* Demo Credentials Card - Glass Effect */
.box-body {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 30px;
  margin-top: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.8s ease 0.3s both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.box-body p {
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 20px;
}

.box-body span {
  color: #2d3748 !important;
  font-weight: 500;
}

/* Modern Table Styling */
.table {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: none;
}

.table td {
  padding: 16px;
  vertical-align: middle;
  border: none;
  color: #2d3748;
  font-weight: 500;
}

.table tr {
  border-bottom: 1px solid rgba(77, 208, 195, 0.15);
  transition: all 0.3s ease;
}

.table tr:hover {
  background: rgba(77, 208, 195, 0.1);
  transform: scale(1.02);
}

/* Demo Login Button */
.btn-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 12px;
  padding: 12px 24px;
  box-shadow: 0 6px 16px rgba(79, 172, 254, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

/* Responsive Design */
@media (max-width: 576px) {
  .login-box {
    width: 100%;
    margin: 20px;
  }

  .login-logo {
    padding: 30px 20px 20px;
  }

  .login-box-body,
  .register-box-body {
    padding: 35px 25px;
  }

  .form-control {
    height: 52px;
    font-size: 15px;
  }

  .btn {
    height: 52px;
    font-size: 14px;
  }

  .box-body {
    padding: 20px;
  }
}

/* Accessibility Focus States */
*:focus {
  outline: 3px solid rgba(77, 208, 195, 0.4);
  outline-offset: 2px;
}

.form-control:focus,
.btn:focus {
  outline: none;
}

/* Additional Polish */
::selection {
  background: rgba(77, 208, 195, 0.4);
  color: #2d6862;
}

::-moz-selection {
  background: rgba(77, 208, 195, 0.4);
  color: #2d6862;
}
