:root {
    color-scheme: light;
    --ip-navy-950: #071b2d;
    --ip-navy-900: #0b2742;
    --ip-navy-800: #123b60;
    --ip-blue-700: #0f5fbf;
    --ip-blue-600: #1769d2;
    --ip-blue-100: #e8f1fc;
    --ip-slate-900: #172033;
    --ip-slate-700: #344054;
    --ip-slate-600: #475467;
    --ip-slate-500: #667085;
    --ip-slate-300: #d0d5dd;
    --ip-slate-200: #e4e7ec;
    --ip-slate-100: #f2f4f7;
    --ip-white: #ffffff;
    --ip-warning: #b54708;
    --ip-error: #b42318;
    --ip-success: #067647;
    --ip-shadow: 0 18px 48px rgba(7, 27, 45, 0.18);
    --ip-radius-lg: 18px;
    --ip-radius-md: 12px;
    --ip-header-height: 64px;
    --ip-panel-width: 400px;
    --ip-panel-offset: 436px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

.map-page {
    position: relative;
    width: 100%;
    height: min(720px, 72vh);
    min-height: 560px;
    overflow: hidden;
    background: var(--ip-slate-100);
    border-radius: var(--ip-radius-lg);
}

#map {
    position: absolute;
    inset: 0;
}

.map-search {
    position: absolute;
    z-index: 30;
    top: 18px;
    left: 50%;
    width: min(620px, calc(100% - 36px));
    transform: translateX(-50%);
}

.address-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(11, 39, 66, 0.14);
    border-radius: 16px;
    box-shadow: var(--ip-shadow);
    backdrop-filter: blur(10px);
}

.address-search-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.address-search-input {
    min-width: 0;
    height: 46px;
    padding: 0 15px;
    border: 0;
    color: var(--ip-slate-900);
    background: transparent;
    font-size: 16px;
}

.address-search-input::placeholder {
    color: var(--ip-slate-500);
}

.address-search-input:focus {
    outline: 0;
}

.address-search-button {
    min-width: 112px;
    height: 46px;
    padding: 0 18px;
    color: var(--ip-white);
    background: var(--ip-blue-700);
    border: 0;
    border-radius: 11px;
    font-weight: 700;
}

.address-search-button:hover:not(:disabled) {
    background: #0d53a7;
}

.address-search-button:disabled {
    cursor: progress;
    opacity: 0.72;
}

.address-search-feedback {
    min-height: 20px;
    margin: 6px 10px 0;
    color: var(--ip-slate-700);
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.address-search-feedback[data-error="true"] {
    color: var(--ip-error);
}

.address-search-results {
    max-height: min(360px, calc(100dvh - 180px));
    padding: 6px;
    margin: 3px 0 0;
    overflow-y: auto;
    list-style: none;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(11, 39, 66, 0.14);
    border-radius: 14px;
    box-shadow: var(--ip-shadow);
}

.address-search-results[hidden] {
    display: none;
}

.address-result {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 11px 12px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 10px;
}

.address-result:hover,
.address-result:focus-visible {
    background: var(--ip-blue-100);
}

.address-result__label {
    font-size: 14px;
    font-weight: 700;
}

.address-result__context {
    color: var(--ip-slate-600);
    font-size: 12px;
}

.map-status {
    position: absolute;
    z-index: 20;
    bottom: 22px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: min(520px, calc(100% - 454px));
    min-height: 40px;
    padding: 9px 13px;
    color: var(--ip-slate-700);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(11, 39, 66, 0.14);
    border-radius: 11px;
    box-shadow: 0 10px 30px rgba(7, 27, 45, 0.13);
    font-size: 13px;
    font-weight: 650;
    backdrop-filter: blur(8px);
}

.map-status__dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ip-slate-500);
}

.map-status[data-tone="loading"] .map-status__dot {
    background: var(--ip-blue-600);
    animation: statusPulse 1.15s ease-in-out infinite;
}

.map-status[data-tone="success"] .map-status__dot {
    background: var(--ip-success);
}

.map-status[data-tone="warning"] .map-status__dot {
    background: var(--ip-warning);
}

.map-status[data-tone="error"] .map-status__dot {
    background: var(--ip-error);
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.45; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.15); }
}

.map-legend {
    position: absolute;
    z-index: 20;
    bottom: 72px;
    left: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px 14px;
    max-width: min(520px, calc(100% - 454px));
    padding: 10px 12px;
    color: var(--ip-slate-700);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(11, 39, 66, 0.11);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(7, 27, 45, 0.1);
    font-size: 12px;
    font-weight: 650;
    backdrop-filter: blur(8px);
}

.map-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.map-legend__item--note {
    width: 100%;
    color: var(--ip-slate-600);
    font-size: 11px;
    font-weight: 600;
}

.map-legend__swatch {
    width: 15px;
    height: 15px;
    border: 1.5px solid #667085;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.42);
}

.map-legend__swatch--dvf {
    border-color: #0f5fbf;
    background: rgba(23, 105, 210, 0.34);
}

.map-legend__swatch--unavailable {
    border-color: #b45309;
    background: rgba(217, 119, 6, 0.25);
}

.parcel-panel {
    position: absolute;
    z-index: 25;
    top: 18px;
    right: 18px;
    width: min(var(--ip-panel-width), calc(100% - 36px));
    max-height: calc(100% - 36px);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(11, 39, 66, 0.14);
    border-radius: var(--ip-radius-lg);
    box-shadow: var(--ip-shadow);
    transform: translateX(calc(100% + 36px));
    transition: transform 220ms ease;
    backdrop-filter: blur(10px);
}

.parcel-panel.is-open {
    transform: translateX(0);
}

.parcel-panel__header {
    display: flex;
    justify-content: flex-end;
    min-height: 44px;
    padding: 8px 8px 0;
}

.parcel-panel__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--ip-slate-700);
    background: var(--ip-slate-100);
    border: 0;
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
}

.parcel-panel__close:hover {
    background: var(--ip-slate-200);
}

.parcel-panel__body {
    max-height: min(620px, calc(72vh - 96px));
    padding: 0 22px 24px;
    overflow-y: auto;
}

.parcel-panel-empty {
    padding: 4px 0 12px;
}

.parcel-panel-empty h2,
.parcel-result__title {
    margin: 0;
    color: var(--ip-navy-950);
    font-size: 24px;
    letter-spacing: -0.025em;
}

.parcel-panel-empty p {
    margin: 10px 0 0;
    color: var(--ip-slate-600);
    line-height: 1.55;
}

.parcel-result__eyebrow {
    margin: 0 0 5px;
    color: var(--ip-blue-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.parcel-result__copy {
    padding: 0;
    margin: 8px 0 20px;
    color: var(--ip-blue-700);
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 700;
}

.parcel-result__copy:hover {
    text-decoration: underline;
}

.parcel-result__reference-details {
    margin: 7px 0 0;
    color: var(--ip-slate-600);
    font-size: 12.5px;
    line-height: 1.45;
}

.parcel-street-view {
    margin: -8px 0 18px;
}

.parcel-street-view__link {
    color: var(--ip-blue-700);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.parcel-street-view__link:hover,
.parcel-street-view__link:focus-visible {
    text-decoration: underline;
}

.parcel-street-view__note {
    margin: 5px 0 0;
    color: var(--ip-slate-500);
    font-size: 11.5px;
    line-height: 1.45;
}

.result-cta {
    padding: 14px;
    margin-top: 12px;
    background: var(--ip-blue-100);
    border: 1px solid #b9d4f6;
    border-radius: 12px;
}

.result-cta__button {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    color: var(--ip-white);
    background: var(--ip-blue-700);
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 760;
    line-height: 1.35;
}

.result-cta__button:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.result-cta__availability {
    margin: 8px 0 0;
    color: var(--ip-slate-600);
    font-size: 11.5px;
    font-weight: 650;
    text-align: center;
}

.dvf-result {
    padding-top: 18px;
    border-top: 1px solid var(--ip-slate-200);
}

.dvf-result h3 {
    margin: 0 0 13px;
    color: var(--ip-navy-900);
    font-size: 17px;
}

.dvf-result__list {
    display: grid;
    grid-template-columns: minmax(115px, 0.85fr) minmax(0, 1.15fr);
    gap: 8px 14px;
    margin: 0;
}

.dvf-result__list dt {
    color: var(--ip-slate-600);
    font-size: 13px;
}

.dvf-result__list dd {
    margin: 0;
    color: var(--ip-slate-900);
    font-size: 13px;
    font-weight: 720;
    text-align: right;
}

.result-message {
    padding: 13px 14px;
    margin-top: 16px;
    border-radius: 11px;
    border: 1px solid var(--ip-slate-200);
    background: var(--ip-slate-100);
}

.result-message strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ip-navy-900);
    font-size: 13px;
}

.result-message p {
    margin: 0;
    color: var(--ip-slate-700);
    font-size: 12.5px;
    line-height: 1.5;
}

.result-message--warning {
    border-color: #fedf89;
    background: #fffaeb;
}

.result-message--warning strong {
    color: #93370d;
}

.result-message--error {
    border-color: #fecdca;
    background: #fef3f2;
}

.result-message--error strong {
    color: var(--ip-error);
}

.dvf-result__source,
.parcel-result__legal {
    color: var(--ip-slate-500);
    font-size: 11.5px;
    line-height: 1.5;
}

.dvf-result__source {
    margin: 16px 0 0;
}

.parcel-result__legal {
    padding-top: 16px;
    margin: 18px 0 0;
    border-top: 1px solid var(--ip-slate-200);
}

.map-fatal-error {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 30px;
    color: var(--ip-error);
    background: var(--ip-white);
    font-weight: 700;
    text-align: center;
}

.map-fatal-error[hidden] {
    display: none;
}

.maplibregl-ctrl-bottom-right {
    bottom: 8px;
    right: 8px;
}

.maplibregl-ctrl-group {
    overflow: hidden;
    border-radius: 11px;
    box-shadow: 0 8px 24px rgba(7, 27, 45, 0.18);
}

.maplibregl-ctrl-attrib {
    font-size: 10px;
}

@media (min-width: 900px) {
    .map-search {
        left: calc((100% - var(--ip-panel-offset)) / 2);
        width: min(620px, calc(100% - var(--ip-panel-offset) - 36px));
    }

    .map-page.has-open-panel .maplibregl-ctrl-bottom-right {
        right: calc(var(--ip-panel-width) + 26px);
    }
}

@media (max-width: 899px) {
    .map-page {
        height: min(680px, 68vh);
        min-height: 520px;
    }

    .map-search {
        top: 12px;
        width: calc(100% - 24px);
    }

    .address-search-form {
        grid-template-columns: minmax(0, 1fr) auto;
        border-radius: 14px;
    }

    .address-search-button {
        min-width: 94px;
        padding: 0 12px;
        font-size: 13px;
    }

    .map-legend {
        bottom: 64px;
        left: 10px;
        max-width: calc(100% - 64px);
        padding: 8px 10px;
    }

    .map-status {
        bottom: 12px;
        left: 10px;
        max-width: calc(100% - 64px);
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .parcel-panel {
        top: auto;
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        left: max(8px, env(safe-area-inset-left));
        width: auto;
        max-height: min(62vh, 560px);
        max-height: min(62dvh, 560px);
        border-radius: 18px;
        transform: translateY(calc(100% + 18px));
    }

    .parcel-panel.is-open {
        transform: translateY(0);
    }

    .parcel-panel__body {
        max-height: calc(min(62vh, 560px) - 48px);
        max-height: calc(min(62dvh, 560px) - 48px);
        padding: 0 18px 22px;
    }

    .maplibregl-ctrl-bottom-right {
        bottom: 112px;
    }

    .map-page.has-open-panel .map-status,
    .map-page.has-open-panel .map-legend,
    .map-page.has-open-panel .maplibregl-ctrl-bottom-right {
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 520px) {
    .map-page {
        height: min(640px, 68vh);
        min-height: 500px;
        border-radius: 14px;
    }

    .address-search-input {
        height: 43px;
        padding: 0 10px;
        font-size: 14px;
    }

    .address-search-button {
        min-width: 83px;
        height: 43px;
        padding: 0 9px;
        font-size: 12px;
    }

    .map-legend {
        display: none;
    }

    .map-status {
        bottom: 10px;
    }

    .maplibregl-ctrl-bottom-right {
        bottom: 66px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Catalogue cadastral des personnes morales */
.holder-result {
    padding-top: 18px;
    border-top: 1px solid var(--ip-slate-200);
}

.holder-result h3 {
    margin: 0;
    color: var(--ip-navy-900);
    font-size: 17px;
}

.holder-result__intro {
    margin: 7px 0 13px;
    color: var(--ip-slate-600);
    font-size: 12.5px;
    line-height: 1.5;
}

.holder-list {
    display: grid;
    gap: 10px;
}

.holder-card {
    padding: 12px 13px;
    background: #f8fafc;
    border: 1px solid var(--ip-slate-200);
    border-radius: 11px;
}

.holder-card__name {
    margin: 0;
    color: var(--ip-navy-950);
    font-size: 14px;
    line-height: 1.35;
}

.holder-card__meta {
    margin: 5px 0 0;
    color: var(--ip-slate-600);
    font-size: 11.5px;
    line-height: 1.45;
}

.holder-rights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 9px 0 0;
    list-style: none;
}

.holder-right {
    padding: 4px 7px;
    color: var(--ip-slate-700);
    background: var(--ip-slate-100);
    border: 1px solid var(--ip-slate-200);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.holder-right--owner {
    color: #075985;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.holder-more {
    margin-top: 10px;
}

.holder-more summary {
    padding: 10px 12px;
    color: var(--ip-blue-700);
    background: var(--ip-blue-100);
    border: 1px solid #c8ddf7;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 740;
}

.holder-more[open] summary {
    margin-bottom: 10px;
}

.holder-list--remaining {
    padding-bottom: 2px;
}

.holder-result__source {
    margin: 14px 0 0;
    color: var(--ip-slate-500);
    font-size: 11.5px;
    line-height: 1.5;
}

.holder-no-data {
    padding-top: 2px;
}

.dvf-result + .holder-result,
.dvf-result + .holder-no-data,
.dvf-result + .result-message,
.result-message + .holder-result,
.result-message + .holder-no-data,
.result-message + .result-message {
    margin-top: 18px;
}

.result-cta__button[href] {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.result-cta__button[href]:hover,
.result-cta__button[href]:focus-visible {
    filter: brightness(.94);
    outline: 3px solid rgba(36, 114, 189, .2);
    outline-offset: 2px;
}

/* IP_UNIFIED_SEARCH_STYLES_V1 */
.map-search [hidden] { display: none !important; }
.map-search { width: min(680px, calc(100% - 36px)); }
.address-search-form:focus-within { outline: 2px solid var(--ip-blue-600); outline-offset: 2px; }
.unified-search-heading { padding: 10px 12px 5px; font-size: 12px; font-weight: 800; color: var(--ip-blue-700); }
.unified-search-note, .unified-search-warning { padding: 6px 12px; font-size: 12px; line-height: 1.4; color: var(--ip-slate-600); }
.unified-search-warning { color: var(--ip-warning); }
.unified-pagination { background: var(--ip-blue-100); }
.unified-company-return { max-width: 100%; margin-top: 6px; padding: 7px 12px; background: white; color: var(--ip-blue-700); border: 1px solid var(--ip-slate-300); border-radius: 10px; font-size: 12px; cursor: pointer; }
@media (min-width: 900px) {
    .map-search { left: 50%; }
    .map-page.has-open-panel .map-search {
        left: calc((100% - var(--ip-panel-offset)) / 2);
        width: calc(100% - var(--ip-panel-offset) - 36px);
    }
}
@media (max-width: 899px) { .map-search { width: calc(100% - 24px); } }
@media (max-width: 420px) {
    .address-search-input { padding: 0 8px; }
    .address-search-button { min-width: 76px; padding: 0 8px; font-size: 12px; }
}
