/* ==========================================================================
   Auth Mobile — Adaptations responsive pour smartphone (login, register, etc.)
   Uniquement pour écrans < 768px. Ne modifie pas l'affichage web.
   ========================================================================== */

@media (max-width: 767.98px) {
  /* --- Layout type app mobile --- */
  body.authentication-background {
    min-height: 100dvh;
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }

  .authentication.authentication-basic {
    min-height: 100dvh;
    min-height: 100vh;
    align-items: stretch;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }

  .authentication.authentication-basic .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-width: 100%;
  }

  .authentication.authentication-basic .col-12 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  /* --- Carte formulaire --- */
  .authentication .card.auth-form-card,
  .authentication .card.custom-card {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }

  .auth-form-card .auth-form-inner,
  .authentication .card-body .auth-form-inner {
    padding: 1.25rem 1rem !important;
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }

  /* --- Logo --- */
  .auth-brand-logo {
    max-height: 44px !important;
    max-width: 180px !important;
  }

  /* --- Typographie adaptée mobile --- */
  .auth-form-inner .h4,
  .auth-form-inner p.h4 {
    font-size: 1.15rem !important;
    line-height: 1.35;
    margin-bottom: 0.25rem !important;
  }

  .auth-form-inner .text-muted.mb-2 {
    font-size: 0.9rem !important;
  }

  .auth-form-inner .text-muted.small,
  .auth-form-inner .text-muted.fs-12 {
    font-size: 0.8rem !important;
    line-height: 1.4;
  }

  /* --- Labels et champs (zone tactile 44px min) --- */
  .auth-form-card .form-label,
  .authentication .form-label {
    font-size: 0.95rem !important;
    font-weight: 500;
    margin-bottom: 0.4rem !important;
  }

  /* Label Mot de passe + lien oublié : évite chevauchement sur petit écran */
  .auth-form-card label.form-label.d-block,
  .authentication label.form-label.d-block {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }
  .auth-form-card label.form-label.d-block .float-end,
  .authentication label.form-label.d-block .float-end {
    float: none;
    order: 2;
    white-space: nowrap;
  }

  .auth-form-card .form-control,
  .auth-form-card .form-control-lg,
  .auth-form-card .form-select,
  .auth-form-card .form-select-lg,
  .authentication .form-control,
  .authentication .form-control-lg,
  .authentication .form-select,
  .authentication .form-select-lg {
    font-size: 1rem !important; /* évite zoom auto iOS */
    min-height: 48px !important;
    padding: 0.65rem 0.85rem !important;
    border-radius: 0.5rem !important;
  }

  .auth-form-card .input-group.input-group-lg .form-control,
  .auth-form-card .input-group.input-group-lg .input-group-text {
    min-height: 48px !important;
    font-size: 1rem !important;
    padding: 0.65rem 0.75rem !important;
  }

  .auth-form-card .input-group-text {
    font-size: 0.95rem !important;
  }

  /* --- Bouton principal --- */
  .auth-form-card .btn-primary,
  .auth-form-card .btn-primary.btn-lg,
  .authentication .btn-primary,
  .authentication .btn-primary.btn-lg {
    min-height: 50px !important;
    font-size: 1rem !important;
    font-weight: 600;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
  }

  /* --- Liens et texte secondaire --- */
  .auth-form-card .link-danger,
  .auth-form-card a.fs-12,
  .auth-form-card .op-5 {
    font-size: 0.85rem !important;
  }

  .auth-form-card .form-check-label {
    font-size: 0.9rem !important;
  }

  /* --- Alerte --- */
  .auth-form-card .alert {
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
  }

  /* --- Espacement entre blocs --- */
  .auth-form-inner .row.gy-3 {
    --bs-gutter-y: 1rem;
  }

  .auth-form-inner .mb-3 {
    margin-bottom: 0.75rem !important;
  }

  .auth-form-inner .mt-4 {
    margin-top: 1.25rem !important;
  }

  /* --- Mot de passe oublié / Rappeler par code --- */
  .auth-form-inner .text-center.my-2 a {
    font-size: 0.85rem !important;
  }

  /* --- Inscription / Mot de passe oublié --- */
  .auth-form-inner .text-muted.mt-3,
  .auth-form-inner .text-muted.mt-2 {
    font-size: 0.9rem !important;
  }

  .auth-form-inner .text-muted.mt-3 a,
  .auth-form-inner .text-muted.mt-2 a {
    font-weight: 600;
  }

  /* Texte d'aide sous le formulaire (forgot-password) */
  .auth-form-inner .text-muted.small.mt-2 {
    font-size: 0.8rem !important;
    line-height: 1.4;
  }

  /* --- Bouton afficher mot de passe --- */
  .auth-form-card .show-password-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
