/**
 * auth-modern.css — Styles modernes pour les pages d'authentification Jobwav (Login & Register)
 * Architecture Split-Screen 2 colonnes adaptative avec support Thème Clair & Sombre.
 * 
 * Palette Officielle Jobwav :
 * - Marine Sombre (Structure) : #09232B, #0B2A34, #06171D
 * - Or Jobwav (Accents & Actions) : #FEC11A, #E0AA14, #FFD24D
 * 
 * Encodage : UTF-8 sans BOM
 */

/* ==========================================================================
   1. VARIABLES DE THÈME (Clair / Sombre)
   ========================================================================== */
:root {
  /* Mode Clair par défaut */
  --auth-bg-body: #f8fafc;
  --auth-bg-card: #ffffff;
  --auth-bg-sidebar: linear-gradient(135deg, #09232b 0%, #0d3440 50%, #06171d 100%);
  --auth-border: #e2e8f0;
  --auth-text-title: #09232b;
  --auth-text-body: #334155;
  --auth-text-muted: #64748b;
  --auth-input-bg: #ffffff;
  --auth-input-border: #cbd5e1;
  --auth-input-focus-border: #fec11a;
  --auth-input-focus-ring: rgba(254, 193, 26, 0.25);
  --auth-brand-gold: #fec11a;
  --auth-brand-gold-hover: #e0aa14;
  --auth-brand-navy: #09232b;
  --auth-glass-bg: rgba(255, 255, 255, 0.88);
  --auth-glass-border: rgba(226, 232, 240, 0.9);
  --auth-badge-bg: rgba(255, 255, 255, 0.12);
  --auth-badge-border: rgba(255, 255, 255, 0.2);
}

html.dark {
  /* Mode Sombre */
  --auth-bg-body: #061217;
  --auth-bg-card: #0a1f26;
  --auth-bg-sidebar: linear-gradient(135deg, #051014 0%, #09232b 50%, #040c0f 100%);
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-text-title: #ffffff;
  --auth-text-body: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-input-bg: rgba(7, 22, 28, 0.85);
  --auth-input-border: rgba(255, 255, 255, 0.12);
  --auth-input-focus-border: #fec11a;
  --auth-input-focus-ring: rgba(254, 193, 26, 0.3);
  --auth-brand-gold: #fec11a;
  --auth-brand-gold-hover: #ffd24d;
  --auth-brand-navy: #09232b;
  --auth-glass-bg: rgba(11, 32, 39, 0.75);
  --auth-glass-border: rgba(255, 255, 255, 0.09);
  --auth-badge-bg: rgba(255, 255, 255, 0.05);
  --auth-badge-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   2. STRUCTURE GÉNÉRALE SPLIT-SCREEN
   ========================================================================== */
body.auth-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--auth-bg-body);
  color: var(--auth-text-body);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.auth-split-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* ==========================================================================
   3. COLONNE GAUCHE (BRANDING & SHOWCASE)
   ========================================================================== */
.auth-brand-col {
  display: none; /* Masquée sur mobile par défaut */
  width: 50%;
  position: relative;
  background: var(--auth-bg-sidebar);
  color: #ffffff;
  padding: 3.5rem 3.5rem;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: background 0.3s ease;
}

@media (min-width: 992px) {
  .auth-brand-col {
    display: flex; /* Visible dès lg */
  }
}

/* Grille d'arrière-plan tech subtile */
.auth-tech-grid {
  position: absolute;
  inset: 0;
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  pointer-events: none;
  z-index: 1;
}

/* Halos lumineux doux (Or Jobwav et Pétrole) */
.auth-glow-gold {
  position: absolute;
  top: 20%;
  left: 15%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(254, 193, 26, 0.15) 0%, rgba(254, 193, 26, 0) 70%);
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  filter: blur(20px);
}

.auth-glow-navy {
  position: absolute;
  bottom: 10%;
  right: 10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(22, 64, 77, 0.5) 0%, rgba(22, 64, 77, 0) 70%);
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  filter: blur(25px);
}

.auth-brand-content {
  position: relative;
  z-index: 2;
}

/* Tag pill officiel */
.auth-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(254, 193, 26, 0.12);
  border: 1px solid rgba(254, 193, 26, 0.28);
  color: #ffd24d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.auth-brand-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fec11a;
  box-shadow: 0 0 10px #fec11a;
  animation: authPulse 2s infinite;
}

@keyframes authPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.auth-brand-heading {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.auth-gold-gradient-text {
  background: linear-gradient(135deg, #fec11a 0%, #ffd973 50%, #fec11a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
  max-width: 520px;
}

/* ==========================================================================
   CARROUSEL CONTINU DES DRAPEAUX AFRICAINS (DESKTOP & LAPTOP UNIQUEMENT)
   ========================================================================== */
.auth-countries-marquee-wrapper {
  position: relative;
  z-index: 2;
  margin: 1.75rem 0 1.25rem 0;
  display: none; /* Masqué sur mobiles et tablettes */
}

@media (min-width: 992px) {
  .auth-countries-marquee-wrapper {
    display: block; /* Visible uniquement sur desktop & laptop */
  }
}

.auth-countries-marquee-box {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 0.85rem 0.5rem;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.auth-countries-marquee-box:hover .auth-countries-track {
  animation-play-state: paused;
}

.auth-countries-track {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: max-content;
  animation: authMarqueeScroll 26s linear infinite;
  will-change: transform;
}

@keyframes authMarqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Vignette individuelle de drapeau (visuel pur, aucun texte) */
.auth-flag-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.auth-flag-item:hover {
  transform: translateY(-3px) scale(1.15);
}

/* Image de drapeau haute fidélité avec coins arrondis et bordure subtile */
.auth-flag-img {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: block;
  transition: all 0.25s ease;
}

.auth-flag-item:hover .auth-flag-img {
  border-color: #fec11a;
  box-shadow: 0 6px 16px rgba(254, 193, 26, 0.4);
}

/* ==========================================================================
   DEUXIÈME LIGNE : CARROUSEL LOGOS SERVICES MOBILE MONEY
   ========================================================================== */
.auth-payments-track {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: max-content;
  animation: authMarqueeScrollReverse 24s linear infinite;
  will-change: transform;
}

@keyframes authMarqueeScrollReverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.auth-countries-marquee-box:hover .auth-payments-track {
  animation-play-state: paused;
}

/* Capsule de logo Mobile Money (fond blanc pur, logo centré net) */
.auth-payment-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 34px;
  background: #ffffff;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  padding: 3px 6px;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-sizing: border-box;
}

.auth-payment-item:hover {
  transform: translateY(-3px) scale(1.15);
  border-color: #fec11a;
  box-shadow: 0 6px 16px rgba(254, 193, 26, 0.45);
}

.auth-payment-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.auth-country-badge-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffd24d;
  font-weight: 700;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Badges de réassurance glassmorphism */
.auth-badges-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-badge-card {
  background: var(--auth-badge-bg);
  border: 1px solid var(--auth-badge-border);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 1.1rem;
  transition: all 0.25s ease;
}

.auth-badge-card:hover {
  border-color: rgba(254, 193, 26, 0.4);
  transform: translateY(-2px);
}

.auth-badge-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.auth-badge-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffd24d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.auth-badge-sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.3rem;
  line-height: 1.35;
}

/* ==========================================================================
   4. COLONNE DROITE (FORMULAIRE RESPIRANT)
   ========================================================================== */
.auth-form-col {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.25rem;
  position: relative;
  background-color: var(--auth-bg-card);
  transition: background-color 0.3s ease;
}

@media (min-width: 992px) {
  .auth-form-col {
    width: 50%;
    padding: 3rem 4rem;
  }
}

/* Barre d'outils supérieure droite (Thème & Accueil) */
.auth-topbar {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 20;
}

@media (min-width: 768px) {
  .auth-topbar {
    top: 2rem;
    right: 2.5rem;
  }
}

.auth-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: var(--auth-bg-body);
  border: 1px solid var(--auth-border);
  color: var(--auth-text-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-icon-btn:hover {
  color: var(--auth-text-title);
  border-color: rgba(254, 193, 26, 0.5);
  transform: translateY(-1px);
}

/* Conteneur de formulaire centré */
.auth-form-container {
  width: 100%;
  max-width: 460px;
  margin: auto;
  position: relative;
  z-index: 10;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

/* Header de la zone formulaire */
.auth-form-header {
  margin-bottom: 1.75rem;
  text-align: left;
}

.auth-form-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--auth-text-title);
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-form-subtitle {
  font-size: 0.9rem;
  color: var(--auth-text-muted);
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Champs adaptatifs modernes */
.auth-field-group {
  margin-bottom: 1.2rem;
  position: relative;
}

.auth-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--auth-text-title);
  margin-bottom: 0.45rem;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--auth-text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input {
  width: 100%;
  padding: 0.82rem 1rem 0.82rem 2.65rem;
  font-size: 0.92rem;
  color: var(--auth-text-title);
  background-color: var(--auth-input-bg);
  border: 1.5px solid var(--auth-input-border);
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--auth-input-focus-border);
  box-shadow: 0 0 0 3px var(--auth-input-focus-ring);
}

.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--auth-brand-gold);
}

.auth-input-no-icon {
  padding-left: 1rem !important;
}

/* Toggle afficher/masquer mot de passe */
.auth-toggle-pass {
  position: absolute;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--auth-text-muted);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-toggle-pass:hover {
  color: var(--auth-text-title);
}

/* Bouton d'action principal Jobwav Or */
.auth-btn-action {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, #fec11a 0%, #e0aa14 100%);
  color: #09232b;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(254, 193, 26, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.auth-btn-action:hover {
  background: linear-gradient(135deg, #ffd24d 0%, #fec11a 100%);
  box-shadow: 0 6px 20px rgba(254, 193, 26, 0.45);
  transform: translateY(-1px);
  color: #06171d;
}

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

/* Séparateur élégant "OU" */
.auth-separator {
  position: relative;
  margin: 1.5rem 0;
  text-align: center;
}

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

.auth-separator-text {
  position: relative;
  padding: 0 0.85rem;
  background-color: var(--auth-bg-card);
  color: var(--auth-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background-color 0.3s ease;
}

/* Boutons de connexion sociale (Google / Facebook) */
.auth-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  background: var(--auth-bg-body);
  border: 1px solid var(--auth-border);
  color: var(--auth-text-title);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.auth-social-btn:hover {
  border-color: rgba(254, 193, 26, 0.5);
  background-color: var(--auth-bg-card);
  transform: translateY(-1px);
  color: var(--auth-text-title);
}

.auth-social-btn-facebook {
  background-color: #1877f2;
  border-color: #1877f2;
  color: #ffffff !important;
}

.auth-social-btn-facebook:hover {
  background-color: #166fe5;
  border-color: #166fe5;
  color: #ffffff !important;
}

/* Bloc WhatsApp OTP stylisé */
.auth-wa-box {
  background: rgba(37, 211, 102, 0.06);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 14px;
  padding: 1rem;
  margin-top: 1.25rem;
  transition: all 0.2s ease;
}

html.dark .auth-wa-box {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.2);
}

.auth-wa-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1ea952;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

html.dark .auth-wa-title {
  color: #25d366;
}

.auth-wa-btn {
  background: #25d366;
  color: #ffffff;
  border: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-wa-btn:hover {
  background: #20ba5a;
  color: #ffffff;
}

/* Sélecteur de rôle interactif (Client vs Freelance) */
.auth-role-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 4px;
  background: var(--auth-bg-body);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  margin-bottom: 1.25rem;
}

.auth-role-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 0.5rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--auth-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-role-btn.active {
  background: var(--auth-brand-navy);
  color: #fec11a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

html.dark .auth-role-btn.active {
  background: #fec11a;
  color: #09232b;
}

/* Alertes & Toasts */
.auth-alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.auth-alert-danger {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

html.dark .auth-alert-danger {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.4);
  color: #f87171;
}

.auth-alert-success {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: #16a34a;
}

html.dark .auth-alert-success {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(22, 163, 74, 0.4);
  color: #4ade80;
}

/* Liens auxiliaires */
.auth-footer-link {
  color: var(--auth-brand-navy);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-footer-link:hover {
  color: #d89e09;
  text-decoration: underline;
}

html.dark .auth-footer-link {
  color: #fec11a;
}

html.dark .auth-footer-link:hover {
  color: #ffd24d;
}

/* Mobile responsive ajustements */
@media (max-width: 991px) {
  .auth-form-container {
    padding-top: 1.5rem;
  }
  .auth-form-title {
    font-size: 1.6rem;
  }
  .auth-social-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .auth-responsive-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .auth-form-col {
    padding: 1.5rem 1rem;
  }
  .auth-topbar {
    top: 1rem;
    right: 1rem;
  }
}
