/* =========================================================
   REGISTER 
========================================================= */

body:has(.funky-register-page),
body:has(.funky-register-page) #page,
body:has(.funky-register-page) .site,
body:has(.funky-register-page) .site-content,
body:has(.funky-register-page) .content-area,
body:has(.funky-register-page) .site-main,
body:has(.funky-register-page) article,
body:has(.funky-register-page) .entry-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
body:has(.funky-register-page) .entry-content > * { margin: 0 !important; }

html, body { height: 100%; }

body:has(.funky-register-page) { overflow: hidden; }

body:has(.funky-register-page)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(140, 20, 78, 0.40), rgba(140, 20, 78, 0.40)),
    url("../images/photo.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.funky-register-page,
.funky-register-page * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.funky-register-page {
  font-family: "Lato", sans-serif;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.registration-container {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1100px, calc(100% - 40px));
  min-height: 640px;
  max-height: calc(100vh - 80px);
  background: #E6E4E4;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.40);
}

.welcome-section {
  flex: 1;
  background: linear-gradient(135deg, #8C144E 0%, #E75CB4 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: #fff;
}

.welcome-title {
  font-family: "Fredoka One", cursive;
  font-size: 48px;
  margin-bottom: 40px;
  text-align: center;
}

.login-button {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  padding: 14px 40px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
  margin-bottom: 20px;
}
.login-button:hover { background: #fff; color: #8C144E; }

.home-link{
  color:#fff;
  text-decoration:none;
  opacity:.9;
}
.home-link:hover{ opacity:1; text-decoration:underline; }

.form-section {
  flex: 1.3;
  background: #E6E4E4;
  padding: 45px 40px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.form-title {
  font-family: "Fredoka One", cursive;
  font-size: 36px;
  color: #333;
  margin-bottom: 25px;
  text-align: center;
}

.registration-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
  font-weight: 700;
  font-size: 13px;
  color: #333;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #fff;
  font-family: "Lato", sans-serif;
}

/* BADGES */
.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
  pointer-events: auto;
}

.badge {
  padding: 10px 18px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 25px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  user-select: none;
  pointer-events: auto;
}

.badge:hover {
  transform: translateY(-2px);
  border-color: #8C144E;
  box-shadow: 0 6px 15px rgba(140, 20, 78, 0.15);
}

/* ✅ ÉTAT SÉLECTIONNÉ : BORDEAUX (FORCÉ) */
.badge.selected{
  background:#8C144E !important;
  color:#fff !important;
  border-color:#8C144E !important;
  transform: scale(1.03);
}

.badge-icon { width: 18px; height: 18px; object-fit: contain; }
.badge.selected .badge-icon { filter: brightness(0) invert(1) !important; }

.badge:active { transform: scale(0.98); }

/* SUBMIT */
.submit-button {
  width: 100%;
  background: linear-gradient(to right, #2c2c2c, #8C144E);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: 0.3s;
}
.submit-button:hover { transform: scale(1.02); }

/* =========================================================
   VERSION MOBILE OPTIMISÉE (IPHONE & ANDROID)
========================================================= */

@media (max-width: 968px) {


  body:has(.funky-register-page) { 
    overflow: auto !important; 
    /* Fix pour le fond qui bouge sur mobile */
    background-attachment: scroll; 
  }

  .funky-register-page { 
    padding: 10px; 
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .registration-container {
    flex-direction: column;
    width: 100%;
    min-height: auto;
    max-height: none;
    border-radius: 30px; 
    margin-bottom: 30px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  }

  /* 3. Section Formulaire (Priorité absolue sur mobile) */
  .form-section {
    padding: 30px 20px;
    max-height: none;
    overflow: visible;
    flex: auto; 
  }

  .form-title {
    font-size: 28px; 
    margin-bottom: 20px;
  }

  .registration-form {
    gap: 15px;
  }

  /* OPTIMISATION IPHONE : Empêche le zoom auto */
  .form-input {
    font-size: 16px !important; 
    padding: 12px 16px;        
    height: 50px;              
  }

  .form-label {
    font-size: 12px;
    margin-bottom: 2px;
  }

  /* 4. Badges (Instruments) : Version "Boutons tactiles" */
  .badges-container {
    gap: 8px;
    justify-content: flex-start; 
  }

  .badge {
    padding: 8px 14px;
    font-size: 12px;
    flex-grow: 1;     
    justify-content: center;
    text-align: center;
  }

  /* 5. Section Welcome (Devient le pied de page) */
  .welcome-section {
    padding: 40px 20px;
    text-align: center;
    border-radius: 0 0 30px 30px; 
    flex: none; 
  }

  .welcome-title {
    font-size: 26px;
    margin-bottom: 20px;
  }

  .login-button {
    width: 100%;       
    max-width: 300px;
    padding: 16px;
    font-size: 16px;
  }

  /* Bouton Valider plus gros */
  .submit-button {
    height: 55px;
    font-size: 16px;
    margin-top: 10px;
  }
}
/* =========================================================
   OPTIMISATION GRANDS ÉCRANS (PC > 1440px & 4K)
========================================================= */

@media (min-width: 1441px) {

  /* 1. On agrandit le conteneur principal */
  .registration-container {
    max-width: 1600px; 
    min-height: 800px; 
  }

  .welcome-title {
    font-size: 65px; 
    margin-bottom: 50px;
  }

  .form-title {
    font-size: 48px; 
    margin-bottom: 40px;
  }

  .form-label {
    font-size: 16px; 
    margin-bottom: 10px;
  }

  .form-input {
    padding: 20px 24px; 
    font-size: 18px;   
    height: auto;
    border-radius: 16px;
  }

  .welcome-section {
    padding: 80px 60px;
  }

  .form-section {
    padding: 60px 80px; 
  }

  .registration-form {
    gap: 30px; 
  }

  .login-button {
    font-size: 20px;
    padding: 18px 50px;
  }

  .submit-button {
    font-size: 20px;
    padding: 22px;
  }

  .badge {
    padding: 14px 24px;
    font-size: 15px;
    border-radius: 30px;
  }
  
  .badge-icon {
    width: 24px;
    height: 24px;
  }
}