/* Styles de la carte, de la recherche d’adresse et de ses contrôles. */

.account-icon {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
}

.account-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 20px;
    height: 11px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    transform: translateX(-50%);
}

.app-main {
    height: calc(100vh - 86px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 408px;
}

@media (min-width: 901px) {
    .app-shell:has(.map-shell) {
        height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .app-shell:has(.map-shell) > div:has(> #_pages_content),
    .app-shell:has(.map-shell) #_pages_content,
    .app-shell:has(.map-shell) .map-shell {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .app-shell:has(.map-shell) .app-main {
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
    }
}

.app-shell:has(.account-page) {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-shell:has(.account-page) > div:has(> #_pages_content),
.app-shell:has(.account-page) #_pages_content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.app-shell:has(.account-page) .account-page {
    min-height: 100%;
}

.map-panel {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.network-map {
    width: 100%;
    height: 100%;
    background: #dfe6ec;
}

.address-search {
    position: absolute;
    z-index: 1000;
    top: 18px;
    left: 18px;
    width: min(440px, calc(100% - 82px));
}

.address-input-wrap {
    position: relative;
    filter: drop-shadow(0 8px 20px rgba(17, 24, 39, 0.18));
}

.search-icon {
    position: absolute;
    top: 15px;
    left: 16px;
    width: 14px;
    height: 14px;
    border: 2px solid #667085;
    border-radius: 50%;
}

.search-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    background: #667085;
    transform: rotate(45deg);
    right: -5px;
    bottom: -3px;
}

.address-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 10px 44px 10px 44px;
    outline: 0;
    background: rgba(255, 255, 255, 0.97);
    color: var(--ink);
    font-size: 0.93rem;
}

.address-input:focus {
    border-color: #98a2b3;
    box-shadow: 0 0 0 3px rgba(102, 112, 133, 0.16);
}

.address-search-spinner {
    position: absolute;
    top: 15px;
    right: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 112, 133, 0.22);
    border-top-color: #475467;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.86);
    transition: opacity 120ms ease, transform 120ms ease;
}

.address-search-spinner--visible {
    opacity: 1;
    transform: scale(1);
    animation: search-spinner-rotate 700ms linear infinite;
}

@keyframes search-spinner-rotate {
    to {
        transform: scale(1) rotate(360deg);
    }
}

.address-suggestions {
    margin-top: 7px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.suggestion-button {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: rgba(255, 255, 255, 0.98);
    text-align: left;
    cursor: pointer;
}

.suggestion-button:hover,
.suggestion-button:focus {
    background: #f6f8fa;
}

.suggestion-button:last-child {
    border-bottom: 0;
}

.suggestion-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.suggestion-kind {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 6px;
    background: #eef2f6;
    color: #475467;
    font-size: 0.67rem;
    font-weight: 700;
}

.suggestion-label {
    min-width: 0;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.suggestion-context {
    color: var(--muted);
    font-size: 0.74rem;
}

.address-status {
    margin-top: 7px;
    display: inline-block;
    padding: 5px 9px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.9);
    color: #475467;
    font-size: 0.75rem;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.1);
}

.address-status:empty {
    display: none;
}

.map-legend-tools {
    position: absolute;
    z-index: 900;
    left: 18px;
    bottom: 28px;
    display: flex;
    align-items: end;
    gap: 8px;
}

.map-legend {
    position: relative;
    width: 230px;
    padding: 14px 16px;
    border: 1px solid rgba(217, 222, 231, 0.9);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
}

.basemap-selector {
    position: relative;
    display: flex;
    align-items: end;
}

.basemap-toggle {
    width: 40px;
    height: 40px;
    overflow: hidden;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.18);
    cursor: pointer;
}

.basemap-toggle-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.basemap-toggle:hover,
.basemap-toggle:focus-visible {
    outline: 0;
    border-color: #d9363e;
}

.basemap-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    width: 156px;
    gap: 3px;
    padding: 6px;
    border: 1px solid rgba(217, 222, 231, 0.95);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.basemap-selector::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    width: 156px;
    height: 8px;
}

.basemap-selector:hover .basemap-menu,
.basemap-selector:focus-within .basemap-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.basemap-option {
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.basemap-option:hover,
.basemap-option:focus-visible {
    outline: 0;
    background: rgba(52, 64, 84, 0.08);
    color: #17202a;
}

.basemap-option.is-active {
    background: #fff0f1;
    color: #b42318;
}

.legend-title {
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.legend-items {
    position: relative;
    display: grid;
    gap: 6px;
}

.legend-categories {
    display: grid;
    gap: 7px;
}

.legend-category-button {
    width: 100%;
    min-height: 32px;
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475467;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.legend-category-button:hover,
.legend-category-button:focus {
    border-color: #cbd5e1;
    background: rgba(52, 64, 84, 0.08);
    color: #17202a;
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.12);
    outline: 0;
    transform: translateX(2px);
}

.legend-category-button:hover .legend-chevron,
.legend-category-button:focus .legend-chevron {
    color: #17202a;
    transform: translateX(2px);
}

.legend-chevron {
    justify-self: end;
    color: #98a2b3;
    font-size: 0.86rem;
    font-weight: 800;
}

.legend-detail-panel {
    position: absolute;
    left: calc(100% + 12px);
    bottom: 0;
    width: 245px;
    padding: 13px 15px;
    border: 1px solid rgba(217, 222, 231, 0.9);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
}

.legend-detail-title {
    margin-bottom: 8px;
    color: #17202a;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.legend-checklist {
    display: grid;
    gap: 6px;
}

.legend-checklist-label {
    display: grid !important;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    margin: 0;
    cursor: pointer;
}

.legend-checkbox {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: #344054;
    cursor: pointer;
}

.legend-checklist-label:has(.legend-checkbox:not(:checked)) .legend-item {
    opacity: 0.38;
    text-decoration: line-through;
}

.legend-item {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 22px;
    color: #475467;
    font-size: 0.72rem;
    line-height: 1.25;
}

.legend-label-with-source {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.legend-source-label {
    color: #98a2b3;
}

.legend-line {
    display: inline-block;
    width: 27px;
    justify-self: center;
    border-radius: 99px;
}

.legend-network-icon {
    display: inline-block;
    width: 27px;
    height: 4px;
    justify-self: center;
    border-radius: 99px;
    background: #d14c8b;
}

.legend-enedis-hta-icon {
    display: inline-block;
    width: 27px;
    height: 3px;
    justify-self: center;
    border-radius: 99px;
    background: #0f766e;
    box-shadow: 0 5px 0 #a16207;
}

.legend-enedis-hta-line {
    height: 3px;
}

.legend-enedis-hta-souterrain {
    background-color: transparent !important;
    background-image: repeating-linear-gradient(
        90deg,
        currentColor 0 7px,
        transparent 7px 12px
    );
    color: #a16207;
}

.legend-substation-square {
    display: inline-block;
    width: 13px;
    height: 13px !important;
    justify-self: center;
    border: 1.5px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.18);
}

.legend-status-dot {
    width: 11px;
    height: 11px;
    justify-self: center;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.legend-substation-item,
.legend-datacenter-item {
    margin-top: 5px;
    padding-top: 7px;
    border-top: 1px solid #e5e7eb;
}

.legend-substation {
    position: relative;
    width: 14px;
    height: 14px;
    justify-self: center;
    border: 1.5px solid #fff;
    border-radius: 4px;
    background: #d14c8b;
    box-shadow: 0 0 0 1px #98a2b3;
}

.legend-substation::before,
.substation-marker-bolt {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 58%;
    background: #fff;
    transform: translate(-50%, -50%);
    clip-path: polygon(
        52% 0%,
        12% 52%,
        40% 52%,
        22% 100%,
        86% 36%,
        56% 36%
    );
}

.legend-datacenter {
    position: relative;
    width: 24px;
    height: 16px;
    justify-self: center;
}

.legend-datacenter::before {
    content: "";
    position: absolute;
    inset: 3px 2px 2px;
    border: 1.5px solid #0f766e;
    border-radius: 4px;
    background: rgba(20, 184, 166, 0.22);
}

.legend-datacenter::after {
    content: "";
    position: absolute;
    right: 1px;
    top: 0;
    width: 9px;
    height: 9px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: #0f766e;
    box-shadow: 0 0 0 1px #0f766e;
}

.substation-marker {
    position: relative;
    display: block;
    border-style: solid;
    border-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.4);
}

.maplibregl-popup-content {
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
}

.feature-popup {
    display: grid;
    gap: 2px;
    max-width: 260px;
}

.feature-popup strong {
    color: #17202a;
    font-size: 0.78rem;
    line-height: 1.2;
}

.feature-popup span {
    color: #667085;
    font-size: 0.68rem;
    line-height: 1.25;
}

.coordinate-copy-popup,
.measurement-popup-content {
    display: grid;
    gap: 2px;
}

.coordinate-copy-popup strong,
.measurement-popup-content strong {
    color: #17202a;
    font-size: 0.78rem;
    line-height: 1.2;
}

.coordinate-copy-popup span {
    color: #667085;
    font-size: 0.68rem;
    line-height: 1.25;
}

.maplibregl-ctrl-top-right {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.maplibregl-ctrl-measure button {
    color: #17202a;
    display: grid;
    place-items: center;
}

.maplibregl-ctrl-measure .measure-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.3;
}

.maplibregl-ctrl-measure .measure-toggle.is-active {
    background: #17202a;
    color: #ffffff;
}

.map-note {
    position: absolute;
    z-index: 900;
    right: 12px;
    bottom: 8px;
    color: #475467;
    font-size: 0.67rem;
    text-shadow: 0 1px 2px white;
}

