/* ========================================
   PAGES AUTHENTIFICATION
======================================== */

.page-auth {
  min-height: calc(100vh - 200px);
  padding: 60px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container principal */
.auth-container {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

/* ========================================
   CARTE FORMULAIRE
======================================== */

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 2rem;
  color: #1a1d23;
  margin-bottom: 8px;
}

.auth-header p {
  color: #666;
  font-size: 1rem;
}

/* ========================================
   FORMULAIRE
======================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.required {
  color: #e74c3c;
  margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s;
  background: white;
}

.form-group input:focus {
  outline: none;
  border-color: #2A9D8F;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

.form-group small {
  font-size: 0.85rem;
  color: #666;
}

/* Form Row (2 colonnes) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========================================
   AVATAR
======================================== */
/* ========================================
   UPLOAD AVATAR
======================================== */

.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.avatar-upload__preview {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.3s;
}

.avatar-upload__preview:hover {
  border-color: #2A9D8F;
}

.avatar-upload__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(42, 157, 143, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s;
  color: white;
}

.avatar-upload__preview:hover .avatar-upload__overlay {
  opacity: 1;
}

.avatar-upload__overlay i {
  font-size: 1.8rem;
}

.avatar-upload__overlay span {
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-avatar-change {
  padding: 10px 20px;
  background: #f0f0f0;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-avatar-change:hover {
  background: white;
  border-color: #2A9D8F;
  color: #2A9D8F;
}

/* Dark mode */
body.dark-mode .avatar-upload__preview {
  border-color: #3a3f4a;
}

body.dark-mode .btn-avatar-change {
  background: #2d3139;
  border-color: #3a3f4a;
  color: #e0e0e0;
}

body.dark-mode .btn-avatar-change:hover {
  background: #3a3f4a;
  border-color: #2A9D8F;
}

/* Vérification pseudo */
.pseudo-check {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
}

.pseudo-check.available {
  color: #27ae60;
  display: block;
}

.pseudo-check.unavailable {
  color: #e74c3c;
  display: block;
}

/* Dark mode */
body.dark-mode .pseudo-check.available {
  color: #2ecc71;
}

body.dark-mode .pseudo-check.unavailable {
  color: #e74c3c;
}
/* ========================================
   TOGGLE TYPE DE COMPTE
======================================== */

.account-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-option {
  position: relative;
  cursor: pointer;
}

.toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #f8f9fa;
  transition: all 0.3s;
  font-weight: 600;
  color: #666;
}

.toggle-btn i {
  font-size: 1.8rem;
  color: #999;
  transition: color 0.3s;
}

.toggle-option input:checked + .toggle-btn {
  border-color: #2A9D8F;
  background: rgba(42, 157, 143, 0.05);
  color: #2A9D8F;
}

.toggle-option input:checked + .toggle-btn i {
  color: #2A9D8F;
}

.toggle-option:hover .toggle-btn {
  border-color: #2A9D8F;
  transform: translateY(-2px);
}

/* ========================================
   MOT DE PASSE
======================================== */

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s;
}

.toggle-password:hover {
  background: #f0f0f0;
  color: #2A9D8F;
}

/* Force du mot de passe */
.password-strength {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  background: #e74c3c;
  transition: all 0.3s;
  border-radius: 2px;
}

.password-strength-bar.weak {
  width: 33%;
  background: #e74c3c;
}

.password-strength-bar.medium {
  width: 66%;
  background: #f39c12;
}

.password-strength-bar.strong {
  width: 100%;
  background: #27ae60;
}

/* ========================================
   CHECKBOX & CGU
======================================== */

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label a {
  color: #2A9D8F;
  text-decoration: underline;
}

.checkbox-label a:hover {
  color: #1E8079;
}

/* ========================================
   BOUTONS
======================================== */

.btn-auth {
  width: 100%;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-decoration: none;
}

.btn-auth--primary {
  background: #2A9D8F;
  color: white;
}

.btn-auth--primary:hover {
  background: #1E8079;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 157, 143, 0.3);
}

.btn-auth--secondary {
  background: white;
  color: #333;
  border: 2px solid #e0e0e0;
}

.btn-auth--secondary:hover {
  border-color: #2A9D8F;
  color: #2A9D8F;
}

.btn-auth i {
  font-size: 1.1rem;
}

/* Boutons sociaux */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.social-login__title {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.btn-google {
  background: white;
  color: #333;
  border: 2px solid #e0e0e0;
}

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

.btn-facebook {
  background: #1877F2;
  color: white;
}

.btn-facebook:hover {
  background: #145dbf;
}

/* ========================================
   FOOTER FORMULAIRE
======================================== */

.auth-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.auth-footer p {
  color: #666;
  font-size: 0.95rem;
}

.auth-footer a {
  color: #2A9D8F;
  font-weight: 600;
  text-decoration: none;
}

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

/* ========================================
   SIDEBAR BÉNÉFICES
======================================== */

.auth-side {
  position: sticky;
  top: 20px;
}

.auth-benefits {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-benefits h3 {
  font-size: 1.3rem;
  color: #1a1d23;
  margin-bottom: 24px;
}

.auth-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-benefits li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.auth-benefits li i {
  font-size: 1.5rem;
  color: #2A9D8F;
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-benefits li div {
  flex: 1;
}

.auth-benefits strong {
  display: block;
  color: #1a1d23;
  font-size: 1rem;
  margin-bottom: 4px;
}

.auth-benefits p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* ========================================
   MESSAGES D'ERREUR/SUCCÈS
======================================== */

.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.alert i {
  font-size: 1.2rem;
}

.alert--error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.alert--success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

.alert--warning {
  background: #ffe;
  color: #c93;
  border: 1px solid #ffc;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1024px) {
  .auth-container {
    grid-template-columns: 1fr 300px;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .page-auth {
    padding: 40px 15px;
  }

  .auth-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .auth-card {
    padding: 30px 24px;
  }

  .auth-header h1 {
    font-size: 1.6rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .account-type-toggle {
    grid-template-columns: 1fr;
  }

  .auth-side {
    position: static;
  }

  .auth-benefits {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
  }

  .auth-header h1 {
    font-size: 1.4rem;
  }

  .toggle-btn {
    padding: 16px;
    font-size: 0.9rem;
  }

  .toggle-btn i {
    font-size: 1.5rem;
  }

  .btn-auth {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}

/* ========================================
   DARK MODE
======================================== */

body.dark-mode .page-auth {
  background: linear-gradient(135deg, #0f1115 0%, #1a1d23 100%);
}

body.dark-mode .auth-card,
body.dark-mode .auth-benefits {
  background: #1a1d23;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .auth-header h1,
body.dark-mode .auth-benefits h3,
body.dark-mode .auth-benefits strong {
  color: #e0e0e0;
}

body.dark-mode .auth-header p,
body.dark-mode .auth-benefits p,
body.dark-mode .auth-footer p {
  color: #b0b0b0;
}

body.dark-mode .form-group label {
  color: #e0e0e0;
}

body.dark-mode .form-group input {
  background: #2d3139;
  border-color: #3a3f4a;
  color: #e0e0e0;
}

body.dark-mode .form-group input:focus {
  border-color: #2A9D8F;
  background: #2d3139;
}

body.dark-mode .toggle-btn {
  background: #2d3139;
  border-color: #3a3f4a;
  color: #b0b0b0;
}

body.dark-mode .toggle-option input:checked + .toggle-btn {
  background: rgba(42, 157, 143, 0.15);
}

body.dark-mode .toggle-password:hover {
  background: #3a3f4a;
}

body.dark-mode .password-strength {
  background: #2d3139;
}

body.dark-mode .btn-auth--secondary {
  background: #2d3139;
  border-color: #3a3f4a;
  color: #e0e0e0;
}

body.dark-mode .btn-auth--secondary:hover {
  border-color: #2A9D8F;
  background: #2d3139;
}

body.dark-mode .social-login,
body.dark-mode .auth-footer {
  border-top-color: #2d3139;
}


/* Container centré pour connexion */
.auth-container--centered {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
}

.auth-card--login {
    width: 100%;
}

/* Row entre checkbox et lien */
.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.link-forgot {
    color: #2A9D8F;
    text-decoration: none;
    font-weight: 500;
}

.link-forgot:hover {
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    position: relative;
    background: white;
    padding: 0 16px;
    color: #999;
    font-size: 0.9rem;
}

/* Boutons sociaux */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-auth--google {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-auth--google:not(:disabled):hover {
    border-color: #DB4437;
    background: #DB4437;
    color: white;
}

.btn-auth--facebook {
    background: white;
    color: #1877F2;
    border: 2px solid #e0e0e0;
}

.btn-auth--facebook:not(:disabled):hover {
    background: #1877F2;
    border-color: #1877F2;
    color: white;
}

.btn-auth:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dark mode */
body.dark-mode .auth-divider::before {
    background: #2d3139;
}

body.dark-mode .auth-divider span {
    background: #1a1d23;
}

body.dark-mode .btn-auth--google,
body.dark-mode .btn-auth--facebook {
    background: #2d3139;
    border-color: #3a3f4a;
}


/* Icône d'en-tête */
.auth-icon {
    width: 80px;
    height: 80px;
    background: rgba(42, 157, 143, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.auth-icon i {
    font-size: 2.5rem;
    color: #2A9D8F;
}

/* Lien retour */
.link-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.link-back:hover {
    color: #2A9D8F;
    gap: 12px;
}


