/* ========================================
   AUTH MODAL - CLEAN PREMIUM 2025
   ======================================== */

:root {
  --auth-primary: #6B5BFF;
  --auth-primary-dark: #5548d6;
  --auth-success: #34C759;
  --auth-bg: #F5F5F7;
  --auth-card: #FFFFFF;
  --auth-text: #1a1a2e;
  --auth-text-secondary: #86868b;
}

/* ========================================
   BOUTON COMPTE NAVBAR
   ======================================== */
.nav-account-btn {
  position: relative;
  height: 40px;
  padding: 0 16px;
  border-radius: 50px;
  background: transparent;
  border: 2px solid var(--auth-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--auth-primary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-left: 8px;
  margin-right: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-account-btn .nav-account-icon {
  font-size: 0.95rem;
}

.nav-account-btn .nav-account-text {
  font-family: inherit;
}

.nav-account-btn:hover {
  background: var(--auth-primary);
  color: white;
  transform: scale(1.02);
}

/* État connecté */
.nav-account-btn.logged-in {
  background: var(--auth-success);
  border-color: var(--auth-success);
  color: white;
  padding: 0 14px;
}

.nav-account-btn.logged-in .nav-account-text {
  display: none;
}

.nav-account-btn.logged-in:hover {
  background: #2fb87f;
  border-color: #2fb87f;
}

/* ========================================
   BOUTON COMPTE MOBILE
   ======================================== */
.mobile-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #F5F5F7;
  color: var(--auth-primary);
  padding: 16px 24px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
  position: relative;
}

.mobile-account-btn:active {
  transform: scale(0.98);
  background: #EBEBED;
}

.mobile-account-btn.logged-in {
  background: rgba(52, 199, 89, 0.1);
  color: var(--auth-success);
}

.mobile-account-dot {
  position: absolute;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--auth-success);
  display: none;
}

.mobile-account-btn.logged-in .mobile-account-dot {
  display: block;
}

/* ========================================
   OVERLAY
   ======================================== */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   MODAL
   ======================================== */
.auth-modal {
  position: fixed;
  background: var(--auth-card);
  display: flex;
  flex-direction: column;
  z-index: 10002;
  overflow: hidden;
}

/* Split screen structure */
.auth-modal-split {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.auth-modal-left {
  display: none; /* Cache sur mobile */
}

.auth-modal-right {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.auth-modal-handle {
  width: 36px;
  height: 5px;
  background: #D1D1D6;
  border-radius: 100px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F5F5F7;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  z-index: 10;
}

.auth-modal-close:hover {
  background: #EBEBED;
  color: var(--auth-text);
}


/* ========================================
   HEADER
   ======================================== */
.auth-header {
  text-align: center;
  padding: 28px 24px 20px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-bottom: 6px;
}

.auth-logo-le {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--auth-primary);
  letter-spacing: -0.5px;
}

.auth-logo-palet {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--auth-text);
  letter-spacing: -0.5px;
  margin-left: 4px;
}

.auth-subtitle {
  color: var(--auth-text-secondary);
  font-size: 0.95rem;
}

/* ========================================
   ONGLETS - GLASS EFFECT ICI
   ======================================== */
.auth-tabs {
  display: flex;
  margin: 0 24px 24px;
  padding: 4px;
  background: rgba(118, 118, 128, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--auth-text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-tab.active {
  color: var(--auth-text);
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   FORMULAIRES
   ======================================== */
.auth-form {
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--auth-text);
  padding-left: 4px;
}

.auth-form-group input {
  padding: 16px 18px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  transition: all 0.25s ease;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-weight: 500;
}

.auth-form-group input:focus {
  outline: none;
  background: #EBEBED;
  box-shadow: 0 0 0 3px rgba(107, 91, 255, 0.15);
}

.auth-form-group input::placeholder {
  color: var(--auth-text-secondary);
  font-weight: 400;
}

/* Options supplémentaires (Se souvenir de moi) */
.auth-form-options {
  display: flex;
  align-items: center;
  margin-top: -6px;
  margin-bottom: 4px;
}

.auth-remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--auth-text-secondary);
  cursor: pointer;
  user-select: none;
  padding-left: 4px;
}

.auth-remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  accent-color: #6B5BFF;
  cursor: pointer;
}

/* Divider pour l'authentification tierce (ex: Google) */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 6px;
  color: var(--auth-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  width: 100%;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-divider:not(:empty)::before {
  margin-right: 12px;
}

.auth-divider:not(:empty)::after {
  margin-left: 12px;
}

/* ========================================
   BOUTON SUBMIT
   ======================================== */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--auth-primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  background: var(--auth-primary-dark);
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-submit-btn i {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.auth-submit-btn:hover i {
  transform: translateX(3px);
}

/* ========================================
   MESSAGES
   ======================================== */
.auth-message {
  margin: 0 24px 16px;
  padding: 14px 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.auth-message.error {
  display: block;
  background: #FFF2F2;
  color: #FF3B30;
}

.auth-message.success {
  display: block;
  background: #E8F9EE;
  color: var(--auth-success);
}


/* ========================================
   DROPDOWN COMPTE - STYLE PREMIUM
   ======================================== */
.account-dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10002;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.account-dropdown-overlay.active {
  opacity: 1;
  visibility: visible;
}

.account-dropdown {
  position: fixed;
  background: white;
  z-index: 10003;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.account-dropdown.active {
  opacity: 1;
  visibility: visible;
}

.account-dropdown-handle {
  display: none;
}

.account-dropdown-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F5F5F7;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.account-dropdown-close:hover {
  background: #EBEBED;
  color: var(--auth-text);
}

/* Header avec avatar */
.account-dropdown-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 16px;
  text-align: center;
}

.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--auth-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 12px;
}

.account-email {
  color: var(--auth-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-all;
}

.account-dropdown-divider {
  height: 1px;
  background: #E5E5EA;
  margin: 0 16px;
}

/* Menu items */
.account-dropdown-menu {
  padding: 12px;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--auth-text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: #F5F5F7;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
}

.account-dropdown-item:last-child {
  margin-bottom: 0;
}

.account-dropdown-item:hover {
  background: #EBEBED;
}

.account-dropdown-item:active {
  transform: scale(0.98);
}

.account-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.account-item-icon.admin-icon {
  background: rgba(255, 149, 0, 0.15);
  color: #FF9500;
}

.account-item-icon.organizer-icon {
  background: rgba(107, 91, 255, 0.15);
  color: #6B5BFF;
}

.account-item-icon.logout-icon {
  background: rgba(255, 59, 48, 0.12);
  color: #FF3B30;
}

.account-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--auth-text);
}

.account-item-desc {
  font-size: 0.8rem;
  color: var(--auth-text-secondary);
  font-weight: 400;
}

.account-dropdown-item.admin-only {
  display: none;
}

.account-dropdown-item.admin-only.visible {
  display: flex;
}

/* ========================================
   MOBILE - SHEET 60% HAUTEUR
   ======================================== */
@media (max-width: 768px) {
  .auth-modal-overlay {
    display: flex;
    align-items: flex-end;
  }
  
  .auth-modal {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    overflow-y: auto;
  }
  
  .auth-modal-overlay.active .auth-modal {
    transform: translateY(0);
  }
  
  .auth-modal-handle {
    display: block;
  }
  
  .auth-header {
    padding: 20px 24px 16px;
  }
  
  .auth-logo-le,
  .auth-logo-palet {
    font-size: 1.5rem;
  }
  
  .auth-tabs {
    margin-bottom: 20px;
  }
  
  .auth-form {
    gap: 14px;
    padding-bottom: 24px;
  }
  
  .auth-form-group input {
    padding: 14px 16px;
  }
  
  .auth-submit-btn {
    padding: 14px 24px;
  }
  
  .nav-account-btn {
    display: none;
  }
  
  /* Dropdown mobile - Sheet du bas 60% */
  .account-dropdown {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 60vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
  }
  
  .account-dropdown.active {
    transform: translateY(0);
  }
  
  .account-dropdown-handle {
    display: block;
    width: 36px;
    height: 5px;
    background: #D1D1D6;
    border-radius: 100px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  
  .account-dropdown-close {
    display: none;
  }
  
  .account-dropdown-header {
    padding: 24px 20px 20px;
    flex-shrink: 0;
  }
  
  .account-avatar {
    width: 70px;
    height: 70px;
    font-size: 1.6rem;
    margin-bottom: 12px;
  }
  
  .account-email {
    font-size: 1rem;
  }
  
  .account-dropdown-divider {
    flex-shrink: 0;
  }
  
  .account-dropdown-menu {
    padding: 16px 20px 24px;
    flex: 1;
    overflow-y: auto;
  }
  
  .account-dropdown-item {
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 12px;
  }
  
  .account-item-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 1.15rem;
  }
  
  .account-item-title {
    font-size: 1.05rem;
  }
  
  .account-item-desc {
    font-size: 0.85rem;
  }
}

/* ========================================
   DESKTOP - MODAL CENTRÉE
   ======================================== */
@media (min-width: 769px) {
  .auth-modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .auth-modal {
    position: relative;
    max-width: 820px;
    width: 90%;
    border-radius: 24px;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
  }
  
  .auth-modal-overlay.active .auth-modal {
    transform: scale(1);
    opacity: 1;
  }
  
  .auth-modal-handle {
    display: none;
  }
  
  .auth-modal-split {
    flex-direction: row;
  }
  
  .auth-modal-left {
    display: flex;
    flex-direction: column;
    flex: 1.1;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    color: white;
    padding: 40px;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }
  
  .auth-modal-left::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
  }
  
  .auth-left-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: white;
    border-radius: 50px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(107, 91, 255, 0.1);
    align-self: flex-start;
    flex-shrink: 0;
  }
  
  .badge-logo-le {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--auth-primary);
    letter-spacing: -0.5px;
  }

  .badge-logo-palet {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--auth-text);
    letter-spacing: -0.5px;
    margin-left: 4px;
  }
  
  .auth-left-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.35;
    letter-spacing: -0.5px;
  }
  
  .auth-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .auth-features-list li {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px 24px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.22, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  
  .auth-features-list li:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 25px rgba(255, 255, 255, 0.1);
  }
  
  .feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.22, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  }
  
  .auth-features-list li:hover .feature-icon {
    background: white;
    color: var(--auth-primary);
    transform: scale(1.1) rotate(6deg);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.25);
  }
  
  .feature-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .feature-text strong {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.2px;
  }
  
  .feature-text span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.45;
    transition: all 0.3s ease;
  }
  
  .auth-features-list li:hover .feature-text span {
    color: rgba(255, 255, 255, 0.95);
  }
  
  .auth-modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 24px;
  }
  
  .auth-modal-right .auth-header {
    display: none;
  }
  
  .mobile-account-btn {
    display: none;
  }
  
  /* Dropdown desktop - Centré avec overlay */
  .account-dropdown-overlay {
    display: block;
  }
  
  .account-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 380px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    opacity: 0;
  }
  
  .account-dropdown.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  .account-dropdown-handle {
    display: none;
  }
  
  .account-dropdown-close {
    display: flex;
  }
  
  .account-dropdown-header {
    padding: 28px 24px 20px;
  }
  
  .account-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.7rem;
    margin-bottom: 14px;
  }
  
  .account-email {
    font-size: 1rem;
  }
  
  .account-dropdown-menu {
    padding: 14px 18px 20px;
  }
  
  .account-dropdown-item {
    padding: 16px 18px;
    margin-bottom: 10px;
  }
  
  .account-item-icon {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }
  
  .account-item-title {
    font-size: 1rem;
  }
  
  .account-item-desc {
    font-size: 0.85rem;
  }
}
