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

:root {
  --primary-color: #FF0000;
  --primary-hover: #CC0000;
  --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.96);
  --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: 20px;
  --border-radius-sm: 12px;
  --transition: all 0.2s ease-out;
  --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:
    linear-gradient(135deg,
      rgba(30, 60, 114, 0.45) 0%,
      rgba(42, 82, 152, 0.4) 25%,
      rgba(59, 130, 246, 0.32) 50%,
      rgba(29, 78, 216, 0.4) 75%,
      rgba(30, 64, 175, 0.45) 100%),
    url('../img/garde/bg1.webp') no-repeat;
  background-size: cover, cover;
  background-position: center, bottom center;
  z-index: -2;
}

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

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 360px;
  padding: 2rem 2rem 1.25rem;
  animation: fadeIn 0.35s ease-out;
  position: relative;
}

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

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

.logo {
  width: 178px;
  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.3rem;
} */

.card-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

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

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

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.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);
  pointer-events: none;
}

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

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

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

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

.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-input input {
  padding-right: 2.6rem;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.3rem;
  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.78rem;
  margin-top: 0.3rem;
  opacity: 0;
  transform: translateY(-6px);
  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.25rem;
  font-size: 0.85rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  color: var(--text-secondary);
}

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

.checkmark {
  height: 17px;
  width: 17px;
  background-color: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  margin-right: 0.5rem;
  transition: var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 1px;
  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;
  font-weight: 500;
  transition: var(--transition-fast);
}

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

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

.submit-btn:hover {
  background: var(--primary-hover);
}

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

.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;
}

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

.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);
}

/* Notifications (toast coin supérieur droit + bandeau haut de page) */
#notification-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  width: calc(100% - 3rem);
}

.notification {
  display: none;
  position: relative;
  background: var(--bg-primary);
  color: var(--text-primary);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.9rem 2.5rem 0.9rem 1rem;
  font-size: 0.9rem;
  animation: notifSlideIn 0.3s ease-out;
}

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

.notification strong {
  display: block;
  margin-bottom: 0.15rem;
}

.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 .close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.15rem;
}

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

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

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

#top-notification {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  color: white;
  text-align: center;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 1900;
  box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem 1rem;
  }

  .card-header h1 {
    font-size: 1.35rem;
  }

  .form-options {
    font-size: 0.78rem;
  }
}
