html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
}

h1 {
    color: white;
    text-align: center;
}

.wrapper {
    min-height: 100%;
    width: 75%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container, .form-section {
    width: 100%;
    margin: 0 auto;
    border-radius: 10px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.form-section {
    background-color: #2856e6;
    padding: 40px;
    margin-bottom: 60px;
    text-align: center;
    box-sizing: border-box; /* Ajouté pour inclure le padding dans la largeur */
    position: relative;
}

.form-section label {
    font-size: 18px;
    color: white;
}

.form-section input[type="text"] {
    width: 50%;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    border: none;
    font-size: 20px;
}

.form-section input[type="submit"] {
    padding: 15px 40px;
    background-color: #ff8000;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.form-section input[type="submit"].loading {
    cursor: not-allowed;
    opacity: 0.7;
}

.form-section input[type="submit"].loading:after {
    content: "";
    width: 15px;
    height: 15px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.section {
    margin-top: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.section:first-child {
    margin-top: 0;
}

.section:last-child {
    border-bottom: none; /* Supprime la bordure pour la dernière section */
    padding-bottom: 0; /* Supprime le padding en bas pour la dernière section */
}

.section h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px; /* Réduit de 30px à 20px */
    padding-bottom: 10px;
    border-bottom: 3px solid #2856e6;
    display: inline-block;
}

.operators {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.operator {
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 10px;
    width: calc(33.33% - 10px);
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.operator:hover {
    background-color: rgba(40, 86, 230, 0.1);  /* Bleu clair semi-transparent */
    border-color: #2856e6;  /* Bordure bleue */
}

.operator img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.operator p {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px;
    text-align: left;
}

th {
    background-color: #f5f5f5;
}

.zone-info {
    font-weight: bold;
    margin: 0 0 10px;
    text-align: center;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
}

.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
    font-size: 14px;
    color: #555;
}

.footer img {
    width: 120px;
    height: auto;
    vertical-align: middle;
}

.footer a {
    color: #2856e6;
    text-decoration: none;
}

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

/* Popup avec taille agrandie et centré */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    padding: 20px 20px 60px;
    border-radius: 10px;
    z-index: 1000;
    width: 50%;
    max-width: 600px;
    height: 80%;
    max-height: 600px;
    overflow: hidden;
    flex-direction: column;
}

.popup-header {
    flex-shrink: 0;
}

.popup-header h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.popup-header h3 img {
    width: 30px;
    height: auto;
    margin-right: 10px;
}

.popup-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 80px;
    max-height: calc(100% - 140px);
}

.close-btn {
    display: block;
    background-color: #2856e6;
    color: white;
    padding: 10px 20px;
    text-align: center;
    position: absolute;
    bottom: 10px;
    left: 20px;
    right: 20px;
    cursor: pointer;
    border-radius: 5px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.arcep-link {
    margin-top: 20px;
    font-size: 14px;
}

.arcep-link a {
    color: #ffffff;
    text-decoration: underline;
}

.arcep-link a:hover {
    text-decoration: none;
}

/* Bouton */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2856e6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #1c3fa3;
}

/* Styles pour la page de limite dépassée */
.limit-exceeded h1 {
    color: #ff8000; /* Orange pour attirer l'attention */
    margin-bottom: 20px;
}

.limit-message {
    color: white;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.limit-exceeded .btn {
    background-color: #ff8000;
    color: white;
    font-weight: bold;
    padding: 15px 30px;
    font-size: 16px;
}

.limit-exceeded .btn:hover {
    background-color: #e67300;
}

/* ... (autres styles) ... */

/* Ajout de styles pour l'affichage mobile */
@media screen and (max-width: 768px) {
    .wrapper {
        width: 100%;
        padding: 10px;
    }

    .form-section {
        padding: 20px;
    }

    .form-section input[type="text"] {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }

    .operators {
        gap: 10px;
        justify-content: space-between;
    }

    .operator {
        width: calc(50% - 10px);  /* Deux opérateurs par ligne sur les écrans moyens */
    }

    .operator img {
        width: 50px;
        height: 50px;
    }

    .operator p {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    .form-section label {
        font-size: 14px;
    }

    .form-section input[type="text"] {
        font-size: 14px;
        padding: 10px;
    }

    .form-section input[type="submit"] {
        font-size: 14px;
        padding: 10px 20px;
    }

    .section h2 {
        font-size: 18px;
    }

    .operators {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .operator {
        width: calc(50% - 5px);  /* Deux opérateurs par ligne sur les petits écrans */
        padding: 5px;
        margin-bottom: 10px;
    }

    .operator img {
        width: 40px;  /* Réduit �� 40px pour les très petits écrans */
        height: 40px;
    }

    .operator p {
        font-size: 11px;
    }
}

/* Ajout d'une media query spécifique pour les très petits écrans (comme l'iPhone SE) */
@media screen and (max-width: 320px) {
    .operator {
        width: calc(50% - 5px);  /* Maintient deux opérateurs par ligne */
    }

    .operator img {
        width: 36px;  /* Encore plus petit pour les très petits écrans */
        height: 36px;
    }

    .operator p {
        font-size: 10px;
    }
}

/* ... (autres styles existants) ... */

.address-autocomplete-link {
    margin-top: 20px;
    font-size: 14px;
}

.address-autocomplete-link a {
    color: #ffffff;
    text-decoration: underline;
}

.address-autocomplete-link a:hover {
    text-decoration: none;
}

/* Nouveaux styles extraits de index.html */
#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#suggestions div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

#suggestions div:hover {
    background-color: #f0f0f0;
}

.autocomplete-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
}

#address, #imb_code {
    width: 100%;
    padding: 15px;
    padding-right: 40px; /* Ajout de cette ligne */
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 18px;
    box-sizing: border-box;
}

#map {
    height: 400px;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: none;
}

#eligibility-info {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background-color: #2856e6;
    color: white;
    border-radius: 10px;
}

#eligibility-info h2 {
    color: white;
    margin-bottom: 15px;
}

#restart-btn {
    display: block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff8000;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.imb-popup {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
}

.custom-popup .leaflet-popup-content-wrapper {
    background: white;
    color: #333;
    font-size: 14px;
    line-height: 24px;
    border-radius: 5px;
}

.custom-popup .leaflet-popup-content-wrapper a {
    color: rgba(255,128,0,0.8);
}

.custom-popup .leaflet-popup-tip-container {
    width: 30px;
    height: 15px;
}

.custom-popup .leaflet-popup-tip {
    background: white;
}

.input-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.geolocate-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #2856e6;
    cursor: pointer;
    font-size: 18px;
}

#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#suggestions div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

#suggestions div:last-child {
    border-bottom: none;
}

#suggestions div:hover {
    background-color: #f0f0f0;
}

/* Assurez-vous que ces styles sont présents et non écrasés par d'autres règles */
#address, #imb_code {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 18px;
    box-sizing: border-box;
}

.or-separator {
    margin: 20px 0;
    font-size: 18px;
    color: white;
    font-weight: bold;
}

.wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.form-section, .result-section {
    width: 100%;
    margin: 0 auto 30px;
    border-radius: 10px;
    box-sizing: border-box;
}

.form-section {
    background-color: #2856e6;
    padding: 40px;
    position: relative;
}

.result-section {
    background-color: #fff;
    padding: 40px;
}

.result-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.info-box {
    background-color: #ffffff;
    color: #333333;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff8000;
    flex: 1 1 calc(33% - 20px);
    min-width: 200px;
}

.info-box p {
    margin: 0;
}

.info-box strong {
    font-weight: bold;
}

.result-title {
    color: white;
}

/* Ajoutez ces styles à la fin du fichier */
#map-instruction {
    display: none;
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #ff8000;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    text-decoration: none;
}

.back-button:hover {
    color: #ff8000;
}

.custom-div-icon {
    background: none;
    border: none;
}
.custom-div-icon .marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: #ff7800;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
}
.custom-div-icon .marker-pin::after {
    content: '';
    width: 24px;
    height: 24px;
    margin: 3px 0 0 3px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
}

/* Ajoutez ces nouvelles règles à la fin du fichier */
@media screen and (max-width: 480px) {
    #address, #imb_code {
        font-size: 14px;
        padding-right: 35px; /* Ajustement pour les petits écrans */
    }

    .geolocate-icon {
        font-size: 16px; /* Réduire légèrement la taille de l'icône */
        right: 10px; /* Rapprocher l'icône du bord droit */
    }
}

@media screen and (max-width: 320px) {
    #address, #imb_code {
        font-size: 12px;
        padding-right: 30px; /* Ajustement supplémentaire pour les très petits écrans */
    }

    .geolocate-icon {
        font-size: 14px;
        right: 8px;
    }
}

/* Désactiver le zoom sur les inputs pour iOS */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  font-size: 16px;  /* Taille minimale pour éviter le zoom automatique sur iOS */
  max-width: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Empêcher le zoom sur double-tap pour les éléments non-input */
* {
  touch-action: manipulation;
}

.install-app-link {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
}

.install-app-link a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff8000;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.install-app-link a:hover {
    background-color: #e67300;
}

/* Ajuster pour les écrans mobiles */
@media screen and (max-width: 768px) {
    .install-app-link {
        margin-top: 15px;
    }

    .install-app-link a {
        padding: 8px 16px;
        font-size: 14px;
    }
}
