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

:root {
  --primary-color: #3B82F6;
  --primary-hover: #2563EB;
  --secondary-color: #8B5CF6;
  --accent-color: #F59E0B;
  --success-color: #10B981;
  --error-color: #EF4444;
  --warning-color: #F59E0B;
  
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-card: rgba(255, 255, 255, 0.95);
  --border-color: #E5E7EB;
  --border-focus: var(--primary-color);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --border-radius: 25px;
  --border-radius-sm: 25px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/garde/bg1.webp') no-repeat;
  background-color: #1e40af;
  background-size: 100% auto;
  background-position: bottom center;
  z-index: -2;
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.shape-3 {
  width: 60px;
  height: 60px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  top: 10%;
  right: 30%;
  animation-delay: 1s;
}

.shape-5 {
  width: 140px;
  height: 140px;
  bottom: 30%;
  right: 40%;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(120deg); }
  66% { transform: translateY(20px) rotate(240deg); }
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2.5rem 1.2rem  2.5rem;
  animation: slideUp 0.6s ease-out;
  position: relative;
  overflow: hidden;
}


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

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

.logo {
  width: 120px;
  height: auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.logo img {
  width: 100%;
}

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

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

.card-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease-out;
}

.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.3s; }

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

.form-group label {
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group label i {
  margin-right: 0.5rem;
  color: var(--primary-color);
  width: 16px;
}

.form-group input,.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-primary);
}

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

.input-with-icon .field-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
  transition: var(--transition-fast, var(--transition));
  pointer-events: none;
}

.input-with-icon input:focus ~ .field-icon,
.input-with-icon:focus-within .field-icon {
  color: var(--primary-color);
}

.input-with-icon input {
  padding-left: 2.6rem;
}

.form-group input:focus,.form-group select  {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.form-group input:valid {
  border-color: var(--success-color);
}

.form-group input.error {
  border-color: var(--error-color);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.password-toggle:hover {
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
}

.error-message {
  display: block;
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: var(--transition);
}

.error-message.show {
  opacity: 1;
  transform: translateY(0);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.checkbox-container input {
  opacity: 0;
  position: absolute;
  cursor: pointer;
  width: 0;
  height: 0;
}

.checkmark {
  height: 18px;
  width: 18px;
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  margin-right: 0.5rem;
  transition: var(--transition);
  position: relative;
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

.forgot-password:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.submit-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1rem;
}

.submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
  color: var(--text-light);
  font-size: 0.9rem;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  background: var(--bg-card);
  padding: 0 1rem;
  position: relative;
}

.social-login {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.social-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.google-btn:hover {
  border-color: #DB4437;
  color: #DB4437;
}

.github-btn:hover {
  border-color: #333;
  color: #333;
}

.card-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.card-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

.card-footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.success-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.3s ease-out;
}

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

.success-icon {
  width: 60px;
  height: 60px;
  background: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  animation: successPulse 0.6s ease-out;
}

.success-icon i {
  color: white;
  font-size: 1.5rem;
}

@keyframes successPulse {
  from {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  to {
    transform: scale(1);
  }
}

.modal-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-content p {
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .auth-card {
    padding: 1.5rem;
  }
  
  .card-header h1 {
    font-size: 1.75rem;
  }
  
  .social-login {
    flex-direction: column;
  }
  
  .form-options {
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1rem;
  }
  
  .card-header h1 {
    font-size: 1.5rem;
  }
  
  .logo {
    width: 50px;
    height: 50px;
  }
  
  .logo i {
    font-size: 1.25rem;
  }
}

/* ---------- Notifications (toasts coin supérieur droit) ---------- */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(100% - 40px);
  max-width: 360px;
  pointer-events: none;
}

.notification {
  display: none;
  position: relative;
  background: var(--bg-primary);
  border-left: 4px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px 34px 14px 16px;
  pointer-events: auto;
  animation: notifSlideIn 0.3s ease-out;
}

.notification.success { border-left-color: var(--success-color); }
.notification.error { border-left-color: var(--error-color); }
.notification.warning { border-left-color: var(--warning-color); }
.notification.info { border-left-color: var(--primary-color); }

.notification strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.notification div:last-child {
  color: var(--text-secondary);
  font-size: 0.83rem;
  line-height: 1.4;
}

.notification .close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 2px;
}

.notification .close-btn:hover { color: var(--text-primary); }

.notification.slide-out {
  animation: notifSlideOut 0.3s ease-in forwards;
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes notifSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ---------- Bandeau de notification pleine largeur ---------- */
#top-notification {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 12px 20px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  z-index: 3100;
  box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
  #notification-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }
}