:root {
    --background-color: #FFFCFA;
    --primary-color: #3DCC3D; 
    --text-color: #373435; 
    --header-bg: #f8f8f8;
    --header-border: #ddd;
    --secondary-bg: #e9ecef;
    --font-main: 'Space Grotesk', sans-serif;
    --font-heading: 'Concert One', sans-serif;
}

body.dark-mode {
    --background-color: #111827;
    --primary-color: #3DCC3D; 
    --text-color: #FFFCFA; 
    --header-bg: #1f2937;
    --header-border: #4b5563;
    --secondary-bg: #1f2937;
}

body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-family: var(--font-main);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h2 {
    font-family: var(--font-main) ;
    font-size: 2.5rem ; 
    text-align: center ;
    margin-bottom: 40px ;
    color: var(--text-color) ;
    width: 100%;
    display: block ;
}

@media (max-width: 768px) {
    h2 {
        font-size: 2rem ;
        margin-bottom: 30px ;
    }
}

header {
    width: 95%;
    margin: 10px auto 0;
    border-bottom: none;
    padding: 8px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    background-color: var(--header-bg);
    border: 1px solid var(--header-border);
    transition: background-color 0.3s;
    height: 35px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 35px;
}

.mobile-icon {
    display: none;
}



.logo {
    position: absolute;
    left: 40px;
    top: 55%;
    transform: translateY(-50%);
    z-index: 10;
}

.png-logo {
    height: 30px;
    width: auto;
}

nav.main-nav {
    flex-grow: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: center;
}

nav a {
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    padding: 5px 0;
}

nav a:hover {
    color: var(--primary-color);
}



.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;
}

.menu-toggle .bar {
    width: 22px;
    height: 2px;
    background-color: var(--primary-color);
    transition: 0.3s;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10; 
}

@media (max-width: 768px) {
    header {
    width: 85%;
    margin: 10px auto 0; 
    border-bottom: none; 
    padding: 8px 25px; 
    border-radius: 50px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative; 
    background-color: var(--header-bg);
    border: 1px solid var(--header-border);
    transition: background-color 0.3s, border-color 0.3s;
    height: 35px;
    }

    .header-content {
        justify-content: space-between;
    }

    .logo {
        position: static;
        transform: none;
        left: auto;
        top: auto;
    }

    .png-logo {
        height: 35px; 
    }
    
    nav.main-nav {
        display: none; 
    }

    .menu-toggle {
        display: flex; /* On affiche le bouton */
    }

    nav.main-nav {
        display: none; 
        position: absolute;
        top: 55px;
        right: 5%; /* Aligné vers la droite */
        width: 200px; /* Largeur réduite pour un effet menu */
        background-color: var(--header-bg);
        border: 1px solid var(--header-border);
        border-radius: 20px;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .mobile-icons {
        display: flex;
        gap: 20px;
        border-top: 1px solid var(--header-border);
        padding-top: 15px;
        width: 100%;
        justify-content: center;
    }

    /* Classe ajoutée par le JS pour ouvrir le menu */
    nav.main-nav.active {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    nav.main-nav ul {
        flex-direction: column;
        gap: 15px;
    }

    /* Animation du bouton en "X" */
    .menu-toggle.open .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .menu-toggle.open .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.open .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

}

@media (max-width: 480px) {
    header {
    width: 80%;
    margin: 10px auto 0; 
    border-bottom: none; 
    padding: 8px 25px; 
    border-radius: 50px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative; 
    background-color: var(--header-bg);
    border: 1px solid var(--header-border);
    transition: background-color 0.3s, border-color 0.3s;
    height: 35px;
    }
}

/* --- Icônes Ordinateur --- */
.desktop-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.icon-color {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: 0.3s;
}

/* --- Icônes Mobile (Cachées par défaut) --- */
.mobile-icons {
    display: none;
}

@media (max-width: 768px) {
    .desktop-icons {
        display: none; /* Cache les icônes de la barre sur mobile */
    }

    .menu-toggle {
        display: flex;
        margin-left: auto;
    }

    .mobile-icons {
        display: flex; /* Montre les icônes DANS le menu mobile */
        gap: 20px;
        border-top: 1px solid var(--header-border);
        padding-top: 15px;
        width: 100%;
        justify-content: center;
    }

    nav.main-nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 50px;
        right: 0;
        width: 200px;
        background-color: var(--header-bg);
        border-radius: 15px;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
}

#account-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 400px;
    background: transparent;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#account-modal.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

#modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2rem 2rem 1.5rem;
  background-color: var(--header-bg);
  border-radius: 24px;
  border: 1px solid var(--header-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  font-family: var(--font-main);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.4;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: opacity 0.2s, background-color 0.2s;
  padding: 0;
}

.modal-close-btn:hover {
  opacity: 1;
  background-color: var(--secondary-bg);
}

.form-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.form-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: rgba(61, 204, 61, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.5rem;
  color: var(--primary-color);
}

#heading {
  text-align: center;
  margin: 0;
  color: var(--text-color);
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-main);
}

.form-subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-color);
  opacity: 0.55;
  text-align: center;
}

.field {
  display: flex;
  align-items: center;
  gap: 0.7em;
  border-radius: 50px;
  padding: 0.75em 1.1em;
  border: 1px solid var(--header-border);
  background-color: var(--background-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(61, 204, 61, 0.1);
}

.input-icon-fa {
  color: var(--primary-color);
  font-size: 0.9rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.input-icon {
  height: 1.1em;
  width: 1.1em;
  fill: var(--primary-color);
  opacity: 0.8;
  flex-shrink: 0;
}

.input-field {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text-color);
  font-family: var(--font-main);
  font-size: 0.95rem;
}

.input-field::placeholder {
  color: var(--text-color);
  opacity: 0.4;
}

.password-field {
  position: relative;
}

.toggle-password-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.4;
  font-size: 0.85rem;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.toggle-password-btn:hover {
  opacity: 0.8;
}

.form-footer-link {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.btn {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.button1 {
  width: 100%;
  padding: 0.8em 1.8em;
  border-radius: 50px;
  border: none;
  outline: none;
  font-weight: 600;
  font-family: var(--font-main);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background-color: var(--primary-color);
  color: #fff;
}

.button1:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.button3 {
  background-color: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--primary-color);
  padding: 0;
  text-decoration: none;
  transition: opacity 0.2s;
}

.button3:hover {
  opacity: 0.75;
}

@media (max-width: 480px) {
  .form {
    padding: 1.5rem;
  }

  #heading {
    font-size: 1.2rem;
  }
}