/* ===== LOGIN PAGE MODERNE ===== */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: linear-gradient(to right, #4e54c8, #8f94fb);
}

.login-card {
    background: #fff;
    padding: 3rem 2rem;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 80px;
    margin-bottom: 1rem;
}

h2 {
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

input[type="email"], input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #4e54c8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

button:hover {
    background: #6c63ff;
}

/* Lien pour créer un compte */
.signup-link {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.signup-link a {
    color: #4e54c8;
    font-weight: 600;
    text-decoration: none;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* Gestion des erreurs */
.errorlist {
    color: red;
    margin: 0 0 0.5rem 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 20px;
    font-size: 14px;
    color: #555;
}
/* ===== Général ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    color: #333;
}

/* ===== Header top-right ===== */
.top-right {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 0.9rem;
}

.top-right a {
    color: #4e54c8;
    text-decoration: none;
    font-weight: 600;
}

.top-right a:hover {
    text-decoration: underline;
}

/* ===== Titre principal ===== */
h1 {
    text-align: center;
    margin-top: 50px;
    color: #4e54c8;
    font-size: 2.5rem;
}

/* ===== Formulaire de recherche ===== */
.search-form {
    max-width: 400px;
    margin: 30px auto;
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-form label {
    font-weight: 600;
    margin-bottom: 5px;
}

.search-form input[type="text"] {
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-form input[type="text"]:focus {
    border-color: #4e54c8;
}

.search-form button {
    padding: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #4e54c8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #6c63ff;
}

/* ===== Liste des communes ===== */
.commune-list {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 20px auto 50px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.commune {
    background-color: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    font-weight: 600;
}

.commune:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.commune a {
    text-decoration: none;
    color: #4e54c8;
}

.commune.chosen {
    border: 2px solid #28a745;
    background-color: #e6f4ea;
}

.commune.chosen a {
    color: #28a745;
}

/* Formulaire inline */
.form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px; /* espace entre label et input */
}

.form-group-inline label {
    font-weight: 600;
    min-width: 150px; /* largeur du label pour aligner correctement */
}

.form-group-inline input[type="text"] {
    flex: 1; /* prend tout l'espace restant */
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ===== Barre utilisateur en haut à droite ===== */
.top-right {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 0.95rem;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

.top-right a {
    color: #4e54c8; /* couleur principale de ton site */
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.top-right a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .top-right {
        font-size: 0.85rem;
        padding: 4px 8px;
    }
}

.commune.abonne {
    font-weight: bold;
    color: green;
}

.commune-list, .subscription-list {
    margin: 0;
    padding: 0;
}

.commune, .subscription {
    margin: 5px 0;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.commune a {
    text-decoration: none;
    color: #007BFF;
}

.commune a:hover {
    text-decoration: underline;
}

.commune-list, .subscription-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* espace entre les items */
}

.commune, .subscription {
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.commune a {
    text-decoration: none;
    color: #007BFF;
    font-weight: 500;
}

.commune a:hover {
    text-decoration: underline;
}


.commune-list {
    list-style: none;       /* retire les puces */
    margin: 20px auto;      /* marge verticale et centré horizontalement */
    padding: 0;
    max-width: 400px;       /* largeur max, ajuste selon ton goût */
    text-align: center;     /* centre le texte */
}

.commune {
    margin: 5px 0;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 5px;
    display: inline-block;  /* permet de centrer les blocs */
}


.profile-container {
    max-width: 500px;
    margin: 20px auto; /* centrer le bloc */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.profile-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.profile-container p {
    font-size: 16px;
    margin: 8px 0;
}

.profile-container form {
    text-align: center;
    margin-top: 20px;
}

.profile-container button {
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.profile-container button:hover {
    background-color: #c0392b;
}

/* Container principal du profil */
.profile-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Titres */
.profile-container h2,
.profile-container h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Groupe de champs */
.form-group {
    margin-bottom: 15px;
}

/* Labels */
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

/* Inputs */
.form-group input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 14px;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
}

/* Boutons colorés */
.btn-primary { background-color: #4CAF50; color: white; }
.btn-warning { background-color: #FF9800; color: white; }
.btn-danger  { background-color: #F44336; color: white; }

/* Hover pour tous les boutons */
.btn:hover {
    opacity: 0.9;
}

/* Séparateurs */
hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* Top right menu */
.top-right {
    position: absolute;
    top: 10px;
    right: 10px;
}

.top-right a {
    margin-left: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.top-right a:hover {
    color: #4CAF50;
}


.btn {
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 8px;
}

/* Vert pour update / changer mdp */
.btn-update {
    background-color: #28a745;
    color: white;
}

/* Rouge pour supprimer */
.btn-danger {
    background-color: #dc3545;
    color: white;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
}

.form-group input {
    width: 100%;
    padding: 6px 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Conteneur centré et largeur limitée */
.profile-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

/* Formulaire et champs */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* Boutons */
.btn {
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 10px;
}

.btn-update {
    background-color: #28a745;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

/* Séparateurs */
hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #ccc;
}

/* ===== Page profil : cadre commun ===== */
.profile-container {
    display: flex;
    gap: 30px; /* espace entre colonnes */
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: #fff; /* fond unique pour tout le cadre */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    align-items: flex-start;
}

/* Colonne gauche et droite */
.profile-left,
.profile-right {
    flex: 1; /* chaque colonne prend moitié du cadre (ajustable) */
}

/* Titres centrés */
.profile-container h2,
.profile-container h3 {
    text-align: center;
    margin-top: 0;
}

/* Boutons verts/rouges pour la page profil */
.profile-container .btn-update {
    background-color: #28a745 !important;
    color: white !important;
}
.profile-container .btn-update:hover {
    background-color: #218838 !important;
}
.profile-container .btn-danger {
    background-color: #dc3545 !important;
    color: white !important;
}
.profile-container .btn-danger:hover {
    background-color: #c82333 !important;
}

/* Abonnements : alignement exacte avec le prénom */
.profile-right .subscription-list {
    margin-top: 8px; /* ajuste pour aligner la première subscription */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Style des subscriptions */
.subscription {
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
}
/* ===== Ajustement des abonnements ===== */
.profile-right .subscription-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* espace entre les abonnements */
    margin-top: 40px; /* ajuste ce chiffre pour aligner avec le prénom */
}


/* ===== Liste des communes ===== */
.commune-list {
    list-style: none;
    padding: 0;
    margin: 20px auto 50px auto;
    max-width: 400px;
    text-align: left;
}

.commune {
    display: flex;
    align-items: center;
    justify-content: space-between; /* nom à gauche, icône à droite */
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.commune:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.commune a {
    text-decoration: none;
    color: #4e54c8;
    font-weight: 600;
}

.commune a:hover {
    text-decoration: underline;
}

/* Commune déjà abonnée */
.commune.abonne {
    color: green;
    font-weight: bold;
}

/* Formulaire inline pour icône d'abonnement */
.commune form {
    margin: 0;
}

.commune form button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.commune form button img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.commune form button:hover img {
    transform: scale(1.2);
}

.commune {
    display: flex;
    justify-content: space-between;
    align-items: center; /* CENTRAGE VERTICAL */
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 5px 0;
}

.subscribe-icon form,
.subscribe-icon button {
    margin: 0; /* supprime tout margin par défaut */
    padding: 0;
}

.subscribe-icon .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
}

.subscribe-icon img {
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

.subscribe-icon img:hover {
    transform: scale(1.2);
}

.icon-48 {
    width: 48px;
    height: 48px;
}

.icon-24 {
    width: 24px;
    height: 24px;
}



/* ===== Abonnements profil ===== */
.profile-right .subscription-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* espace entre les abonnements */
    margin-top: 20px; /* ajuste l'alignement avec le reste */
}

.subscription {
    display: flex;
    justify-content: space-between; /* texte à gauche, icône à droite */
    align-items: center;            /* alignement vertical centré */
    padding: 5px 5px;              /* un peu d’espace autour */
    border-bottom: 1px solid #ddd;  /* optionnel : séparation */
}

.subscription img.icon-24 {
    width: 24px;
    height: 24px;
    object-fit: contain; /* ajuste l'image à la taille sans déformer */
}

.subscription:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
}

.subscription-name {
    font-size: 1rem;
}

/* Formulaire et bouton icône */
.subscription form {
    margin: 0;
    padding: 0;
    display: inline;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.icon-button img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.icon-button img:hover {
    transform: scale(1.2);
}

.subscription {
    display: flex;
    justify-content: space-between; /* texte à gauche, icône à droite */
    align-items: center;            /* CENTRAGE VERTICAL */
    padding: 5px 10px;
    border-radius: 8px;
    background-color: #f5f5f5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
}

.subscription .icon-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;   /* centre l'image verticalement */
    justify-content: center;
    cursor: pointer;
}

.subscription .icon-button img {
    width: 24px;           /* taille de l'icône */
    height: 24px;
    display: block;
}


/* Ajustement pour aligner la première subscription avec le champ Prénom */
.profile-right {
    display: flex;
    flex-direction: column;
}

/* Décalage vers le bas de la colonne droite */
.profile-right .subscription-list {
    margin-top: 20px; /* <- ajuste cette valeur pour que ça soit exactement en face du prénom */
    display: flex;
    flex-direction: column;
    gap: 8px;
}