/* ================================
   GLOBAL – MOBILE SAFETY
================================ */
@media (max-width: 768px) {

  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  * {
    box-sizing: border-box;
  }
}

/* ================================
   HEADER – TABLETTE & MOBILE
================================ */
@media (max-width: 768px) {

  .auth-header {
    height: auto;
    padding: 12px 16px;
  }

  .header-content {
    flex-wrap: wrap;
    height: auto;
  }

  .logo img {
    max-height: 32px;
  }

  .back-btn img {
    width: 20px;
    height: 20px;
  }
}

/* ================================
   AUTH PAGE – TABLETTE & MOBILE
================================ */
@media (max-width: 768px) {

  .auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Colonne gauche */
  .auth-left {
    width: 100%;
    padding: 16px;
  }

  
  

  /* Titres */
  h1 {
    font-size: 24px;
    line-height: 1.3;
  }

  .info-box {
    font-size: 14px;
    margin-bottom: 16px;
  }

  /* Inputs & boutons */
  input,
  button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  input {
    font-size: 16px; /* évite le zoom Android */
  }

  .btn-primary {
    width: 100%;
    margin-top: 16px;
  }

  .btn-social {
    width: 100%;
    margin-bottom: 12px;
  }

  .separator {
    margin: 24px 0;
  }
}

/* ================================
   MOBILE ÉTROIT (≤ 480px)
================================ */
@media (max-width: 480px) {

  .auth-left {
    padding: 12px;
  }

  h1 {
    font-size: 22px;
  }

  .info-box {
    font-size: 13px;
  }

  label {
    font-size: 14px;
  }

  .btn-primary {
    font-size: 16px;
    padding: 14px;
  }

  .btn-social {
    font-size: 15px;
    padding: 12px;
  }

  /* Mot de passe */
  .password-wrapper {
    display: flex;
    align-items: center;
  }

  .toggle-password img {
    width: 20px;
    height: 20px;
  }
}

/* ================================
   FORMULAIRES SPÉCIAUX (si présents)
================================ */
@media (max-width: 480px) {

  .auth-card {
    padding: 24px 16px;
  }

  .code-form input {
    width: 38px;
    height: 46px;
    font-size: 18px;
  }
}

/* =====================================
   FORCE RESPONSIVE – AUTH (MOBILE)
===================================== */
@media (max-width: 768px) {

  html, body {
    overflow-x: hidden;
  }

  /* 1️⃣ Supprimer le grid desktop */
  .auth-page {
    display: flex !important;
    flex-direction: column !important;
    padding-left: 0 !important;
    gap: 0 !important;
  }

  /* 2️⃣ Colonne gauche fluide */
  .auth-left {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 24px !important;
    padding: 16px !important;
  }

  

  /* 4️⃣ Supprimer TOUTES les largeurs fixes */
  input,
  .password-wrapper,
  .btn-primary,
  .btn-social {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 5️⃣ Inputs sans zoom Android */
  input {
    font-size: 16px !important;
  }
}

/* =====================================
   HEADER MOBILE – FIX FINAL (ANDROID)
===================================== */
@media (max-width: 768px) {

  .auth-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 56px !important;
    padding: 0 56px !important; /* espace pour la flèche */
    position: relative !important;
  }

  /* Flèche */
  .back-btn {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
  }

  .back-btn img {
    width: 22px !important;
    height: auto !important;
  }

  /* Logo (CONTENEUR + IMAGE) */
  .logo {
    max-width: 140px !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  .logo img {
    width: 100% !important;
    max-width: 140px !important;
    height: auto !important;
    display: block !important;
  }
}
/* =====================================
   HEADER MOBILE – ALIGNEMENT FINAL
===================================== */
@media (max-width: 768px) {

  .auth-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 56px !important;
    padding: 0 56px !important; /* réserve espace flèche */
    position: relative !important;
  }

  /* Flèche alignée verticalement */
  .back-btn {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    z-index: 10 !important;
  }

  .back-btn img {
    width: 22px !important;
    height: auto !important;
    display: block !important;
  }

  /* Logo centré sur la même ligne */
  .logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 140px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .logo img {
    max-width: 140px !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}

/* =====================================
   VERIFY PAGE – MOBILE FIX
===================================== */
@media (max-width: 768px) {

  /* Wrapper global */
  .verify-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
  }

  /* Container principal */
  .verify-container {
    width: 100% !important;
    max-width: 420px !important;
    margin: 24px auto 0 !important;
    padding: 24px !important;
    height: auto !important;
  }

  /* Texte */
  .verify-container h1 {
    font-size: 22px;
    text-align: center;
  }

  .subtitle {
    text-align: center;
    font-size: 14px;
  }

  /* Inputs code */
  .code-inputs {
    justify-content: center;
    gap: 6px;
  }

  .code-inputs input {
    width: 42px;
    height: 48px;
    font-size: 20px;
  }

  /* Boutons */
  .btn-primary {
    width: 100%;
    height: 44px;
  }

  .resend {
    text-align: center;
    width: 100%;
  }

  /* ❌ Image décorative supprimée sur mobile */
  .verify-image-block {
    display: none !important;
  }
}

/* =====================================
   AUTH – BACKGROUND ANIMÉ (MOBILE)
===================================== */
@media (max-width: 768px) {

  /* Scène principale */
  .auth-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #f5f6f7;
  }

  /* Animation = décor */
  .auth-right {
    position: absolute !important;
    inset: -20% 0 0 0; /* déborde légèrement */
    display: block !important;
    z-index: 0;
    pointer-events: none;
  }

  /* Forcer une vraie hauteur */
  .cards-grid {
    height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.75);
  }

  /* Colonnes toujours visibles */
  .cards-column {
    height: 100%;
  }

  /* Le formulaire AU-DESSUS */
  .auth-left {
    position: relative;
    z-index: 2;
    margin: 24px 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
  }
}

/* =====================================
   AUTH – BACKGROUND ANIMÉ (ANDROID FIX)
===================================== */
@media (max-width: 768px) {

  /* Le décor animé */
  .auth-right {
    position: fixed !important;
    top: 56px; /* sous le header */
    left: 0;
    right: 0;
    bottom: 0;

    display: block !important;
    z-index: 0 !important;

    pointer-events: none !important;
    overflow: hidden !important;
  }

  /* Forcer le rendu des animations */
  .cards-grid {
    height: 140vh !important;
    transform: scale(0.75) translateY(-10%);
    will-change: transform;
  }

  .cards-column {
    height: 100%;
  }

  /* Le contenu AU-DESSUS */
  .auth-left {
    position: relative !important;
    z-index: 2 !important;

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-radius: 14px;

    margin: 24px 16px;
  }
}

@media (max-width: 768px) {

  .auth-page {
    position: relative;
    min-height: 100vh;
    overflow: visible; /* ne bloque plus le fixed */
  }

  .auth-right {
    position: fixed !important;
    top: 56px; /* sous le header */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0 !important; /* derrière le formulaire */
    pointer-events: none !important;
    overflow: visible !important;
    background: none; /* transparent */
  }

  .auth-left {
    position: relative !important;
    z-index: 2 !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    margin: 24px 16px;
  }

  .cards-grid {
    height: auto !important; 
    transform: scale(0.75);
    will-change: transform;
  }

}


