/* =========================
   LAYOUT GLOBAL (desktop)
   Objectif: contenu centré max 1200px
   ========================= */

:root{
  --site-max: 1200px;
  --site-pad: 16px; /* marge intérieure pour éviter de coller aux bords */
}

/* évite les débordements dus aux paddings/width */
*,
*::before,
*::after{
  box-sizing: border-box;
}

/* Centre la "page" (table principale) */
#ctl00_mainTableRegistration{
  width: 100%;
}

#MainCentered{
  display: block;           /* le <span> centré devient un vrai bloc */
  width: 100%;
}

/* La table qui contient tout (header + menu + contenu) */
.tableRegistration{
  width: 100% !important;
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
}

/* Centre aussi les principaux conteneurs internes */
.tdEnteteRegistrationTopInner,
#contenuContainer,
#contenu,
#contenuInner{
  width: 100%;
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-pad);
  padding-right: var(--site-pad);
}

/* =========================
   NAV TOP : empêcher les boutons de déborder
   ========================= */

/* Le conteneur de la barre menu suit la même largeur max */
.menu_top_container_parent,
.menu_top_container{
  width: 100%;
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-pad);
  padding-right: var(--site-pad);
}

/* Important : coupe tout débordement horizontal de la nav */
.menu_top_container{
  overflow: hidden;
}

/* Le UL devient flexible (les items peuvent revenir à la ligne au lieu de déborder) */
.menu_top_container .smenutop ul{
  display: flex;
  flex-wrap: wrap;     /* clé anti-débordement */
  gap: 0;              /* optionnel */
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Autorise la réduction de largeur des items (sinon ellipsis ne marche pas) */
.menu_top_container .smenutop ul > li{
  min-width: 0;
}

/* Liens : restent dans la barre, et si trop long => "..." */
.menu_top_container .smenutop ul > li a{
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sécurité : images/éléments trop larges ne cassent pas la mise en page */
img, table{
  max-width: 100%;
}

/* =========================================================
   MOBILE < 420px : Menu burger top compact + joli
   + Menu pilules moins padding / plus propre
   + Titre rubrique propre
   ========================================================= */
@media (max-width: 420px){

  /* --- 1) Nettoyage du bandeau top --- */
  html.touchevents .menu_top{
    background: transparent !important;
    padding: 0 !important;
  }

  html.touchevents .menu_top_container_parent,
  html.touchevents .menu_top_container{
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow: visible !important;
  }

/* --- 2) Burger : bouton rouge propre (on garde l'icône blanche existante) --- */
html.touchevents img#ctl00_icon_menu_top{
  /* Le HTML met display:none au départ + au clic : on force l'affichage */
  display: inline-block !important;

  /* Bouton */
  width: 46px !important;
  height: 46px !important;
  padding: 12px !important;
  box-sizing: border-box !important;

  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.25) !important;

  /* Rouge plus “premium” */
  background: linear-gradient(180deg, #ff3b3b 0%, #e11f1f 100%) !important;

  /* Ombre + léger relief */
  box-shadow:
    0 10px 22px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.25) !important;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  /* IMPORTANT : on n'efface PAS l'image, sinon plus d'icône */
  opacity: 1 !important;
  filter: none !important;
}

/* Tap feedback */
html.touchevents img#ctl00_icon_menu_top:active{
  transform: scale(.97);
  box-shadow:
    0 8px 18px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.18) !important;
}

/* Sécurité : on neutralise complètement l'ancien essai “burger dessiné en CSS” */
html.touchevents #ctl00_icon_menu_top::before,
html.touchevents #ctl00_icon_menu_top::after{
  content: none !important;
}


/* --- 3) Menu top : fermé => totalement invisible (pas de place, pas de fond) --- */
html.touchevents #ctl00_menu_top{
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 420px){

  /* --- 4) Menu top : ouvert => PAS de fond blanc (donc pas de barre blanche) --- */
  html.touchevents #ctl00_menu_top[style*="display: block"]{
    display: block !important;

    /* on supprime totalement la "capsule blanche" */
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;

    margin: 10px 0 0 0 !important;
    padding: 0 !important;

    list-style: none !important;
    width: 100% !important;
  }

  /* Force la colonne (les anciens CSS mettent souvent float/inline-block) */
  html.touchevents #ctl00_menu_top[style*="display: block"] > li{
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Les pilules rouges prennent toute la largeur -> plus de "vide blanc" */
  html.touchevents #ctl00_menu_top[style*="display: block"] > li a{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    box-sizing: border-box !important;

    min-height: 40px !important;
    padding: 0 12px !important;
    margin: 6px 0 !important;

    background: #f02828 !important;
    color: #fff !important;
    border-radius: 14px !important;

    text-align: center !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    line-height: 1.15 !important;

    border: 0 !important;
    box-shadow: 0 10px 24px rgba(240,40,40,.14) !important;
  }

  /* si le texte est dans un span/strong, on neutralise les paddings parasites */
  html.touchevents #ctl00_menu_top[style*="display: block"] > li a > *{
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    text-align: center !important;
    line-height: inherit !important;
  }

}



  @keyframes k4_menu_open{
    from{ opacity: 0; transform: translateY(-8px) scale(.99); }
    to  { opacity: 1; transform: translateY(0)    scale(1); }
  }

  /* --- 5) Items : plus compacts, moins de padding, moins "gros blocs" --- */
  html.touchevents #ctl00_menu_top[style*="display: block"] > li{
    margin: 0;
    padding: 0;
  }

  html.touchevents #ctl00_menu_top[style*="display: block"] > li a{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100%;
    box-sizing: border-box;

    /* Compact */
    min-height: 40px;
    padding: 0 12px !important;
    margin: 6px 0;

    /* Visuel pilule */
    background: #f02828;
    color: #ffffff !important;
    border-radius: 14px;

    /* Typo plus fine */
    font-weight: 700;
    font-size: 15px;
    line-height: 1.15 !important;
    letter-spacing: .2px;

    text-align: center !important;

    /* reset héritages qui décalent */
    text-indent: 0 !important;
    vertical-align: middle !important;

    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;

    border: 0 !important;
    box-shadow: 0 10px 24px rgba(240,40,40,.14);
  }

  /* Si le lien contient un span/strong : pas de padding parasite */
  html.touchevents #ctl00_menu_top[style*="display: block"] > li a > *{
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: inherit !important;
  }

  /* Un petit feedback au tap */
  html.touchevents #ctl00_menu_top[style*="display: block"] > li a:active{
    transform: scale(.99);
    box-shadow: 0 8px 18px rgba(240,40,40,.12);
  }

  /* --- 6) Titre rubrique ("Profil") --- */
  html.touchevents #ctl00_Main_TcktFront_CurrentMenuRegistration{
    background: transparent !important;
    padding: 0 !important;
    margin: 14px 0 10px 0;
  }

  html.touchevents #ctl00_Main_TcktFront_CurrentMenuRegistration h1{
    margin: 0 !important;
    padding: 10px 12px !important;

    font-size: 20px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;

    background: transparent !important;
    color: #1f1f1f !important;

    border-left: none !important;
    border-bottom: 2px solid rgba(0,0,0,.10);
  }

  /* --- 7) Bandeau MenuRegistration : transparent si tu veux "juste burger" --- */
  html.touchevents .mobile .MenuRegistration{
    background-color: transparent !important;
    color: inherit !important;
    padding-left: 0 !important;
    line-height: normal !important;
  }

}
