/* =========================================================
   Base
   ========================================================= */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: sans-serif;
}

* {
    box-sizing: border-box;
}

/* =========================================================
   Carte
   ========================================================= */

.layout {
    width: 100%;
    height: 100%;
}

.map-container,
#map {
    width: 100%;
    height: 100%;
}

/* =========================================================
   Panneau flottant
   ========================================================= */

.panel {
    position: absolute;
    z-index: 1000;
    top: 15px;
    right: 15px;

    width: 350px;
    max-width: calc(100% - 30px);
    max-height: calc(100% - 30px);
    overflow-y: auto;

    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px #0003;
}

/* En-tête */

.panel-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.panel-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.panel-header p {
    margin: 6px 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

/* =========================================================
   Sections
   ========================================================= */

.section {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

.section h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 600;
}

.help {
    margin: 8px 0;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
}

/* =========================================================
   Champs
   ========================================================= */

label {
    display: block;
    margin: 12px 0 6px;
    font-size: 14px;
}

select,
input {
    width: 100%;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    font-family: inherit;
    font-size: 14px;
}

select:focus,
input:focus {
    outline: none;
    border-color: #3388ff;
    box-shadow: 0 0 0 2px #3388ff22;
}

/* Coordonnées */

.coordinates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 12px;
}

.coordinate-field {
    min-width: 0;
}

/* =========================================================
   Boutons
   ========================================================= */

button {
    width: 100%;
    margin-top: 12px;
    padding: 11px;

    border: 0;
    border-radius: 5px;
    background: #3388ff;
    color: white;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

button:hover:not(:disabled) {
    background: #2678e8;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bouton de dessin : même apparence que les autres outils */

#drawArea {
    margin-top: 8px;
}

/* =========================================================
   Sélection et statut
   ========================================================= */

#selection {
    margin-top: 10px;
    padding: 9px;
    border-radius: 5px;
    background: #f7f7f7;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#status {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* =========================================================
   Résultats
   ========================================================= */

.results {
    margin-top: 14px;
}

/* =========================================================
   Petits écrans
   ========================================================= */

@media (max-width: 480px) {
    .panel {
        top: 10px;
        right: 10px;
        width: 340px;
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
        padding: 13px;
    }
}
