/* ==========================================================================
   PREPAI AUTH SYSTEM - CLEAN LUXURY & AFRICAN WHATSAPP INTEGRATION
   ========================================================================== */

body.auth-page {
  background-color: #f8fafc !important;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(124, 58, 237, 0.05) 0%, transparent 50%) !important;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* Ancien shell sombre : neutralisé si encore présent */
body.auth-page .auth-wrap {
  background: transparent;
  min-height: auto;
  padding: 0;
  width: 100%;
  max-width: 440px;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- LOGO DE L'EN-TÊTE AUTH --- */
.auth-header-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.auth-logo {
  font-size: 1.75rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.auth-logo .brand-dark { color: #0f172a; }
.auth-logo .brand-grad {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* --- CARTE DU FORMULAIRE AUTH --- */
.auth-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.02);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.auth-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0;
}

/* --- BOUTON GOOGLE OAUTH --- */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 46px;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-google-auth:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.google-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* SÉPARATEUR "OU AVEC VOTRE E-MAIL" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #94a3b8;
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* --- FORMULAIRES & INPUTS HAUT DE GAMME --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-field-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 1rem;
  margin-top: 0;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

/* Gagne sur app.css (.auth-card input) */
.auth-card .auth-input,
.auth-card input.auth-input,
.auth-card select.country-selector-btn {
  width: 100%;
  height: 46px;
  margin-top: 0;
  padding: 0 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9375rem;
  box-sizing: border-box;
}

.auth-card select.country-selector-btn {
  width: auto;
  max-width: 42%;
  padding: 0 0.75rem;
  background: #f8fafc;
  border: none;
  border-right: 1.5px solid #e2e8f0;
  border-radius: 0;
}

.auth-card .whatsapp-input {
  width: 100%;
  height: 46px;
  margin-top: 0;
  padding: 0 0.85rem;
  border: none;
  border-radius: 0;
  background: transparent;
}

.auth-card .auth-field-group > label {
  display: flex;
  margin-bottom: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.auth-input-wrapper .auth-input {
  padding-right: 2.75rem;
}

.auth-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* TOGGLE AFFICHER/MASQUER LE MOT DE PASSE */
.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover { color: #475569; }

/* --- CHAMP TÉLÉPHONE WHATSAPP AVEC INDICATIF AFRICAIN --- */
.phone-field-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: all 0.15s ease;
}

.phone-field-wrapper:focus-within {
  border-color: #10b981; /* Vert WhatsApp */
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.country-selector-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  height: 46px;
  max-width: 42%;
  background: #f8fafc;
  border: none;
  border-right: 1.5px solid #e2e8f0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.whatsapp-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: none;
  padding: 0 0.85rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #0f172a;
  background: transparent;
}

.whatsapp-input:focus { outline: none; }

.whatsapp-badge-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #059669;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* --- OPTIONS : REMEMBER ME & MOT DE PASSE OUBLIÉ --- */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  accent-color: #4f46e5;
  width: 16px;
  height: 16px;
}

.auth-forgot-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}

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

/* BOUTON SOUMISSION */
.btn-auth-submit {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

/* --- ALERTE ERREUR / SUCCÈS --- */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

.auth-alert-success {
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
}

/* --- PIED DE PAGE AUTH --- */
.auth-footer-links {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.auth-footer-links a {
  color: #4f46e5;
  font-weight: 700;
  text-decoration: none;
}

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

/* --- 2. ÉCRAN DE VALIDATION E-MAIL (OTP 6 CHIFFRES) --- */
.otp-inputs-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin: 1rem 0;
}

.otp-box {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
}

.otp-box:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

@media (max-width: 480px) {
  body.auth-page {
    padding: 1.25rem 0.85rem;
    justify-content: flex-start;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  .country-selector-btn {
    max-width: 48%;
    font-size: 0.75rem;
    padding: 0 0.5rem;
  }

  .otp-box {
    width: 42px;
    height: 48px;
    font-size: 1.15rem;
  }
}
