/* ================================================
   REGISTER — styles spécifiques à la page inscription
   Utilise le système unifié (navbar, footer, boutons) via fer-modern.css
   Toutes les couleurs sont paramétrables via --primary / --secondary
   ================================================ */

body{
  background: var(--page-bg, #ffffff);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Register.php n'a pas de navbar → annuler le padding mobile
   que fer-modern.css applique pour réserver la place du mobile-header */
@media (max-width: 1040px){
  body{
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* ─── Title bar (même pattern que partenaires/photos) ─── */
.register-title-bar{
  display: flex;
  align-items: center;
  gap: 1rem;
  /* Aligné sur la carte du formulaire (.card-form = 68.75rem + padding 1.5rem) :
     le bouton retour s'aligne sur le bord gauche de l'iframe et le badge sur le
     bord droit.
     width:100% est indispensable : sans lui la barre se réduit à la largeur de
     son contenu et se centre (effet « trop centré »). Avec width:100% elle
     occupe toute la largeur (jusqu'à max-width) et le flex:1 du titre pousse le
     badge à droite / le bouton retour à gauche. */
  width: 100%;
  max-width: 68.75rem;
  margin: 2rem auto 1.5rem;
  padding: 0 1.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Back-btn identique au pattern .partners-title-bar / .photos-hero / .gallery-hero */
.register-title-bar .back-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--secondary, #0f172a) !important;
  color: var(--secondary-text, #fff) !important;
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
  flex-shrink: 0;
}
.register-title-bar .back-btn:hover{
  background: var(--primary) !important;
  color: var(--primary-text, #fff) !important;
}

.register-title-info{
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 12.5rem;
}
.register-title-info h1{
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--page-text, #0f172a);
  line-height: 1.1;
}
.register-subtitle{
  font-size: 0.95rem;
  color: var(--page-muted, rgba(15,23,42,.65));
  font-weight: 500;
}
.register-donation-badge{
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border-radius: var(--radius, 12px);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

@media (max-width: 767px){
  .register-title-bar{
    margin: 1.25rem auto;
    padding: 0 1rem;
    gap: 0.75rem;
  }
  /* Le titre occupe assez de place pour forcer le badge sur sa propre ligne… */
  .register-title-info{
    flex: 1 1 70%;
  }
  .register-donation-badge{
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    /* …et le badge (largeur naturelle) est centré au milieu de la page sur mobile */
    margin-left: auto;
    margin-right: auto;
  }
}

/* ─── Card du formulaire ─── */
.card-form{
  max-width: 68.75rem;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  border: 0;
  background: var(--page-bg, #fff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
/* Guard-rail: TinyMCE images restent dans les bornes */
.register-page-title img{
  max-width: 100% !important;
  object-fit: contain;
}
.register-page-title{
  color: var(--page-text, #0f172a);
  font-size: clamp(1.42rem, 2.6vw, 1.98rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.register-online-title{
  font-size: clamp(0.98rem, 1.35vw, 1.16rem);
  font-weight: 400;
  color: var(--page-text, #0f172a);
}

/* ─── Réglementation CTA ─── */
.reglement-wrap{
  width: min(100%, 68.75rem);
  margin: 0 auto 0.75rem;
  padding: 0 0.75rem;
  display: flex;
  justify-content: center;
}
.reglement-cta{
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border: 0;
  border-radius: var(--radius, 12px);
  background: var(--secondary);
  color: var(--secondary-text, #ffffff);
  padding: 0.75rem 1.25rem;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, transform .1s ease;
}
.reglement-cta:hover{
  background: var(--secondary-hover);
  color: var(--secondary-text, #ffffff);
}
.reglement-cta:active{
  transform: scale(0.98);
}

/* ─── Form Bootstrap — radius unifié ─── */
.form-control,
.form-select{
  border-radius: var(--radius, 12px) !important;
}

/* ─── AssoConnect iframe (méthode DIV + Script) ─── */
.iframe-asc-container,
.iframe-asc-container iframe{
  width: 68.75rem !important;
  max-width: 100% !important;
}
.iframe-asc-container{
  margin-bottom: 2rem;
}

@media (max-width: 767px){
  .card-form{
    margin: 0 0.75rem 1rem;
    padding: 1rem;
  }
  .reglement-wrap{
    padding: 0 0.625rem;
  }
  .reglement-cta{
    font-size: 0.9rem;
    padding: 0.625rem 1rem;
  }
  #fPub .col-md-6{
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ─── Lien PDF (téléchargement règlement) ─── */
.pdf-link{
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(15,23,42,.05);
  border: none;
  border-radius: var(--radius, 12px);
  color: var(--page-text, #0f172a);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background .2s ease, transform .1s ease;
  margin: 0.5rem 0;
}
.pdf-link:hover{
  background: rgba(15,23,42,.09);
  color: var(--page-text, #0f172a);
}
.pdf-link:active{
  transform: scale(0.98);
}
.pdf-link-icon{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: var(--radius, 12px);
  flex-shrink: 0;
}
.pdf-link-icon svg{
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pdf-link-info{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pdf-link-name{
  font-weight: 600;
  line-height: 1.3;
  color: var(--page-text, #0f172a);
}
.pdf-link-hint{
  font-size: 0.75rem;
  color: var(--page-muted, rgba(15,23,42,.45));
}

/* ─── TinyMCE content dans modale réglementation ─── */
.modal-body table{
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1rem;
}
.modal-body td,
.modal-body th{
  border: 1px solid rgba(15,23,42,.12);
  padding: 0.5rem 0.75rem;
}
.modal-body img{
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.modal-body img:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* ─── Lightbox pour images TinyMCE ─── */
.tiny-lightbox{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.tiny-lightbox.active{
  display: flex;
}
.tiny-lightbox-close{
  position: absolute;
  top: 1.875rem;
  right: 2.5rem;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .2s ease;
}
.tiny-lightbox-close:hover{
  transform: scale(1.1);
}
.tiny-lightbox-img{
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius, 12px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* ─── Dark theme ─── */
body.dark-theme .card-form{
  background: #1e293b;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}
body.dark-theme .register-page-title,
body.dark-theme .register-online-title,
body.dark-theme .register-title-info h1{
  color: #e2e8f0;
}
body.dark-theme .pdf-link{
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
}
body.dark-theme .pdf-link:hover{
  background: rgba(255,255,255,.09);
  color: #e2e8f0;
}
body.dark-theme .pdf-link-name{
  color: #e2e8f0;
}
body.dark-theme .modal-body td,
body.dark-theme .modal-body th{
  border-color: rgba(255,255,255,.12);
}

/* Bootstrap modal — override du blanc par défaut en dark theme */
body.dark-theme .modal-content{
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.08);
}
body.dark-theme .modal-header{
  border-bottom-color: rgba(255,255,255,.1);
}
body.dark-theme .modal-footer{
  border-top-color: rgba(255,255,255,.1);
}
body.dark-theme .modal-title{
  color: #e2e8f0;
}
body.dark-theme .modal-body,
body.dark-theme .modal-body *:not(a):not(.pdf-link-name):not(.pdf-link-hint){
  color: #e2e8f0;
}
body.dark-theme .modal-body a{
  color: var(--primary);
}
body.dark-theme .modal-body a:hover{
  color: var(--primary-hover);
}
/* Bouton Fermer (croix) : inverser pour être visible sur fond sombre */
body.dark-theme .btn-close{
  filter: invert(1) grayscale(100%) brightness(200%);
}
/* Bouton "Fermer" du footer (.btn-secondary Bootstrap) */
body.dark-theme .modal-footer .btn-secondary{
  background: rgba(255,255,255,.1);
  color: #e2e8f0;
  border-color: rgba(255,255,255,.15);
}
body.dark-theme .modal-footer .btn-secondary:hover{
  background: rgba(255,255,255,.18);
  color: #ffffff;
}

/* ─── Anti grand vide blanc ───────────────────────────────────────────────
   Le <main> global (fer-modern.css) impose `padding: 1.25rem 0 8.75rem`
   → 8.75rem (~140px) de padding-bottom, ce qui crée le grand vide entre la
   carte et le bouton « réglementation ». Il a aussi flex-grow:1 qui l'étire.
   Sur la page inscription on neutralise les deux : padding-bottom réduit et
   pas d'étirement. Le footer reste collé en bas via margin-top:auto. */
main.flex-grow-1{
  flex-grow: 0 !important;
  padding-bottom: 1.5rem !important;
}
.site-footer{ margin-top: auto; }
