/* ============================================================
   Communauté Urbaine de Dunkerque — Design system extranet
   Coexiste avec Bootstrap 5 chargé par le SDK Kiosc.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600;700&display=swap');

:root {
    --primary-blue: #26468F;
    --primary-blue-hover: #1d3670;
    --header-teal: #37A3CD;
    --card-text: #16414D;
    --card-border: #D7EDF2;
    --card-bg: #ffffff;
    --card-active-bg: #E8F4F8;
    --card-active-border: #37A3CD;
    --hero-bg: #E5EBF8;
    --white: #ffffff;
    --grey-text: #666666;
    --tag-bg: #E5EBF8;
    --tag-text: #26468F;
    --error: #B91C1C;
    --error-bg: #FEF2F2;
    --warn: #856404;
    --warn-bg: #FFF3CD;
    --warn-border: #FFECB5;
    --success: #15803D;
    --success-bg: #DCFCE7;
    --font-main: 'Poppins', Arial, sans-serif;
}

html, body {
    font-family: var(--font-main);
    color: var(--card-text);
    background-color: var(--white);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > * { font-family: var(--font-main); }

main, [role="main"] { flex: 1; }

img { max-width: 100%; height: auto; }

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

/* ============ SKIP LINK (RGAA) ============ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary-blue);
    color: var(--white);
    padding: 8px 16px;
    z-index: 1000;
    font-size: 14px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}
.skip-link:focus { top: 0; }

/* ============================================================
   HEADER
   ============================================================ */
.cud-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: var(--white);
}
@media (max-width: 768px) {
    .cud-header { position: relative; top: auto; }
}

.header-bar {
    background: var(--header-teal);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 32px;
    min-height: 54px;
    position: relative;
}

.header-logos {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
}
.header-logos:focus-visible {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}
.header-logos img {
    display: block;
    height: 128px;
    width: auto;
}
.header-logos-fallback {
    background: var(--white);
    color: var(--primary-blue);
    padding: 12px 18px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    border-bottom-right-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 30;
}
.header-contact {
    color: var(--white);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.header-contact a {
    color: var(--white);
    text-decoration: underline;
    font-weight: 600;
}
.header-contact a:hover { text-decoration: none; }

.connection-bar {
    background: var(--hero-bg);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 8px 32px;
    position: relative;
}
.connection-bar a,
.connection-bar button {
    color: var(--primary-blue);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.connection-bar a:hover,
.connection-bar button:hover { background: rgba(38, 70, 143, 0.06); }
.connection-bar a.is-current { text-decoration: none; }
.connection-bar .bi { font-size: 16px; }

.header-burger {
    display: none;
    background: var(--header-teal);
    border: 1.5px solid rgba(255,255,255,0.6);
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    position: relative;
    z-index: 30;
}
.header-burger:hover,
.header-burger:active,
.header-burger:focus {
    background: var(--header-teal);
    outline: none;
    border-color: rgba(255,255,255,0.6);
}

/* ============================================================
   HERO TITLE
   ============================================================ */
.category-hero {
    background-color: var(--primary-blue);
    padding: 32px;
    text-align: center;
}
.category-hero h1 {
    font-family: var(--font-main);
    font-weight: 200;
    font-size: 36px;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    line-height: 1.2;
    margin: 0;
}
.category-hero p {
    color: var(--white);
    opacity: 0.9;
    margin: 8px auto 0;
    font-size: 15px;
    max-width: 720px;
}

/* ============ BACK LINK ============ */
.back-link-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    color: var(--card-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover,
.back-link:focus {
    text-decoration: underline;
    color: var(--primary-blue);
}

/* ============================================================
   CONTAINER
   ============================================================ */
.cud-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 32px 60px;
}

/* ============================================================
   STEPPER
   ============================================================ */
.stepper {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0 0 32px;
    padding: 0;
    counter-reset: step;
}
.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    color: var(--grey-text);
    font-size: 14px;
    text-align: center;
}
.stepper-item .num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    background: var(--white);
    color: var(--grey-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    z-index: 2;
    position: relative;
}
.stepper-item .num span { display: block; }
.stepper-item.is-current { color: var(--primary-blue); }
.stepper-item.is-current .num {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}
.stepper-item.is-done { color: var(--header-teal); }
.stepper-item.is-done .num {
    background: var(--header-teal);
    border-color: var(--header-teal);
    color: var(--white);
}
.stepper-item.is-done .num span { display: none; }
.stepper-item.is-done .num::after {
    content: "";
    display: block;
    width: 12px;
    height: 6px;
    border-left: 3px solid var(--white);
    border-bottom: 3px solid var(--white);
    transform: rotate(-45deg) translate(1px, -1px);
}
.stepper-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--card-border);
    z-index: 1;
}
.stepper-item.is-done:not(:last-child)::after {
    background: var(--header-teal);
}
.stepper-label {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}
.stepper-sub {
    font-size: 12px;
    color: var(--grey-text);
    font-weight: 400;
    line-height: 1.2;
}
.stepper-item.is-current .stepper-sub { color: var(--card-text); }

/* ============================================================
   STEP PANELS
   ============================================================ */
.step-panel { display: none; scroll-margin-top: 110px; }
.step-panel.is-active { display: block; }
.block { scroll-margin-top: 110px; }

.step-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--card-text);
    margin-bottom: 20px;
}
.step-title + .step-help { margin-top: -12px; }
.step-help {
    font-size: 15px;
    color: var(--grey-text);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ============================================================
   BLOCKS (sections bleu pâle)
   ============================================================ */
.block {
    background: var(--hero-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}
.block[hidden] { display: none; }

.block-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.block-title .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--header-teal);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   GRILLE TYPES (étape 1) — surcharge radio-button-group du SDK
   ============================================================ */
.radio-button-group { padding: 0; }
.radio-button-group .row { row-gap: 16px; }
.radio-button-group .row > [class*="col-"] { padding: 8px !important; }
.radio-button-group .radio-button.btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 20px 16px !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px !important;
    color: var(--card-text) !important;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1 / 1;
    min-height: 0;
    text-align: center;
    position: relative;
    box-shadow: none;
    overflow: hidden;
}
.radio-button-group .radio-button.btn .type-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.radio-button-group .radio-button.btn .type-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.radio-button-group .radio-button.btn:hover,
.radio-button-group .radio-button.btn:focus {
    background-color: var(--card-active-bg) !important;
    border-color: var(--card-active-border) !important;
    box-shadow: 0 4px 12px rgba(55, 163, 205, 0.15) !important;
    outline: none;
    color: var(--card-text) !important;
}
.radio-button-group .radio-button.btn.active,
.radio-button-group .radio-button.btn[aria-checked="true"],
.radio-button-group .radio-button.btn.radio-button-selected {
    background-color: var(--card-active-bg) !important;
    border-color: var(--card-active-border) !important;
    box-shadow: 0 4px 12px rgba(55, 163, 205, 0.15) !important;
    color: var(--primary-blue) !important;
    font-weight: 600;
}
.radio-button-group .radio-button.btn.radio-button-selected i.bi {
    color: var(--primary-blue);
}
.radio-button-group .radio-button.btn > div,
.radio-button-group .radio-button.btn > .title {
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
    color: var(--card-text);
}
/* Toutes les cartes : texte en bas pour rendu homogène (avec ou sans image). */
.radio-button-group .radio-button.btn {
    justify-content: flex-end;
}
/* Sur les cartes avec image, l'image est rendue après le titre dans le DOM.
   On inverse l'ordre flex pour que le titre apparaisse en bas comme dans
   les cartes sans image. */
.radio-button-group .radio-button.btn .type-image { order: 0; }
.radio-button-group .radio-button.btn .title { order: 1; }
/* Pas d'icône bootstrap placeholder. */
.radio-button-group .radio-button.btn i.bi {
    display: none;
}
.radio-button-group .text-danger { color: var(--error) !important; font-weight: 600; }
@media (max-width: 575px) {
    .radio-button-group .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        width: 50%;
    }
    .radio-button-group .radio-button.btn .type-image {
        min-height: 56px;
    }
}

/* ============================================================
   SOUS-TYPES (liste verticale de cartes radio)
   ============================================================ */
.subtype-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.subtype-list li { list-style: none; margin: 0; padding: 0; }
.subtype-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    min-height: 56px;
    text-align: left;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--card-text);
    cursor: pointer;
    transition: all 0.15s;
}
.subtype-card::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    flex-shrink: 0;
    background: var(--white);
    transition: all 0.15s;
}
.subtype-card:hover {
    background: var(--card-active-bg);
    border-color: var(--header-teal);
}
.subtype-card:hover::before { border-color: var(--header-teal); }
.subtype-card:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}
.subtype-card[aria-checked="true"] {
    background: var(--card-active-bg);
    border-color: var(--card-active-border);
    box-shadow: 0 4px 12px rgba(55, 163, 205, 0.15);
    font-weight: 600;
    color: var(--primary-blue);
}
.subtype-card[aria-checked="true"]::before {
    border-color: var(--card-active-border);
    background: var(--card-active-border);
    box-shadow: inset 0 0 0 3px var(--white);
}

/* ============================================================
   FORM
   ============================================================ */
.form-section { margin-bottom: 32px; }
.form-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--card-border);
}
.form-section:last-of-type { margin-bottom: 0; }

/* Section-title rendu par le SDK */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 24px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--card-border);
}

.field { margin-bottom: 20px; }
.field label,
.field .label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--card-text);
    margin-bottom: 8px;
}
.required-mark { color: var(--error); font-weight: 700; margin-left: 2px; }
.field-help { font-size: 13px; color: var(--grey-text); margin-top: 6px; }

.text-input,
.text-area,
.text-select,
.form-control,
.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--card-border);
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--card-text);
    background: var(--white);
    transition: border-color 0.15s;
}
.text-input::placeholder,
.text-area::placeholder,
.form-control::placeholder { color: #aab; }

.text-input:hover,
.text-area:hover,
.text-select:hover,
.form-control:hover,
.form-select:hover { border-color: #B7D4DC; }

.text-input:focus,
.text-area:focus,
.text-select:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--header-teal);
    outline: 2px solid var(--header-teal);
    outline-offset: -1px;
    box-shadow: none;
}

.text-input[aria-invalid="true"],
.text-area[aria-invalid="true"],
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--error);
    background: var(--error-bg);
}

textarea.form-control,
.text-area { min-height: 110px; resize: vertical; line-height: 1.5; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--card-text);
    margin-bottom: 8px;
}
.form-label.required::after {
    content: " *";
    color: var(--error);
}

.row-2 { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }

.row-postal { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 640px) { .row-postal { grid-template-columns: 130px 1fr; gap: 8px; } }

.field-error,
.invalid-feedback {
    display: none !important;
    align-items: center;
    gap: 6px;
    color: var(--error);
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
}
.field-error.visible,
.is-invalid ~ .invalid-feedback,
.form-check:has(.is-invalid) ~ .invalid-feedback { display: flex !important; }

.form-check:has(#form_accept) {
    margin-top: 1.5rem;
}

/* ============================================================
   LOCATION ACTIONS (boutons SDK locate_me / modify_location)
   ============================================================ */
.loc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 4px 0 20px;
}
@media (max-width: 480px) {
    .loc-actions { grid-template-columns: 1fr; gap: 8px; }
}

.btn.locate_me,
.btn.modify_location,
.btn-loc {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px !important;
    border: 1.5px solid var(--header-teal) !important;
    border-radius: 8px !important;
    background: var(--white) !important;
    color: var(--primary-blue) !important;
    font-family: var(--font-main);
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    min-height: 40px;
    transition: all 0.15s;
}
.btn.locate_me:hover,
.btn.modify_location:hover,
.btn-loc:hover {
    background: var(--card-active-bg) !important;
}
.btn.locate_me .bi,
.btn.modify_location .bi,
.btn-loc .bi { color: var(--header-teal); font-size: 18px; }

/* Détail localisation : input adresse avec icône loupe */
.detail_location .form-group { position: relative; }
.detail_location label.form-label,
.detail_location label.form_label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 6px;
}
.detail_location .form-control-icon {
    position: absolute;
    left: 14px;
    /* label (font 14 * line-height 1.5 ≈ 21px) + margin-bottom 6px + (input 44px / 2)
       - (icône 16px / 2) ≈ 41px */
    top: 41px;
    color: var(--grey-text);
    font-size: 16px;
    pointer-events: none;
    line-height: 1;
    z-index: 1;
}
.detail_location .input-address {
    padding-left: 40px;
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid var(--card-border);
}
.detail_location .input-address:focus {
    border-color: var(--header-teal);
    box-shadow: 0 0 0 3px rgba(46,148,180,0.15);
    outline: none;
}

/* Autocomplete adresses (autoComplete.js 10.x) */
.autocomplete-suggestions {
    list-style: none !important;
    margin: 4px 0 0 !important;
    padding: 4px !important;
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
}
.autocomplete-suggestions li.autocomplete-suggestion {
    list-style: none !important;
    position: relative;
    padding: 10px 12px 10px 38px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--card-text);
    cursor: pointer;
    transition: background 0.1s;
}
.autocomplete-suggestions li.autocomplete-suggestion::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--header-teal);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/></svg>") center/16px no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/></svg>") center/16px no-repeat;
}
.autocomplete-suggestions li.autocomplete-suggestion:hover,
.autocomplete-suggestions li.autocomplete-suggestion[aria-selected="true"] {
    background: var(--card-active-bg);
}
.autocomplete-suggestions li.autocomplete-suggestion mark,
.autocomplete-suggestions li.autocomplete-suggestion .autoComplete_highlight {
    background: transparent !important;
    color: var(--primary-blue) !important;
    font-weight: 700 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}
/* Force le contenu de l'item à se comporter comme une seule ligne — annule
   les éventuels display:inline-block / margin de la CSS autoComplete.js du CDN. */
.autocomplete-suggestions li.autocomplete-suggestion > * { display: inline; margin: 0; padding: 0; }
/* Aucun résultat → on cache complètement le dropdown (pas de message vide). */
.autocomplete-suggestions:not(:has(li.autocomplete-suggestion)) { display: none !important; }

/* Cadre carte (uniformise hauteur + bord arrondi) */
.map-frame {
    position: relative;
    margin: 0 0 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid var(--card-border);
}
.map-frame .interactive_map {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    height: 220px;
}

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-drop {
    border: 1.5px dashed var(--header-teal);
    border-radius: 12px;
    padding: 32px 16px;
    text-align: center;
    color: var(--grey-text);
    background: var(--card-active-bg);
    transition: all 0.15s;
    position: relative;
    cursor: pointer;
}
.file-drop:focus-visible { outline: 2px solid var(--header-teal); outline-offset: 2px; }
.file-drop:hover, .file-drop.is-drag {
    border-style: solid;
    background: #E0EDF1;
    box-shadow: inset 0 0 0 1px var(--header-teal);
}
.file-drop > i.bi { font-size: 36px !important; color: var(--header-teal); display: block; margin: 0 auto 10px; }
.file-drop > div:not(.file-meta) { color: var(--primary-blue); font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.file-drop .file-meta { display: block; margin-top: 6px; font-size: 13px; color: var(--grey-text); }

/* Bouton "Ajouter un fichier" du SDK */
.add-file-button {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: var(--header-teal) !important;
    color: var(--white) !important;
    border: 0 !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: var(--font-main);
    cursor: pointer;
    min-height: 40px;
    margin-bottom: 24px;
}
.add-file-button:hover { background: #2C829A !important; }

[id^="preview-"] .file-item:last-of-type { margin-bottom: 16px; }

/* Preview liste de fichiers (rendu par le SDK form.js.twig) */
[id^="preview-"] { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

[id^="preview-"] > h6 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--grey-text);
}
[id^="preview-"] .file-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

[id^="preview-"] .file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
[id^="preview-"] .file-item:hover {
    border-color: var(--header-teal);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[id^="preview-"] .file-item::before {
    content: "";
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--card-active-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%232E94B4' viewBox='0 0 16 16'><path d='M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0H4z'/><path fill='%23ffffff' d='M9.5 0v3a1.5 1.5 0 0 0 1.5 1.5h3'/></svg>") center/20px no-repeat;
}
[id^="preview-"] .file-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
[id^="preview-"] .file-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--card-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[id^="preview-"] .file-item-size {
    font-size: 12px;
    color: var(--grey-text);
}
[id^="preview-"] .file-item-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--grey-text);
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transition: all 0.15s;
}
[id^="preview-"] .file-item-remove::before {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z'/><path d='M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3h11V2h-11v1z'/></svg>") center/16px no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z'/><path d='M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3h11V2h-11v1z'/></svg>") center/16px no-repeat;
}
[id^="preview-"] .file-item-remove:hover,
[id^="preview-"] .file-item-remove:focus-visible {
    background: #FDECEC;
    color: #C0392B;
    border-color: #F4C7C3;
    outline: none;
}


/* ============================================================
   MAP (Leaflet wrapper)
   ============================================================ */
.cud-map,
.map {
    margin-top: 12px;
    margin-bottom: 24px;
    height: 280px;
    border: 1.5px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.leaflet-container { border-radius: 8px; }

/* ============================================================
   RECAP
   ============================================================ */
.recap-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--hero-bg);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--card-text);
}
.recap-inline .recap-label {
    font-weight: 700;
    color: var(--primary-blue);
    flex-shrink: 0;
}
.recap-inline .recap-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recap-inline .recap-empty { color: var(--grey-text); font-style: italic; }
@media (max-width: 575px) {
    .recap-inline {
        flex-wrap: wrap;
        gap: 4px 8px;
    }
    .recap-inline .recap-label { order: 1; flex: 1; }
    .recap-inline .recap-edit  { order: 2; }
    .recap-inline .recap-value {
        order: 3;
        flex: 0 0 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

.recap-block {
    background: var(--hero-bg);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--card-text);
}
.recap-block .recap-title {
    display: block;
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}
.recap-block .recap-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid rgba(38, 70, 143, 0.1);
}
.recap-block .recap-row:first-of-type { border-top: 0; padding-top: 4px; }
.recap-block .recap-row-icon {
    flex-shrink: 0;
    color: var(--header-teal);
    display: inline-flex;
    align-items: center;
}
.recap-block .recap-row .recap-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recap-block .recap-empty { color: var(--grey-text); font-style: italic; }

.recap-edit {
    background: transparent;
    border: 0;
    color: var(--primary-blue);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    padding: 4px 8px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}
.recap-edit:hover { text-decoration: none; background: rgba(38, 70, 143, 0.06); }

/* ============================================================
   AUTH BLOCK (étape 3)
   ============================================================ */
.auth-block {
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--hero-bg);
    border-bottom: 1px solid var(--card-border);
    list-style: none;
    margin: 0;
    padding: 0;
}
.auth-tab {
    background: transparent;
    border: 0;
    padding: 16px 12px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--card-text);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.15s;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-align: center;
    text-decoration: none;
}
.auth-tab .bi { color: var(--header-teal); font-size: 18px; }
.auth-tab:hover { background: rgba(255,255,255,.55); }
.auth-tab[aria-selected="true"] {
    color: var(--primary-blue);
    background: var(--white);
    border-bottom-color: var(--primary-blue);
}
.auth-tab[aria-selected="true"] .bi { color: var(--primary-blue); }
.auth-panel { padding: 24px; }
.auth-panel[hidden] { display: none; }
.auth-panel-intro {
    font-size: 14px;
    color: var(--grey-text);
    margin: 0 0 16px;
    line-height: 1.5;
}

/* Etat connecté : un seul bloc, pas d'onglets */
.auth-block--logged { padding: 20px 24px; }
.auth-block--logged .list-group {
    border: 0;
    border-radius: 0;
    margin: 0 0 16px;
    background: transparent;
}
.auth-block--logged .list-group-item {
    border: 0;
    border-bottom: 1px solid var(--card-border);
    padding: 12px 0;
    background: transparent;
    font-size: 14px;
    color: var(--card-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.auth-block--logged .list-group-item:last-child { border-bottom: 0; }
.auth-block--logged .list-group-item .float-end {
    float: none !important;
    color: var(--grey-text);
    font-weight: 500;
    text-align: right;
}
.auth-block--logged .logout_now {
    margin-top: 4px;
    display: flex;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 16px;
    font-size: 14px;
    align-items: center;
    gap: 8px;
}
.auth-block--logged .logout_now:hover {
    background: rgba(38, 70, 143, 0.06);
}

.checkbox-row {
    display: grid;
    grid-template-columns: 18px 1fr;
    column-gap: 16px;
    align-items: start;
    font-weight: 400;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.55;
    color: var(--card-text);
}
.checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-blue);
}
.checkbox-row a { color: var(--primary-blue); text-decoration: underline; font-weight: 600; }

/* ============================================================
   BUTTONS — overrides Bootstrap
   ============================================================ */
.step-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 10px;
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}
.btn-primary,
.btn.btn-primary {
    background: var(--primary-blue) !important;
    color: var(--white) !important;
    border-color: var(--primary-blue) !important;
}
.btn-primary:hover,
.btn.btn-primary:hover {
    background: var(--primary-blue-hover) !important;
    border-color: var(--primary-blue-hover) !important;
}
.btn-primary:disabled,
.btn.btn-primary:disabled {
    background: #B7C4D9 !important;
    border-color: #B7C4D9 !important;
    cursor: not-allowed;
    opacity: 1;
}
.btn-secondary,
.btn.btn-secondary {
    background: var(--white) !important;
    color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
}
.btn-secondary:hover,
.btn.btn-secondary:hover { background: var(--hero-bg) !important; }
.btn-ghost {
    background: transparent;
    color: var(--card-text);
    border-color: var(--card-border);
}
.btn-ghost:hover {
    background: var(--card-active-bg);
    border-color: var(--header-teal);
    color: var(--primary-blue);
}
.btn-block { width: 100%; }

/* ============================================================
   CONFIRMATION
   ============================================================ */
.success-card {
    text-align: center;
    padding: 40px 24px;
    background: var(--white);
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
}
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
}
.success-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--card-text);
    margin-bottom: 12px;
}
.success-card p {
    color: var(--grey-text);
    margin-bottom: 8px;
    font-size: 15px;
}
.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ============================================================
   INTRO / INFO MESSAGES
   ============================================================ */
.intro-message {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 18px;
    background: var(--card-active-bg);
    border: 1px solid #C8E5F0;
    border-left: 4px solid var(--header-teal);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--card-text);
    line-height: 1.55;
}
.intro-message[hidden] { display: none; }
.intro-message .bi { color: var(--header-teal); font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.intro-message strong { color: var(--primary-blue); }
.intro-message a { color: var(--primary-blue); font-weight: 600; text-decoration: underline; }

.info-message {
    gap: 14px;
    padding: 16px 20px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--warn);
    line-height: 1.55;
}
.info-message[hidden] { display: none; }
.info-message .bi { color: var(--warn); font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.info-message strong { color: #5C3D00; }
.info-message a { color: #6B4F00; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* ============================================================
   ALERT (Bootstrap override)
   ============================================================ */
.alert {
    border-radius: 12px;
    padding: 14px 18px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.5;
}
.alert-primary {
    background: var(--hero-bg);
    border-color: var(--card-border);
    color: var(--primary-blue);
}
.alert-danger {
    background: var(--error-bg);
    border-color: #FECACA;
    color: var(--error);
}
.alert-success {
    background: var(--success-bg);
    border-color: #BBF7D0;
    color: var(--success);
}
.alert-warning {
    background: var(--warn-bg);
    border-color: var(--warn-border);
    color: var(--warn);
}

/* ============================================================
   IAM CARD (login, signup, password)
   ============================================================ */
.cud-auth-card {
    max-width: 480px;
    margin: 40px auto;
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(38, 70, 143, 0.06);
}
.cud-auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 24px;
}
.cud-auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}
.cud-auth-links a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: underline;
}
.cud-auth-links a:hover { text-decoration: none; }

/* ============================================================
   PAGE "MES SIGNALEMENTS" — cartes
   ============================================================ */
.request-card {
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow .15s;
}
.request-card:hover { box-shadow: 0 4px 12px rgba(55, 163, 205, 0.10); }
.request-card-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}
.request-card.is-open .request-card-head { border-bottom-color: var(--card-border); }
.request-card-id { font-weight: 700; color: var(--primary-blue); font-size: 14px; }
.request-card-title { flex: 1; font-weight: 600; color: var(--card-text); }
.request-card-sub { display: block; font-weight: 400; color: var(--grey-text); font-size: 13px; margin-top: 2px; }
.request-card-date { font-size: 13px; color: var(--grey-text); flex-shrink: 0; }
.request-card-body { padding: 20px; display: none; }
.request-card.is-open .request-card-body { display: block; }
.request-card-body p { margin: 0 0 8px; font-size: 14px; }
.request-card-body .map-mini { height: 200px; margin-top: 12px; border-radius: 8px; overflow: hidden; }

@media (max-width: 575px) {
    .request-card-head {
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 12px 16px;
    }
    .request-card-id {
        order: 1;
        flex: 1;
    }
    .request-card-head .status-badge {
        order: 2;
        flex-shrink: 0;
    }
    .request-card-title {
        order: 3;
        flex: 0 0 100%;
        font-size: 14px;
    }
    .request-card-date {
        order: 4;
        flex: 0 0 100%;
        font-size: 12px;
    }
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.status-badge--new { background: var(--hero-bg); color: var(--primary-blue); }
.status-badge--wip { background: var(--warn-bg); color: var(--warn); }
.status-badge--done { background: var(--success-bg); color: var(--success); }

/* ============================================================
   LEGAL CONTENT
   ============================================================ */
.legal-content {
    line-height: 1.7;
    font-size: 15px;
}
.legal-content h1,
.legal-content h2 {
    color: var(--primary-blue);
    font-weight: 700;
    margin: 32px 0 12px;
}
.legal-content h1 { font-size: 24px; }
.legal-content h2 { font-size: 18px; }
.legal-content p { margin: 0 0 12px; }
.legal-content a { color: var(--primary-blue); text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.cud-footer {
    background: #2C829A;
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: var(--white);
}
.cud-footer a { color: var(--white); text-decoration: underline; }
.cud-footer a:hover { text-decoration: none; }
.cud-footer p { margin: 0; }
.cud-footer img { display: inline-block; max-height: 40px; margin: 0 12px; vertical-align: middle; }

/* ============================================================
   COOKIE BANNER
   ============================================================ */
.cookie {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 14px 16px;
    z-index: 200;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 720px; margin: 0 auto;
}
.cookie p { margin: 0; font-size: 13px; color: var(--card-text); }
.cookie a { color: var(--primary-blue); font-weight: 600; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-actions button {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    font-family: var(--font-main);
    cursor: pointer;
    min-height: 40px;
}
.cookie-actions .accept {
    background: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    color: var(--white);
}
.cookie-actions .decline {
    background: var(--white);
    border: 1px solid var(--card-border);
    color: var(--card-text);
}
@media (min-width: 640px) {
    .cookie { flex-direction: row; align-items: center; }
    .cookie p { flex: 1; }
    .cookie-actions button { flex: 0 1 auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .category-hero { padding: 24px 16px; }
    .category-hero h1 {
        font-size: 24px;
        flex-direction: column;
        gap: 8px;
    }
    .category-hero p { font-size: 14px; }
    .cud-container { padding: 24px 16px 40px; }
    .header-bar { padding: 0 16px; }
    .header-contact { display: none; }
    .header-burger { display: flex; align-items: center; }
    .cud-header { position: relative; }
    .connection-bar {
        display: none;
        padding: 8px 16px;
    }
    .connection-bar.is-open {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 200;
        box-shadow: 0 4px 12px rgba(0,0,0,.15);
    }
    .header-logos img { height: 80px; }
    .block { padding: 16px; border-radius: 12px; }
    .block-title { font-size: 16px; margin-bottom: 16px; }
    .stepper { gap: 0; }
    .stepper-item { font-size: 12px; }
    .stepper-label { font-size: 12px; }
    .stepper-sub { display: none; }
    .stepper-item .num { width: 32px; height: 32px; font-size: 13px; }
    .step-title { font-size: 20px; }
    .step-actions { flex-direction: column-reverse; gap: 10px; }
    .step-actions .btn { width: 100%; }
    .btn { padding: 14px 20px; font-size: 15px; }
    .radio-button-group .radio-button.btn { padding: 14px 8px !important; }
    .radio-button-group .radio-button.btn > div { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

.bottom-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.bottom-logo img {
    display: block;
    max-height: 60px;
    width: auto;
}
@media (max-width: 575.98px) {
    .bottom-logo { flex-direction: column; align-items: flex-start; width: fit-content; margin-left: auto; margin-right: auto; }
}
