/**
 * Login Page Modern Styles - Dynasty
 * Page de connexion moderne et élégante
 */

:root {
  --login-primary: #4f46e5;
  --login-primary-hover: #4338ca;
  --login-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.login-page {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Animated background */
body.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../img/3.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  filter: blur(3px);
}

/* Floating circles animation */
.bg-circles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  padding: 0;
  margin: 0;
}

.bg-circles li {
  position: absolute;
  display: block;
  list-style: none;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  animation: floatUp 25s linear infinite;
  bottom: -150px;
  border-radius: 50%;
}

.bg-circles li:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.bg-circles li:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.bg-circles li:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.bg-circles li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.bg-circles li:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.bg-circles li:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.bg-circles li:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.bg-circles li:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.bg-circles li:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.bg-circles li:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  100% { transform: translateY(-1500px) rotate(720deg); opacity: 0; }
}

body.login-page main#main {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1;
  position: relative;
}

body.login-page #login-container {
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.6s ease-out;
  position: relative;
  top: auto;
  right: auto;
}

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

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--login-gradient);
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.login-logo i {
  font-size: 2.5rem;
  color: white;
}

.login-header h1 {
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.5px;
}

.login-header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin: 0;
}

body.login-page .card {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  border: none !important;
  border-radius: 24px !important;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  overflow: hidden;
}

body.login-page .card-body {
  padding: 2.5rem !important;
}

body.login-page .form-group {
  margin-bottom: 1.5rem;
}

body.login-page .form-group label {
  display: block;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

body.login-page .form-control {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem !important;
  font-size: 1rem !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  color: #1e293b !important;
  transition: all 0.2s ease !important;
  height: auto !important;
}

body.login-page .form-control:focus {
  outline: none !important;
  border-color: var(--login-primary) !important;
  background: white !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

body.login-page .form-control::placeholder {
  color: #94a3b8;
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
  transition: color 0.2s;
  z-index: 1;
}

.input-icon-wrapper:focus-within i {
  color: var(--login-primary);
}

.btn-login {
  width: 100%;
  padding: 1rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: white !important;
  background: var(--login-gradient) !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4) !important;
}

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

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-login .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}

.btn-login .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner { display: inline-block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.login-page .alert {
  padding: 1rem !important;
  border-radius: 12px !important;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: shake 0.5s ease;
  border-left: none !important;
}

body.login-page .alert-danger {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #dc2626 !important;
}

body.login-page .alert-danger i {
  font-size: 1.25rem;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Mobile responsive */
@media (max-width: 480px) {
  body.login-page #login-container { padding: 0 1rem; }
  body.login-page .card-body { padding: 1.5rem !important; }
  .login-header h1 { font-size: 1.5rem; }
  .login-logo { width: 64px; height: 64px; border-radius: 16px; }
  .login-logo i { font-size: 2rem; }
}
