﻿/* ---------- Police Arabswell (slogan) ----------
   Déposer le fichier de police dans themes/fonts/ sous le nom
   arabswell.woff2, arabswell.woff ou arabswell.ttf (un seul suffit).
   Sans fichier, le navigateur utilise Arabswell s'il est installé sur le PC,
   sinon Noto Kufi Arabic. */
@font-face {
    font-family: "Arabswell";
    /* étape 36 : uniquement le .ttf du projet (les .woff2/.woff absents faisaient perdre du temps)
       et « block » pour ne jamais afficher la police de secours un instant */
    src: url("../fonts/arabswell.woff2") format("woff2"), url("../fonts/arabswell.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* =========================================================
   E-CJ – Nouveau thème « portail »
   Chargé en dernier dans MLayout.Master : il ne fait que
   surcharger styles.css et stylesAR.css.
   Construit étape par étape.
   ========================================================= */
:root {
    --navy:       #003566;   /* bleu institutionnel */
    --navy-dark:  #002447;
    --gold:       #d4a23c;   /* soulignement des titres */
    --ink:        #1b2f4a;   /* texte principal */
    --line:       #e2e8f0;
    --bg:         #f5f6f8;
}

/* ---------- Étape 2 : fond et largeur de page ---------- */

/* Fond gris clair avec un motif géométrique marocain discret */
body {
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23003566' stroke-opacity='.055' stroke-width='1'%3E%3Cpath d='M17.4 17.4h45.2v45.2H17.4z'/%3E%3Cpath d='M40 8l32 32-32 32L8 40z'/%3E%3Cpath d='M0 0l17.4 17.4M80 0L62.6 17.4M0 80l17.4-17.4M80 80L62.6 62.6'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* La page occupe toute la largeur (Bootstrap limitait .container à 750/970/1170 px) */
#pagelayout > .container.box {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}


/* ---------- Étape 3 : en-tête ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.site-header__brand  { display: block; line-height: 0; }
.site-header__logo   { height: 72px; width: auto; max-width: 100%; }
.site-header__title  { height: 52px; width: auto; max-width: 45%; }

@media (max-width: 767px) {
    .site-header__inner { padding: 10px 14px; gap: 12px; }
    .site-header__logo  { height: 52px; }
    .site-header__title { height: 34px; }
}


/* ---------- Étape 3b : langues à côté de la date ---------- */
#nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
}
#nav .breadcrumbs { margin: 0; }
#nav .nav-tools {
    order: 2;                     /* toujours en fin de barre */
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}
#nav #displayDate { float: none; white-space: nowrap; }

/* Liste des langues dans la barre */
#nav .liste-langues { background: transparent; padding: 0; }
#nav .liste-langues ul { display: flex; gap: 4px; margin: 0; padding: 0; }
#nav .liste-langues ul li {
    float: none;
    margin: 0;
    padding: 0;
    font-size: 14px !important;   /* annule le style="font-size:x-large" d'Accueil.aspx */
}
#nav .liste-langues ul li a {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 5px;
    color: var(--navy);
    font-size: 14px;
    text-shadow: none;
    text-decoration: none;
}
#nav .liste-langues ul li a:hover { background: rgba(0, 53, 102, .08); }
#nav .liste-langues ul li .active,
#nav .liste-langues ul li a.active { background: var(--navy); color: #fff; }

@media (max-width: 767px) {
    #nav .nav-tools { width: 100%; justify-content: space-between; margin-inline-start: 0; }
}


/* ---------- Étape 3c : nouveaux logos (ministère à gauche, Mahakim à droite) ---------- */
.site-header__inner  { direction: ltr; }          /* même placement en arabe et en français */
.site-header__logo   { height: 76px; }
.site-header__title  { height: 48px; max-width: 40%; }
@media (max-width: 767px) {
    .site-header__logo  { height: 54px; }
    .site-header__title { height: 34px; }
}


/* ---------- Étape 3d : logos inversés + barre bleu marine ---------- */

/* Mahakim à gauche, ministère à droite (toutes langues) */
.site-header__inner { direction: ltr; flex-direction: row-reverse; }

/* Barre sous l'en-tête : bleu marine, plus haute */
#nav {
    min-height: 58px;
    padding: 10px clamp(14px, 3vw, 40px);
    background: var(--navy);
    background-image: none;
    color: #fff;
    text-shadow: none;
    border: 0;
    box-shadow: 0 2px 8px rgba(0, 36, 71, .18);
}

/* Fil d'Ariane en blanc */
#nav .breadcrumbs li {
    background: none;
    padding: 0;
    margin: 0;
    color: rgba(255, 255, 255, .75);
}
#nav .breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: rgba(255, 255, 255, .45); }
#nav .breadcrumbs a { display: inline; color: #fff; font-weight: 700; }
#nav .breadcrumbs a:hover { color: var(--gold); text-decoration: none; }

/* Date en blanc */
#nav #displayDate, #nav #displayDate span { color: rgba(255, 255, 255, .85); font-size: 13px; }

/* Langues : blanc sur bleu, langue active en blanc plein */
#nav .liste-langues ul li a { color: rgba(255, 255, 255, .9); }
#nav .liste-langues ul li a:hover { color: #fff; background: rgba(255, 255, 255, .14); }
#nav .liste-langues ul li .active,
#nav .liste-langues ul li a.active { background: #fff; color: var(--navy); font-weight: 700; }


/* ---------- Étape 3e : sélecteur de langue comme le portail Nationalité ---------- */
.lang-menu { position: relative; }
.lang-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.lang-menu__toggle:hover,
.lang-menu.is-open .lang-menu__toggle { background: rgba(255, 255, 255, .12); }
.lang-menu__toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lang-menu__globe   { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-menu__chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.lang-menu.is-open .lang-menu__chevron { transform: rotate(180deg); }

/* Liste déroulante */
#nav .lang-menu__list {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 100;
    min-width: 160px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 36, 71, .18);
}
#nav .lang-menu.is-open .lang-menu__list { display: block; }
#nav .lang-menu__list ul { display: block; margin: 0; padding: 0; }
#nav .lang-menu__list ul li { display: block; float: none; width: 100%; }
#nav .lang-menu__list ul li a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--ink);
    text-align: start;
}
#nav .lang-menu__list ul li a:hover { background: #f1f5f9; color: var(--navy); }
#nav .lang-menu__list ul li a.active,
#nav .lang-menu__list ul li .active { background: #e8eef6; color: var(--navy); font-weight: 700; }

/* la barre coupait la liste déroulante (overflow:hidden dans styles.css) */
#nav, #pagelayout .navbar { overflow: visible; position: relative; z-index: 60; }


/* ---------- Étape 3f : menu à droite, langues à gauche ---------- */
#nav { justify-content: space-between; }
#nav .nav-tools { order: 2; margin-inline-start: auto; }

.site-menu {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-menu li { list-style: none; float: none; margin: 0; padding: 0; background: none; }
.site-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    border-radius: 4px 4px 0 0;
    transition: background-color .15s, border-color .15s;
}
.site-menu a:hover, .site-menu a:focus {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .08);
    border-bottom-color: var(--gold);
}
/* icône maison devant « الرئيسية » */
.site-menu__home::before {
    content: "";
    width: 20px;
    height: 20px;
    flex: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 3 2.5 11h2.7v9h5.3v-6h3v6h5.3v-9h2.7z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Fil d'Ariane (pages internes uniquement) */
.site-crumbs { background: #fff; border-bottom: 1px solid var(--line); }
.site-crumbs:not(:has(li)) { display: none; }
.site-crumbs .breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 8px clamp(14px, 3vw, 40px);
    list-style: none;
    font-size: 14px;
}
.site-crumbs .breadcrumbs li { float: none; background: none; padding: 0; margin: 0; }
.site-crumbs .breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: #a0aec0; }
.site-crumbs .breadcrumbs a { display: inline; color: var(--navy); }

/* « طلب جديد » : laisser un peu d'espace au-dessus du titre ciblé */
#demande { scroll-margin-top: 20px; }

@media (max-width: 767px) {
    .site-menu a { padding: 0 8px; font-size: 14px; }
    #nav .nav-tools { width: auto; margin-inline-start: auto; }
}


/* ---------- Étape 3g : icône maison seule (le texte reste lu par les lecteurs d'écran) ---------- */
.site-menu a.site-menu__home { font-size: 0; gap: 0; padding: 0 12px; }
.site-menu__home::before { width: 22px; height: 22px; }


/* ---------- Étape 3h : motif de fond fourni (remplace le motif SVG) ---------- */
body {
    background-color: #f7f7f7;
    background-image: url("../img/bg-pattern.png");
    background-repeat: repeat;
    background-attachment: fixed;
}
/* la zone de contenu était blanche et cachait le motif */
#middle { background: transparent; }


/* ---------- Étape 4 : carte centrale (mêmes proportions que le portail Nationalité) ---------- */
#pagelayout #middle {
    float: none;
    width: auto;
    margin: 32px 8.7% 24px;          /* ~80 % de la largeur, comme le portail Nationalité */
    padding: 14px;
    background: #f7f8f7;
    border-radius: 13px;
    box-shadow: 0 1px 1px rgba(66, 66, 66, .08), 0 2px 12px rgba(66, 66, 66, .10);
}
#pagelayout #middle::after { content: ""; display: table; clear: both; }

/* Les blocs s'empilent l'un après l'autre (plus de deux colonnes) */
#middle .col-sm-6 {
    float: none !important;
    width: 100% !important;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}
#middle > .col-sm-6 + .col-sm-6 { margin-top: 14px; }

@media (max-width: 767px) {
    #pagelayout #middle { margin: 16px 10px; padding: 10px; }
}


/* Blocs : l'ancien fond jaune (accueil-bloc-bg.png) ne couvrait plus toute la largeur */
#middle .bloc,
.accueil #middle .bloc {
    background: #fff;
    background-image: none;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    min-height: 0;
    margin-bottom: 14px;
    padding: 18px 20px;
}
/* La colonne de droite n'est qu'un conteneur : pas de cadre autour de ses blocs */
#middle > .col-sm-6.bloc:not(.panel-body) {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    overflow: visible;
}
/* Bloc « application mobile » dans le bloc d'accueil : fond gris clair */
#middle .bloc .bloc { background: #f7f8fa; margin: 16px 0 0; }
/* Taille du logo et du badge Google Play (largeurs en % devenues trop grandes) */
#middle .bloc .bloc > div:first-child > img { width: 84px !important; height: auto; }
#middle .iconAppMobile { margin-top: 10px; }
#middle .iconAppMobile a { width: 160px !important; }


/* ---------- Étape 4b : menu aligné sur les bords de la carte centrale ---------- */
#nav { padding-left: 8.7%; padding-right: 8.7%; }
@media (max-width: 767px) {
    #nav { padding-left: 10px; padding-right: 10px; }
}


/* ---------- Étape 5 : slogan au centre de l'en-tête ---------- */
/* 3 colonnes égales : Mahakim | slogan | ministère -> le slogan reste parfaitement centré */
.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: none;
    padding-left: 8.7%;
    padding-right: 8.7%;
}
.site-header__title  { grid-row: 1; grid-column: 1; justify-self: start; }
.site-header__slogan { grid-row: 1; grid-column: 2; }
.site-header__brand  { grid-row: 1; grid-column: 3; justify-self: end; }

.site-header__slogan {
    position: relative;
    margin: 0;
    padding: 0 0 10px;
    direction: rtl;
    text-align: center;
    font-family: "Noto Kufi Arabic", Tahoma, sans-serif;
    font-size: clamp(16px, 1.7vw, 24px);
    font-weight: 700;
    line-height: 1.6;
    color: var(--navy);
    white-space: nowrap;
}
.site-header__slogan::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 64px;
    height: 3px;
    margin-left: -32px;
    border-radius: 3px;
    background: var(--gold);
}

@media (max-width: 900px) {
    .site-header__inner { grid-template-columns: 1fr 1fr; row-gap: 8px; padding-left: 14px; padding-right: 14px; }
    .site-header__slogan { grid-row: 2; grid-column: 1 / -1; white-space: normal; }
    .site-header__brand  { grid-column: 2; }
}


/* ---------- Étape 5b : en-tête moins haut, logos aux extrémités ---------- */
.site-header__inner {
    padding: 6px 24px;
}
.site-header__logo   { height: 60px; }
.site-header__title  { height: 38px; }
.site-header__slogan { font-size: clamp(15px, 1.5vw, 21px); padding-bottom: 7px; line-height: 1.5; }
.site-header__slogan::after { height: 2px; width: 56px; margin-left: -28px; }

@media (max-width: 900px) {
    .site-header__inner { padding: 6px 12px; row-gap: 4px; }
    .site-header__logo  { height: 48px; }
    .site-header__title { height: 30px; }
}


/* ---------- Étape 5c : logos un peu plus vers le centre ---------- */
.site-header__inner { padding-left: 4.5%; padding-right: 4.5%; }
@media (max-width: 900px) {
    .site-header__inner { padding-left: 12px; padding-right: 12px; }
}


/* ---------- Étape 5d : « محاكم » en jaune (jaune du logo Mahakim) ---------- */
.site-header__slogan .slogan-accent { color: #FCC206; }


/* ---------- Étape 5e : slogan en Arabswell ---------- */
.site-header__slogan { font-family: "Arabswell", "Noto Kufi Arabic", Tahoma, sans-serif; font-weight: normal; }


/* ---------- Étape 5f : plus de trait sous le slogan ; élément de menu courant en jaune ---------- */
.site-header__slogan { padding-bottom: 0; }
.site-header__slogan::after { content: none; display: none; }

.site-menu a.is-current { color: #FCC206; border-bottom-color: #FCC206; }
.site-menu a.is-current:hover { color: #FCC206; }
.site-menu a.site-menu__home.is-current::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FCC206' d='M12 3 2.5 11h2.7v9h5.3v-6h3v6h5.3v-9h2.7z'/%3E%3C/svg%3E");
}


/* ---------- Étape 7 : boutons en bleu marine ---------- */
.btn,
.btn-modif, .btn-print, .btn-valider, .btn-ajouter,
.ok,
.line-actions .btn,
.btn-sprite input,
.btn-signer div {
    background-color: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 6px;
}
.btn { padding: 7px 16px; }
.btn:hover, .btn:focus,
.btn-modif:hover, .btn-ajouter:hover,
.ok:hover,
.line-actions .btn:hover,
.btn-sprite:hover input,
.btn-signer:hover, .btn-signer:hover input, .btn-signer:hover div {
    background-color: var(--navy-dark) !important;
    color: #fff;
}
/* les boutons désactivés restent gris */
.line-actions .btn-disabled, .line-actions .btn-disabled:hover { background-color: #ccc !important; }


/* ---------- Étape 7b : espace entre la flèche et le texte des boutons ---------- */
/* Arabe : flèche à gauche du texte */
.lang-ar .btn-suivant { padding-left: 34px; padding-right: 16px; background-position: left 12px center; }
.lang-ar .btn-retour  { padding-right: 34px; padding-left: 16px; background-position: right 12px center; }
/* Français / anglais / espagnol : flèche à droite du texte */
.lang-ltr .btn-suivant { padding-right: 34px; padding-left: 16px; background-position: right 12px center; }
.lang-ltr .btn-retour  { padding-left: 34px; padding-right: 16px; background-position: left 12px center; }


/* ---------- Étape 8 : boutons de même largeur ---------- */
#middle .line-btn .btn,
#middle .line-btn input.btn {
    width: 170px;
    text-align: center;
    box-sizing: border-box;
}
.page-test { padding: 28px; }
.page-test p { font-size: 16px; }


/* ---------- Étape 9 : pied de page bleu marine, toujours en bas de l'écran ---------- */
#pagelayout { min-height: 100vh; display: flex; flex-direction: column; }
#pagelayout > .container.box { flex: 1 0 auto; display: flex; flex-direction: column; }
#pagelayout > .container.box > #footer1 { margin-top: auto; }   /* colle le pied de page en bas sur les pages courtes */

#footer1,
#footer1.navbar,
#footer1.navbar-default {
    margin-bottom: 0;
    min-height: 0;
    padding: 16px 20px;
    background: var(--navy);
    background-image: none;
    border: 0;
    border-top: 3px solid #FCC206;          /* filet jaune comme l'élément de menu actif */
    border-radius: 0;
    text-align: center;
}
#footer1 #copyright,
#footer1 #copyright p { margin: 0; float: none; width: 100%; }
#footer1 h2,
#footer1 #copyright h2 {
    margin: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.6;
    color: #fff;
    text-shadow: none;
}
#footer1 a { color: #fff; }
#footer1 a:hover { color: #FCC206; }
/* pleine largeur : styles.css mettait margin: 0 auto, ce qui rétrécissait le pied de page */
#pagelayout > .container.box > #footer1 { margin-left: 0; margin-right: 0; width: 100%; align-self: stretch; }


/* ---------- Étape 10 : page « اتصل بنا » ---------- */
.contact-page { max-width: 560px; margin: 0 auto; padding: 18px 0 28px; text-align: center; }
.contact-page__title {
    margin: 0 0 14px;
    font-family: "Arabswell", "Noto Kufi Arabic", Tahoma, sans-serif;
    font-size: 34px;
    font-weight: normal;
    color: var(--navy);
}
.contact-page__subtitle {
    display: inline-block;
    margin: 0 0 22px;
    padding: 2px 16px 6px;
    font-size: 18px;
    color: var(--navy);
    border-bottom: 2px solid #FCC206;
    border-radius: 0 0 12px 12px;
    text-shadow: none;
}
.contact-card {
    margin: 0 0 14px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 36, 71, .06);
    text-align: start;
}
.contact-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; color: #d4a017; }
.contact-card p  { margin: 0; color: var(--ink); }
.lang-ar .contact-card p[dir="ltr"] { text-align: right; }
.contact-note { margin: 18px 0 10px; font-size: 14px; font-weight: 700; color: var(--navy); }


/* ---------- Étape 10b : page contact alignée à droite en arabe uniquement ---------- */
.lang-ar .contact-page { direction: rtl; }
.lang-ar .contact-card,
.lang-ar .contact-card h3,
.lang-ar .contact-card p,
.lang-ar .contact-note { text-align: right; }
.lang-ltr .contact-card,
.lang-ltr .contact-card h3,
.lang-ltr .contact-card p { text-align: left; }


/* ---------- Étape 10c : Arabswell réservé à l'arabe ----------
   La police Arabswell n'a pas certaines lettres latines accentuées (á, ñ…) :
   dans « Contáctenos », le « á » s'affichait dans une autre police.
   En français / anglais / espagnol, on utilise une police latine complète. */
.lang-ltr .contact-page__title,
.lang-ltr .site-header__slogan {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-weight: 600;
}
.lang-ltr .contact-page__title { font-size: 30px; }


/* ---------- Étape 11 : page « Nouvelle demande » (formulaire) ---------- */
.nouvelle-demande { padding: 24px 28px; }
.nouvelle-demande h2 { margin-bottom: 18px; }
.nouvelle-demande .nd-ligne { margin-bottom: 18px; overflow: hidden; }
.nouvelle-demande .nd-erreur { display: block; margin-bottom: 14px; }
.nouvelle-demande .nd-note { margin: 10px 0 0; font-weight: 700; color: #9a6b12; }


/* =====================================================================
   Étape 12 : ACCUEIL VERSION B « Portail »
   Tout est limité à .home-b : la version A n'est pas touchée.
   ===================================================================== */
#pagelayout #middle:has(.home-b) { background: transparent; box-shadow: none; padding: 0; }   /* la version B a ses propres cartes */
.home-b { display: flex; flex-direction: column; gap: 24px; }
.lang-ar .home-b { direction: rtl; text-align: right; }
.lang-ltr .home-b { direction: ltr; text-align: left; }

.hb-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 36, 71, .05), 0 10px 30px rgba(0, 36, 71, .07);
    padding: 32px 36px;
}
.home-b .hb-title {
    display: inline-block;
    margin: 0 0 24px;
    padding-bottom: 8px;
    border-bottom: 3px solid #FCC206;
    font-family: "Arabswell", "Noto Kufi Arabic", Tahoma, sans-serif;
    font-weight: normal;
    font-size: 28px;
    color: var(--navy);
    text-shadow: none;
}

/* Bandeau d'accueil */
.hb-hero { text-align: center !important; padding: 42px 36px 38px; }
.home-b .hb-hero__title {
    margin: 0 0 10px;
    font-family: "Arabswell", "Noto Kufi Arabic", Tahoma, sans-serif;
    font-weight: normal;
    font-size: 42px;
    line-height: 1.4;
    color: var(--navy);
    text-shadow: none;
}
.home-b .hb-hero__lead { max-width: 640px; margin: 0 auto 28px; font-size: 18px; line-height: 1.8; color: #4a5d76; text-align: center; }
.hb-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 760px; margin: 0 auto; }
.hb-action {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border: 2px solid var(--navy);
    border-radius: 14px;
    background: #fff;
    color: var(--navy);
    text-decoration: none;
    text-align: start;
    transition: transform .15s, box-shadow .15s;
}
.hb-action:hover, .hb-action:focus { color: var(--navy); text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 36, 71, .15); }
.hb-action svg { width: 46px; height: 46px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hb-action__text { display: flex; flex-direction: column; gap: 4px; }
.hb-action__label { font-size: 22px; font-weight: 700; }
.hb-action__sub { font-size: 15px; color: #4a5d76; }
.hb-action--primary { background: var(--navy); color: #fff; box-shadow: 0 6px 18px rgba(0, 53, 102, .25); }
.hb-action--primary:hover, .hb-action--primary:focus { color: #fff; background: var(--navy-dark); }
.hb-action--primary svg { stroke: #FCC206; }
.hb-action--primary .hb-action__sub { color: #dbe6f3; }

/* Étapes et modes : 3 colonnes */
.hb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hb-step { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
.hb-step__num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.hb-step__body, .hb-mode { display: flex; flex-direction: column; gap: 6px; }
.hb-step__body strong, .hb-mode strong { font-size: 17px; color: var(--navy); }
.hb-step__body span, .hb-mode span { font-size: 15px; line-height: 1.7; color: #4a5d76; }
.hb-mode { padding: 22px; border: 1px solid #e2e8f0; border-top: 4px solid var(--navy); border-radius: 12px; gap: 10px; }
.hb-mode svg { width: 34px; height: 34px; fill: none; stroke: var(--navy); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Application mobile */
.hb-app { background: var(--navy); border-radius: 16px; padding: 26px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: #fff; }
.hb-app__info { display: flex; align-items: center; gap: 16px; }
.hb-app__info svg { width: 44px; height: 44px; flex: none; fill: none; stroke: #FCC206; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hb-app__info > span { display: flex; flex-direction: column; gap: 4px; }
.hb-app__info strong { font-size: 20px; }
.hb-app__info span span { font-size: 15px; color: #dbe6f3; }
.hb-app__btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 10px; background: #fff; color: var(--navy); font-weight: 700; font-size: 16px; text-decoration: none; }
.hb-app__btn:hover, .hb-app__btn:focus { color: var(--navy); background: #f1f5f9; text-decoration: none; }
.hb-app__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Arabswell réservé à l'arabe (lettres accentuées absentes) */
.lang-ltr .home-b .hb-title,
.lang-ltr .home-b .hb-hero__title { font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-weight: 600; }
.lang-ltr .home-b .hb-hero__title { font-size: 36px; }

/* Téléphone / tablette */
@media (max-width: 900px) {
    .hb-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 767px) {
    .hb-card { padding: 22px 18px; }
    .hb-hero { padding: 26px 18px; }
    .home-b .hb-hero__title { font-size: 30px; }
    .hb-actions { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .hb-action { padding: 16px 18px; }
    .hb-action__label { font-size: 19px; }
    .hb-app { padding: 22px 18px; }
    .hb-app__btn { width: 100%; justify-content: center; }
}


/* ---------- Étape 13 : logos alignés sur le menu ---------- */
/* même marge latérale que la barre de menu (#nav : 8.7 %) */
.site-header__inner { padding-left: 8.7%; padding-right: 8.7%; }
@media (max-width: 767px) {
    .site-header__inner { padding-left: 10px; padding-right: 10px; }
}


/* =====================================================================
   Étape 14 : barre d'étapes moderne (pages de la demande : DCJ.aspx…)
   Remplace les anciennes images etape-N.gif par des cercles numérotés.
   - étape faite    : cercle bleu marine avec ✓
   - étape actuelle : cercle jaune
   - étape à venir  : cercle blanc, bord gris
   ===================================================================== */
.barre-etape {
    display: flex;
    align-items: flex-start;
    margin: 4px 0 30px;
    padding: 0;
    counter-reset: etape;
    overflow: visible;
}
.lang-ar .barre-etape { direction: rtl; }
.lang-ltr .barre-etape { direction: ltr; }
.barre-etape::before, .barre-etape::after { display: none; }   /* annule le clearfix de .row */

.barre-etape .etape {
    counter-increment: etape;
    position: relative;
    float: none;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 46px 6px 0;
    background: none;
    background-image: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}
/* cercle numéroté */
.barre-etape .etape::before {
    content: counter(etape);
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    line-height: 32px;
    text-align: center;
    box-sizing: border-box;
}
/* trait entre deux étapes */
.barre-etape .etape::after {
    content: "";
    position: absolute;
    top: 17px;
    inset-inline-start: 50%;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
}
.barre-etape .etape:last-child::after { display: none; }

/* étape actuelle */
.barre-etape .etape[class*="-active"] { color: var(--navy); font-weight: 700; }
.barre-etape .etape[class*="-active"]::before {
    border-color: #FCC206;
    background: #FCC206;
    color: var(--navy);
    box-shadow: 0 0 0 5px rgba(252, 194, 6, .25);
}

/* étapes déjà faites (celles qui précèdent l'étape actuelle) */
.barre-etape .etape:has(~ .etape[class*="-active"]) { color: var(--navy); }
.barre-etape .etape:has(~ .etape[class*="-active"])::before {
    content: "\2713";
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}
.barre-etape .etape:has(~ .etape[class*="-active"])::after { background: var(--navy); }

@media (max-width: 600px) {
    .barre-etape .etape { font-size: 11px; padding: 42px 2px 0; }
    .barre-etape .etape::before { width: 32px; height: 32px; margin-left: -16px; line-height: 28px; font-size: 14px; }
    .barre-etape .etape::after { top: 15px; }
}


/* =====================================================================
   Étape 15 : « ملاحظات هامة » en encadré d'information (et non d'erreur)
              + textes d'aide « كما هو مضمن… » en gris
   Ces encadrés sont dans les composants Controles/*.ascx (classe .panel-danger).
   Leurs titres ont style="color:red" dans le HTML, d'où les !important.
   ===================================================================== */
#middle .panel.panel-danger {
    margin: 4px 0 22px;
    background: #fffbea;
    border: 1px solid #f3dc8a;
    border-radius: 12px;
    box-shadow: none;
}
#middle .panel-danger > .panel-heading {
    position: relative;
    padding: 16px 20px;
    padding-inline-start: 56px;
    background: transparent;
    border: 0;
    color: var(--ink);
}
/* icône « i » */
#middle .panel-danger > .panel-heading::before {
    content: "i";
    position: absolute;
    top: 15px;
    inset-inline-start: 18px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 700;
    font-style: italic;
    line-height: 26px;
    text-align: center;
}
/* titre « ملاحظات هامة » */
#middle .panel-danger > .panel-heading > h1 {
    margin: 2px 0 8px;
    color: var(--navy) !important;
    font-size: 17px !important;
    font-weight: 700;
    text-shadow: none;
}
/* lignes de la note */
#middle .panel-danger .panel-body { padding: 0; margin: 0; }
#middle .panel-danger .panel-body h1 {
    position: relative;
    margin: 4px 0;
    padding-inline-start: 16px;
    color: var(--ink) !important;
    font-size: 15px !important;
    font-weight: 400;
    line-height: 1.75;
    text-shadow: none;
}
#middle .panel-danger .panel-body h1::before {
    content: "";
    position: absolute;
    top: .7em;
    inset-inline-start: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d9a400;
}
.lang-ar #middle .panel-danger { direction: rtl; text-align: right; }

/* Texte d'aide sous l'intitulé (« كما هو مضمن بظهر بطاقتكم الوطنية ») */
#middle .parent_warning {
    display: block;
    margin: 2px 0 4px;
    color: #64748b;
    font-size: 13px;
    font-weight: 400;
}


/* =====================================================================
   Étape 16 : formulaire de la demande (DCJ.aspx et ses composants)
   4) sections en cartes avec titre souligné jaune
   5) champs alignés sur une grille de 2 colonnes, libellés lisibles
   CSS seulement : aucun composant .ascx ni code C# modifié.
   ===================================================================== */

/* --- 4. Sections --- */
#middle fieldset.scheduler-border {
    margin: 0 0 24px !important;
    padding: 22px 26px 10px !important;
    background: #fff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 36, 71, .04);
}
#middle fieldset.scheduler-border > legend,
#middle legend.scheduler-border {
    float: right;                      /* le titre entre dans la carte, plus d'encoche dans le cadre */
    width: auto;
    margin: 0 0 20px;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 3px solid #FCC206;
    background: transparent;
    color: var(--navy);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
    text-shadow: none;
}
.lang-ltr #middle fieldset.scheduler-border > legend,
.lang-ltr #middle legend.scheduler-border { float: left; }
#middle fieldset > legend + * { clear: both; }
#middle fieldset.scheduler-border .panel-danger { clear: both; }

/* sous-section (« مكان الميلاد ») */
#middle #panelNaissanceMaroc fieldset,
#middle #panelNaissanceEtranger fieldset,
#middle fieldset.scheduler-border fieldset {
    clear: both;
    margin: 6px 0 18px !important;
    padding: 16px 18px 4px !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px;
}
#middle #panelNaissanceMaroc fieldset > legend,
#middle #panelNaissanceEtranger fieldset > legend,
#middle fieldset.scheduler-border fieldset > legend {
    float: right;
    width: auto;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
}
.lang-ltr #middle fieldset fieldset > legend { float: left; }

/* --- 5. Lignes de champs : grille de 2 colonnes --- */
#middle fieldset .form-inline {
    clear: both;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    margin: 0 0 6px;
}
#middle fieldset .form-inline .form-group {
    display: block;
    width: auto;
    margin: 0 0 16px;
    vertical-align: top;
}
/* bouton « تعبئة تلقائية » : sur sa propre ligne */
#middle fieldset .form-inline .form-group:has(#ButtonAutofill) { grid-column: 1 / -1; margin-top: -4px; }
#middle fieldset .form-inline .form-group:has(#ButtonAutofill) .line-btn { padding: 0 !important; }

/* libellés au-dessus des champs */
#middle fieldset .form-group > .control-label,
#middle fieldset .form-group > label.intitule {
    display: block;
    float: none;
    width: auto;
    margin: 0 0 6px;
    padding: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    text-align: start;
}
/* astérisque : un simple « * » rouge (au lieu de « *: » souligné en pointillés) */
#middle fieldset abbr { text-decoration: none; border: 0; cursor: default; }
#middle fieldset abbr.obligatoire { font-size: 0 !important; margin: 0 2px; }
#middle fieldset abbr.obligatoire::before { content: "*"; font-size: 16px; font-weight: 700; color: #c62828; }
#middle fieldset label abbr:not(.obligatoire) { display: none; }   /* « : » seul après « المهنة » */

/* champs : même hauteur, pleine largeur de la colonne */
#middle fieldset .form-control,
#middle fieldset input[type="text"],
#middle fieldset input[type="email"],
#middle fieldset input[type="tel"],
#middle fieldset select {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 44px;
    margin: 0;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.4;
}
#middle fieldset .form-control:focus,
#middle fieldset input:focus,
#middle fieldset select:focus {
    border-color: var(--navy);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 53, 102, .18);
}

/* date de naissance : jour / mois / année côte à côte */
#middle fieldset .calendar { display: flex; gap: 8px; float: none; width: 100%; margin: 0; }
#middle fieldset .calendar select { flex: 1 1 0; width: auto !important; min-width: 0; }
/* case « لا أتوفر على يوم و شهر الميلاد » alignée sur les champs */
#middle fieldset .form-group > .checkbox.control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 34px 0 0;
    font-size: 14px;
    font-weight: 400;
}
#middle fieldset .form-group > .checkbox.control-label input { position: static; margin: 0; width: 18px; height: 18px; accent-color: var(--navy); }

/* sexe : boutons radio sur une ligne */
#middle fieldset .form-label-inline { display: flex !important; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-height: 44px; }
#middle fieldset .form-label-inline input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
#middle fieldset .form-label-inline label { margin: 0 0 0 14px; font-weight: 500; }

/* téléphone : une seule colonne */
@media (max-width: 767px) {
    #middle fieldset.scheduler-border { padding: 18px 14px 6px !important; }
    #middle fieldset .form-inline { grid-template-columns: minmax(0, 1fr); }
    #middle fieldset .form-group > .checkbox.control-label { margin-top: 0; }
}


/* --- 5b. Champs en « colonnes flottantes » (.form-group.column : nationalité, CIN, e-mail, adresse…)
       Les flottants se décalaient en escalier : on les range en 2 colonnes avec flexbox. --- */
#middle fieldset.scheduler-border {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 24px;
}
#middle fieldset.scheduler-border > * {
    flex: 0 0 100%;
    min-width: 0;
}
/* le titre passe toujours en premier, même s'il est après la note dans le HTML */
#middle fieldset.scheduler-border > legend { order: -1; flex: 0 0 auto; }   /* reste flottant : titre DANS la carte */
#middle fieldset.scheduler-border > .panel-danger { order: 0; }

#middle fieldset .form-group.column {
    flex: 0 0 calc(50% - 12px);
    float: none;
    width: auto;
    margin: 0 0 16px;
    padding: 0;
}
#middle fieldset .form-group.column > .control-label,
#middle fieldset .form-group.column > label {
    float: none;
    width: auto;
    padding: 0;
}
#middle fieldset .form-group.column > .content-bloc {
    float: none;
    width: 100%;
    padding: 0;
}
/* boutons radio « نعم / لا » */
#middle fieldset .form-group.column .check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    float: none;
    min-height: 44px;
    margin-inline-end: 22px;
}
#middle fieldset .form-group.column .check input[type="radio"] { float: none; width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
#middle fieldset .form-group.column .check label { float: none; margin: 0; font-weight: 500; }

@media (max-width: 767px) {
    #middle fieldset .form-group.column { flex-basis: 100%; }
}

/* les conteneurs intermédiaires (ex. #panel_NumeroCin) laissent leurs champs suivre la grille */
#middle fieldset.scheduler-border > div:not(.form-group):not(.form-inline):not(.panel):not(.clearfix):not(.line-btn):has(> .form-group.column) { display: contents; }
#middle fieldset .form-group.column { width: calc(50% - 12px); }
/* champ dont tout le contenu est masqué (ex. « مقيم بالمغرب ») : ne garde pas de place vide */
#middle fieldset .form-group.column:not(:has(> :not([style*="none"]))) { display: none; }
@media (max-width: 767px) {
    #middle fieldset .form-group.column { width: 100%; }
}


/* =====================================================================
   Étape 17 : plus de fond jaune à l'étape 5 (récapitulatif de la demande)
   Le bloc .recap (Controles/RecapitulatifDemande.ascx) utilisait l'image
   back_recap.png (dégradé jaune). Même chose pour .action et les anciens
   blocs d'accueil (accueil-bloc-bg*.png) s'ils apparaissent ailleurs.
   ===================================================================== */
#middle .recap,
#middle .action {
    margin: 0 0 24px;
    padding: 22px 26px 8px;
    background: #fff;
    background-image: none;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 36, 71, .04);
}
#middle .recap h2, #middle .recap h3, #middle .action h3 { color: var(--navy); text-shadow: none; }
.accueil #middle .bloc-large,
.accueil #middle .bloc1-large,
.accueil #middle .bloc1 { background-image: none; }

/* le récapitulatif reprend la même grille de 2 colonnes que le formulaire */
#middle .recap { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 24px; }
#middle .recap > * { flex: 0 0 100%; min-width: 0; }
#middle .recap .form-group.column { flex: 0 0 calc(50% - 12px); width: calc(50% - 12px); float: none; margin: 0 0 14px; padding: 0; }
#middle .recap .form-group.column > .control-label { display: block; float: none; width: auto; padding: 0; margin: 0 0 4px; color: #64748b; font-size: 14px; font-weight: 600; }
#middle .recap .form-group.column > .content-bloc { float: none; width: 100%; padding: 0; color: var(--ink); font-size: 16px; font-weight: 700; }
@media (max-width: 767px) {
    #middle .recap .form-group.column { flex-basis: 100%; width: 100%; }
}


/* =====================================================================
   Étape 18 : bouton « طباعة / Imprimer » (CD.aspx, SD.aspx)
   L'ancienne icône btn-print.gif chevauchait le texte. Bouton secondaire :
   fond blanc, bord bleu marine, icône d'imprimante dessinée en SVG.
   ===================================================================== */
#middle .btn.btn-print,
#middle input.btn.btn-print {
    height: 44px;
    padding: 0 18px;
    padding-inline-start: 46px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003566' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Crect x='3' y='9' width='18' height='8' rx='2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 20px 20px;
    border: 2px solid var(--navy);
    border-radius: 8px;
    color: var(--navy);
    font-weight: 700;
    line-height: 40px;
}
.lang-ar #middle .btn.btn-print { background-position: right 16px center; }
.lang-ltr #middle .btn.btn-print { background-position: left 16px center; }
#middle .btn.btn-print:hover,
#middle .btn.btn-print:focus {
    background-color: var(--navy) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Crect x='3' y='9' width='18' height='8' rx='2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E");
    color: #fff;
}
/* les deux boutons de la ligne (imprimer / retour à l'accueil) : même hauteur, largeur selon le texte */
#middle .line-btn:has(.btn-print) { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#middle .line-btn:has(.btn-print) .btn {
    float: none !important;
    width: auto;
    min-width: 190px;
    height: 44px;
    line-height: 40px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}
#middle .line-btn:has(.btn-print) a.btn { display: inline-block; padding: 0 22px; border: 2px solid var(--navy); }


/* =====================================================================
   Étape 19 : page « تتبع الطلب » (ASD.aspx) et lignes « .line.row »
   (aussi utilisées à l'étape 5 de la demande).
   ===================================================================== */
/* une seule carte : le .BlocForm autour du fieldset devient transparent */
#middle .BlocForm:has(> fieldset.scheduler-border) {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}
#middle fieldset .aide-saisie { flex-basis: 100%; margin: 0 0 18px; color: #4a5d76; font-size: 15px; font-style: normal; }
#middle fieldset .spacer-20 { display: none; }

/* champs « libellé + zone » empilés, colonne centrée et pas trop large */
#middle fieldset > .panel-body { padding: 0; }
#middle fieldset .line.row {
    display: block;
    margin: 0 0 16px;
    padding: 0;
}
#middle fieldset .line.row > .intitule {
    float: none;
    width: auto;
    padding: 0;
    margin: 0 0 6px;
}
#middle fieldset .line.row > .intitule label {
    display: block;
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}
#middle fieldset .line.row > .content-bloc {
    float: none;
    width: 100%;
    padding: 0;
}
/* page de suivi : formulaire court, centré */
#middle .BlocForm > fieldset.scheduler-border > .panel-body {
    flex: 0 0 100%;
    max-width: 560px;
    margin: 0 auto;
}

/* boutons « رجوع » / « دخول » */
#middle .line-btn:has(.btn-retour) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0;                      /* masque les &nbsp; entre les deux boutons */
}
#middle .line-btn:has(.btn-retour) .btn {
    float: none !important;
    width: 170px;
    height: 44px !important;           /* le bouton « دخول » avait style="height:27px" */
    line-height: 40px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}
#middle .line-btn:has(.btn-retour) a.btn-retour {
    display: inline-block;
    background-color: #fff;
    border: 2px solid var(--navy);
    color: var(--navy);
}
#middle .line-btn:has(.btn-retour) a.btn-retour:hover,
#middle .line-btn:has(.btn-retour) a.btn-retour:focus { background-color: #f1f5f9 !important; color: var(--navy); }
#middle .line-btn:has(.btn-retour) input.btn { border: 2px solid var(--navy); }

/* message d'erreur de la page */
#middle fieldset > span[style*="color: red"] { flex-basis: 100%; margin: 6px 0 0; font-size: 15px !important; font-weight: 700; text-align: center; }


/* =====================================================================
   Étape 20 : police du site = Droid Arabic Kufi
   (chargée depuis Google Fonts dans MLayout.Master)
   Les grands titres décoratifs gardent Arabswell en arabe.
   ===================================================================== */
body,
.lang-ar,
.lang-ar input, .lang-ar select, .lang-ar textarea, .lang-ar button,
.lang-ar h1, .lang-ar h2, .lang-ar h3, .lang-ar h4, .lang-ar label, .lang-ar legend,
.lang-ar .btn {
    font-family: "Droid Arabic Kufi", Tahoma, Arial, sans-serif;
}
/* français / anglais / espagnol : police latine (Droid Arabic Kufi est pensée pour l'arabe) */
.lang-ltr,
.lang-ltr input, .lang-ltr select, .lang-ltr textarea, .lang-ltr button,
.lang-ltr h1, .lang-ltr h2, .lang-ltr h3, .lang-ltr h4, .lang-ltr label, .lang-ltr legend,
.lang-ltr .btn {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
/* titres décoratifs en arabe : Arabswell (inchangé) */
.lang-ar .site-header__slogan,
.lang-ar .home-b .hb-title,
.lang-ar .home-b .hb-hero__title,
.lang-ar .contact-page__title { font-family: "Arabswell", "Droid Arabic Kufi", Tahoma, sans-serif; }


/* =====================================================================
   Étape 21 : mêmes marges gauche/droite que mahakim.ma
   Mesure sur mahakim.ma (fenêtre de 1302 px) : marge de 106 px,
   soit une zone centrale de 1090 px. Le logo, la barre de menu et
   la carte de contenu sont alignés sur cette même zone.
   ===================================================================== */
/* mahakim.ma suit la grille « container » de Bootstrap 4 : zone de contenu de
   1110 px (écran ≥ 1200), 930 px (≥ 992), 690 px (≥ 768). On reprend les mêmes paliers. */
:root { --site-largeur: 1110px; --site-marge: max(16px, calc((100% - var(--site-largeur)) / 2)); }
@media (max-width: 1199px) { :root { --site-largeur: 930px; } }
@media (max-width: 991px)  { :root { --site-largeur: 690px; } }

.site-header__inner,
#nav {
    padding-left: var(--site-marge);
    padding-right: var(--site-marge);
}
#pagelayout #middle {
    margin-left: var(--site-marge);
    margin-right: var(--site-marge);
}
@media (max-width: 767px) {
    .site-header__inner, #nav { padding-left: 10px; padding-right: 10px; }
    #pagelayout #middle { margin-left: 10px; margin-right: 10px; }
}

/* ---------- Étape 22 : marges identiques à mahakim.ma (pleine largeur, 48px de chaque côté) ---------- */
:root { --site-marge: 48px; }
@media (max-width: 991px) { :root { --site-marge: 24px; } }

/* =====================================================================
   Étape 23 : en-tête et barre de menu aux mêmes proportions que mahakim.ma
   (mesuré dans Firefox à 100 %)
   ===================================================================== */
/* en-tête : ~74 px de haut, slogan un peu plus grand, logo Mahakim un peu plus petit */
.site-header__inner { padding-top: 7px; padding-bottom: 7px; }
.site-header__logo   { height: 60px; }
.site-header__title  { height: 35px; }
.site-header__slogan { font-size: 23px; }

/* barre : 54 px, liens plus espacés, texte 14 px moins gras */
#nav { min-height: 54px; padding-top: 0; padding-bottom: 0; }
.site-menu { gap: 0; align-items: center; }
.site-menu a { height: 54px; padding: 0 22px; font-size: 14px; font-weight: 600; border-radius: 0; }

/* bouton accueil : carré jaune, maison bleu marine (comme mahakim.ma) */
.site-menu a.site-menu__home,
.site-menu a.site-menu__home.is-current {
    width: 36px; height: 36px; padding: 0; margin-inline-end: 12px;
    justify-content: center;
    background: #FCC206; border: 0; border-radius: 4px;
}
.site-menu a.site-menu__home:hover { background: #ffd23f; }
.site-menu a.site-menu__home::before,
.site-menu a.site-menu__home.is-current::before {
    width: 20px; height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23003566' stroke-width='2' stroke-linejoin='round' d='M3.5 10.5 12 4l8.5 6.5V20h-5.5v-6h-6v6H3.5z'/%3E%3C/svg%3E");
}

@media (max-width: 991px) {
    .site-menu a { padding: 0 10px; }
    .site-header__slogan { font-size: 19px; }
}
@media (max-width: 767px) {
    .site-header__logo  { height: 48px; }
    .site-header__title { height: 28px; }
    .site-header__slogan { font-size: 17px; }
}

/* ---------- Étape 24 : réglage fin après comparaison côte à côte dans Firefox ---------- */
.site-header__logo   { height: 64px; }
.site-header__title  { height: 38px; }
.site-header__slogan { font-size: 25px; }
#nav { min-height: 56px; }
.site-menu a { height: 56px; padding: 0 20px; font-size: 15px; font-weight: 400; }
.site-header__inner { padding-top: 5px; padding-bottom: 5px; }
.site-menu a.site-menu__home,
.site-menu a.site-menu__home.is-current { margin-inline-end: 0; }
@media (max-width: 991px) {
    .site-menu a { padding: 0 10px; }
    .site-header__slogan { font-size: 19px; }
}
@media (max-width: 767px) {
    .site-header__logo  { height: 48px; }
    .site-header__title { height: 28px; }
    .site-header__slogan { font-size: 17px; }
}

/* ---------- Étape 25 : position verticale des logos et du slogan comme mahakim.ma ---------- */
@media (min-width: 768px) {
    .site-header__inner { padding-top: 3px; padding-bottom: 9px; }   /* tout remonte de 2 px, hauteur totale inchangée */
    .site-header__logo  { height: 62px; }
    .site-header__title { position: relative; top: -3px; height: 37px; }
    .site-header__slogan { font-size: 24px; line-height: 1.4; }
    .lang-ar .site-header__slogan { position: relative; top: -4px; left: -10px; }
}

/* =====================================================================
   Étape 26 : valeurs exactes relevées sur mahakim.ma (Chrome, 1512 px)
   en-tête 76 px (padding 2/50/10), barre 57 px (padding 10/50),
   slogan ArabsWell 25 px / 37.5 px, accent #FFBC2B,
   bouton accueil 37 px #FFC300 rayon 5, liens 13 px #f6f6f6 padding 12/20
   ===================================================================== */
:root { --site-marge: 49px; }   /* + 1 px de bordure de #pagelayout = 50 px comme mahakim.ma */
@media (max-width: 991px) { :root { --site-marge: 24px; } }

@media (min-width: 768px) {
    .site-header__logo   { position: relative; top: -1px; }
    .site-header__title  { top: 0; left: 2px; height: 38px; }
    .site-header__slogan { font-size: 25px; line-height: 37.5px; }
    .lang-ar .site-header__slogan { top: -1px; left: -10px; }
}
.site-header__slogan .slogan-accent { color: #FFBC2B; }

#nav { min-height: 57px; }
.site-menu a { height: 37px; padding: 12px 20px; font-size: 13px; line-height: 13px; font-weight: 400; color: #f6f6f6; border-bottom: 0; border-radius: 6px; }
.site-menu a:hover, .site-menu a:focus { background: rgba(255, 255, 255, .08); }
.site-menu a.is-current { color: #FFC300; }
.site-menu a.site-menu__home,
.site-menu a.site-menu__home.is-current {
    width: 37px; height: 37px; padding: 0; margin-inline-end: 4px;
    background: #FFC300; border-radius: 5px;
}
.site-menu a.site-menu__home::before,
.site-menu a.site-menu__home.is-current::before { width: 21px; height: 21px; }

/* ---------- Étape 27 : logo du ministère exactement 127 x 64 px comme mahakim.ma ---------- */
@media (min-width: 768px) {
    .site-header__inner  { padding-top: 3px; padding-bottom: 7px; }   /* hauteur totale inchangée (76 px) */
    .site-header__logo   { height: 64px; top: -2px; }
    .site-header__title  { top: -1px; }
    .lang-ar .site-header__slogan { top: -2px; }
}

/* ---------- Étape 28 : logo Mahakim affiché comme sur mahakim.ma
   (là-bas l'image est forcée à 113.4 x 64.4 px, ce qui l'étire en hauteur) ---------- */
@media (min-width: 768px) {
    .site-header__title {
        width: 113.39px; height: 64.39px; max-width: none;
        object-fit: fill;
        top: -2px; left: 0;
    }
    .site-header__inner { padding-bottom: 6.61px; }   /* garde 76 px de haut */
}

/* ---------- Étape 29 : bouton accueil identique à mahakim.ma
   (icône « pi-home » de PrimeIcons, 21 px, bleu #003566 sur carré #FFC300, sans effet au survol) ---------- */
.site-menu a.site-menu__home,
.site-menu a.site-menu__home:hover,
.site-menu a.site-menu__home:focus,
.site-menu a.site-menu__home.is-current { background: #FFC300; border: 0; }
.site-menu a.site-menu__home::before,
.site-menu a.site-menu__home.is-current::before {
    width: 21px; height: 21px;
    background: url("../img/icon-home.svg") no-repeat center / 21px 21px;
}

/* ---------- Étape 30 : onglets à la même largeur que les 3 premiers de mahakim.ma
   (137 / 108.98 / 120.36 px), texte centré ---------- */
@media (min-width: 992px) {
    .site-menu a[data-menu] { justify-content: center; padding-left: 0; padding-right: 0; }
    .site-menu a[data-menu="demande"] { width: 137px; }
    .site-menu a[data-menu="suivi"]   { width: 108.98px; }
    .site-menu a[data-menu="contact"] { width: 120.36px; }
}

/* ---------- Étape 31 : Droid Arabic Kufi hébergée dans le projet
   (l'ancienne adresse Google « earlyaccess » ne fonctionne plus : le site tombait sur Tahoma) ---------- */
@font-face {
    font-family: "Droid Arabic Kufi";
    src: url("../fonts/droid-arabic-kufi.woff2") format("woff2"), url("../fonts/droid-arabic-kufi.ttf") format("truetype");
    font-weight: 400; font-style: normal; font-display: block;
}
@font-face {
    font-family: "Droid Arabic Kufi";
    src: url("../fonts/droid-arabic-kufi-bold.woff2") format("woff2"), url("../fonts/droid-arabic-kufi-bold.ttf") format("truetype");
    font-weight: 700; font-style: normal; font-display: block;
}

/* ---------- Étape 32 : effet des onglets comme mahakim.ma
   survol et onglet actif : pas de fond, texte blanc, trait jaune #FFBC2B de 3 px
   à 2 px du bas, sur 70 % de la largeur (marges de 15 %), pas de contour au clic ---------- */
.site-menu a[data-menu] { position: relative; background: none; border: 0; color: #f6f6f6; outline: none; box-shadow: none; }
.site-menu a[data-menu]:hover,
.site-menu a[data-menu]:focus,
.site-menu a[data-menu]:active,
.site-menu a[data-menu].is-current,
.site-menu a[data-menu].is-current:hover { background: none; color: #fff; text-decoration: none; outline: none; box-shadow: none; }
.site-menu a[data-menu]::after {
    content: ""; position: absolute; left: 15%; right: 15%; bottom: 2px;
    height: 3px; background: #FFBC2B; opacity: 0;
}
.site-menu a[data-menu]:hover::after,
.site-menu a[data-menu].is-current::after { opacity: 1; }
.site-menu a.site-menu__home:focus { outline: none; box-shadow: none; }

/* ---------- Étape 33 : trait jaune sous le texte, comme mahakim.ma
   (là-bas le lien actif prend la largeur du texte + 2 x 20 px, et le trait fait 70 % de cette largeur)
   texte calé à droite à 20 px du bord, comme leurs onglets ---------- */
@media (min-width: 992px) {
    .site-menu a[data-menu] { justify-content: flex-start; padding-inline-start: 20px; padding-inline-end: 0; }
}
.site-menu a[data-menu]::after { content: none; }
.site-menu__text { position: relative; display: inline-block; line-height: 13px; }
.site-menu__text::after {
    content: ""; position: absolute; bottom: -10px; height: 3px;
    left: calc(15% - 14px); right: calc(15% - 14px);
    background: #FFBC2B; opacity: 0;
}
.site-menu a[data-menu]:hover .site-menu__text::after,
.site-menu a[data-menu].is-current .site-menu__text::after { opacity: 1; }

/* ---------- Étape 34 : espaces égaux entre les onglets
   (annule les largeurs fixes de l'étape 30 : chaque onglet = texte + 20 px de chaque côté,
   donc 40 px entre deux titres, comme sur mahakim.ma) ---------- */
@media (min-width: 992px) {
    .site-menu a[data-menu],
    .site-menu a[data-menu="demande"],
    .site-menu a[data-menu="suivi"],
    .site-menu a[data-menu="contact"] { width: auto; justify-content: center; padding-left: 20px; padding-right: 20px; }
}

/* ---------- Étape 35 : bouton accueil jaune seulement sur la page d'accueil
   ailleurs : fond transparent, maison blanche ; au survol : léger fond clair ---------- */
.site-menu a.site-menu__home,
.site-menu a.site-menu__home:hover,
.site-menu a.site-menu__home:focus { background: transparent; }
.site-menu a.site-menu__home:hover { background: rgba(255, 255, 255, .12); }
.site-menu a.site-menu__home::before {
    background: #fff;
    -webkit-mask: url("../img/icon-home.svg") no-repeat center / 21px 21px;
            mask: url("../img/icon-home.svg") no-repeat center / 21px 21px;
}
.site-menu a.site-menu__home.is-current,
.site-menu a.site-menu__home.is-current:hover { background: #FFC300; }
.site-menu a.site-menu__home.is-current::before { background: #003566; }

/* ---------- Étape 36 : la barre de défilement ne décale plus l'en-tête
   (place toujours réservée, qu'une page soit longue ou courte) ---------- */
html { overflow-y: scroll; }

/* ---------- Étape 37 : barre de défilement claire comme mahakim.ma
   (mahakim.ma déclare color-scheme: light ; sans cela Firefox suit le thème sombre de Windows) ---------- */
html { color-scheme: light; }

/* ---------- Étape 38 : plus d'espace entre les mots des titres en Arabswell
   (la police a des espaces très étroits : « كيف تتم العملية ؟ » paraissait collé) ---------- */
.lang-ar .home-b .hb-title,
.lang-ar .home-b .hb-hero__title,
.lang-ar .contact-page__title { word-spacing: .3em; }

/* ---------- Étape 42 : boutons d'accueil en tuiles plus grandes et plus carrées
   (icône au-dessus, texte centré, coins de 5 px comme les boutons de mahakim.ma) ---------- */
@media (min-width: 768px) {
    .hb-actions { grid-template-columns: repeat(2, 300px); justify-content: center; gap: 28px; max-width: none; }
    .hb-action {
        flex-direction: column; justify-content: center; align-items: center; text-align: center;
        gap: 16px; min-height: 220px; padding: 28px 24px; border-radius: 5px;
    }
    .hb-action svg { width: 64px; height: 64px; }
    .hb-action__text { align-items: center; gap: 6px; }
    .hb-action__label { font-size: 24px; }
}
@media (max-width: 767px) { .hb-action { border-radius: 5px; } }

/* ---------- Étape 43 : tuiles carrées (250 x 250) aux coins arrondis ---------- */
@media (min-width: 768px) {
    .hb-actions { grid-template-columns: repeat(2, 250px); gap: 28px; }
    .hb-action  { width: 250px; height: 250px; min-height: 0; padding: 24px 20px; border-radius: 18px; }
}
@media (max-width: 767px) { .hb-action { border-radius: 14px; } }

/* ---------- Étape 45 : plus aucune ombre sur les deux tuiles (ni au repos, ni au survol) ---------- */
.hb-action, .hb-action:hover, .hb-action:focus,
.hb-action--primary, .hb-action--primary:hover, .hb-action--primary:focus { box-shadow: none; }

/* ---------- CAPTCHA : pause après trop d'essais (champ et bouton « الخطوة التالية » désactivés) ---------- */
.captcha-compte { display: inline-block; min-width: 3.2em; font-weight: 700; color: var(--navy); unicode-bidi: isolate; }
html.captcha-bloque .btn-suivant,
html.captcha-bloque .regenerateCaptcha { opacity: .45; pointer-events: none; cursor: not-allowed; }
#middle input[disabled] { background: #eef1f4; color: #8a97a8; cursor: not-allowed; }

/* CAPTCHA : ce que l'on tape s'affiche en majuscules, comme sur l'image (la casse n'a plus d'importance) */
#texteCaptcha, input[id$="texteCaptcha"] { text-transform: uppercase; }

/* =====================================================================
   Étape 46 : pièces jointes (étape 3 de la demande) — zones de dépôt
   ===================================================================== */
#middle ul.liste-pj--upload { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 8px 0 0; padding: 0; list-style: none; float: none; width: 100%; }
#middle ul.liste-pj--upload > div { display: contents; }
#middle ul.liste-pj--upload li { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; float: none; width: auto; background: none; border: 0; }
#middle ul.liste-pj--upload li .intitule { float: none; width: auto; padding: 0; font-weight: 700; color: var(--ink); white-space: normal; }
#middle ul.liste-pj--upload li .content-bloc { float: none; width: auto; padding: 0; }
#middle ul.liste-pj--upload [id^="detail_"] { display: none; }

.pj-drop {
    position: relative; display: flex; align-items: center; gap: 14px;
    min-height: 92px; margin: 0; padding: 16px 18px;
    border: 2px dashed #b9c6d6; border-radius: 12px; background: #f8fafc;
    color: var(--navy); cursor: pointer; font-weight: 400;
    transition: border-color .15s, background-color .15s;
}
.pj-drop:hover, .pj-drop.is-over { border-color: var(--navy); background: #eef3f9; }
.pj-drop.has-file { border-style: solid; border-color: #2e7d4f; background: #f1f8f4; }
.pj-drop__icon { flex: none; display: flex; color: var(--navy); }
.pj-drop.has-file .pj-drop__icon { color: #2e7d4f; }
.pj-drop__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pj-drop__title { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-drop__sub { font-size: 13px; color: #5b6b80; }
.pj-drop__thumb { flex: none; width: 76px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: none; }
.pj-drop__thumb[src] { display: block; }
/* le vrai champ fichier couvre toute la boîte (clic et glisser-déposer), mais reste invisible */
.pj-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pj-drop:focus-within { outline: 3px solid rgba(0, 53, 102, .25); outline-offset: 2px; }

@media (max-width: 767px) {
    #middle ul.liste-pj--upload { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   Étape 47 : boutons d'étape cohérents sur toutes les pages
   - « الخطوة التالية » : plein bleu marine ; « رجوع » : blanc bordé de bleu
   - flèches dans le bon sens : en arabe, « suivant » pointe vers la gauche
   ===================================================================== */
#middle .btn-retour,
#middle .line-btn .btn-retour {
    background-color: #fff !important; color: var(--navy) !important;
    border: 2px solid var(--navy) !important;
    background-repeat: no-repeat !important; background-size: 18px 18px !important;
}
#middle .btn-retour:hover, #middle .btn-retour:focus { background-color: #f1f5f9 !important; color: var(--navy) !important; }
#middle .btn-suivant {
    background-color: var(--navy) !important; color: #fff !important; border: 2px solid var(--navy) !important;
    background-repeat: no-repeat !important; background-size: 18px 18px !important;
}
#middle .btn-suivant:hover, #middle .btn-suivant:focus { background-color: var(--navy-dark) !important; border-color: var(--navy-dark) !important; }

/* arabe : suivant ←  (à gauche) ; retour →  (à droite) */
.lang-ar #middle .btn-suivant { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") !important; background-position: left 14px center !important; padding-left: 40px !important; padding-right: 18px !important; }
.lang-ar #middle .btn-retour  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23003566' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7'/%3E%3C/svg%3E") !important; background-position: right 14px center !important; padding-right: 40px !important; padding-left: 18px !important; }
/* français / anglais / espagnol : suivant →  (à droite) ; retour ←  (à gauche) */
.lang-ltr #middle .btn-suivant { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7'/%3E%3C/svg%3E") !important; background-position: right 14px center !important; padding-right: 40px !important; padding-left: 18px !important; }
.lang-ltr #middle .btn-retour  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23003566' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") !important; background-position: left 14px center !important; padding-left: 40px !important; padding-right: 18px !important; }

/* ---------- Étape 48 : bouton « تعبئة تلقائية من البطاقة الوطنية » — largeur selon le texte (il était coupé à 170 px) ---------- */
#middle #ButtonAutofill,
#middle .line-btn #ButtonAutofill {
    width: auto !important; min-width: 170px; max-width: 100%;
    height: 44px; padding: 0 22px !important;
    white-space: nowrap; overflow: visible; text-overflow: clip;
    font-size: 15px; line-height: 40px;
}
@media (max-width: 480px) {
    #middle #ButtonAutofill { white-space: normal; height: auto; line-height: 1.4; padding: 10px 16px !important; }
}

/* =====================================================================
   Étape 49 : page « الهوية » (étape 2 de la demande)
   ===================================================================== */
/* 2) remplissage automatique en haut, avec une phrase d'aide */
#middle .autofill-bloc {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin: 4px 0 22px; padding: 14px 18px;
    background: #eef3f9; border: 1px solid #cfdbe9; border-radius: 10px;
}
#middle .autofill-bloc:not(:has(#ButtonAutofill)) { display: none !important; }
#middle .autofill-bloc__texte { margin: 0; flex: 1 1 260px; color: var(--ink); font-size: 15px; }
#middle .autofill-bloc #ButtonAutofill { margin: 0; flex: none; }

/* 3) sexe : deux pastilles */
#middle .choix-pastilles { display: flex !important; gap: 10px; flex-wrap: wrap; }
#middle .choix-pastilles > span { display: contents; }
#middle .choix-pastille {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-width: 110px; height: 44px; margin: 0; padding: 0 22px;
    border: 2px solid #c7d2df; border-radius: 22px; background: #fff;
    color: var(--ink); font-weight: 700; cursor: pointer; user-select: none;
    transition: border-color .15s, background-color .15s, color .15s;
}
#middle .choix-pastille input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
#middle .choix-pastille:hover { border-color: var(--navy); }
#middle .choix-pastille:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
#middle .choix-pastille:has(input:focus-visible) { outline: 3px solid rgba(0, 53, 102, .3); outline-offset: 2px; }

/* 4) « لا أتوفر على يوم و شهر الميلاد » sur sa propre ligne, sous la date */
#middle #DivAnneNaiss { grid-column: 1 / -1; flex-basis: 100%; width: 100%; margin-top: -6px; }
#middle #DivAnneNaiss .checkbox { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; float: none; font-weight: 400; }
#middle #DivAnneNaiss input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }

/* 5) bande « الطلب » sous le menu : masquée quand elle n'a qu'un seul élément */
.site-crumbs:not(:has(li + li)) { display: none !important; }

/* ---------- Étape 49b : correctif — sur le récapitulatif (étape 4), le sexe s'affichait deux fois
   (les boutons + le texte) car « display:flex !important » écrasait le display:none prévu ---------- */
#middle .form-label-inline[style*="display: none"],
#middle .form-label-inline[style*="display:none"],
#middle .choix-pastilles[style*="display: none"] { display: none !important; }

/* =====================================================================
   Étape 50 : récapitulatif (étape 4 « تأكيد »)
   ===================================================================== */
/* 1) boutons « تغيير » : secondaires (blanc bordé), crayon à côté du mot */
#middle .btn-modif {
    width: auto !important; min-width: 130px; height: 40px !important; line-height: 36px !important;
    padding: 0 18px 0 40px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003566' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") no-repeat left 14px center / 17px 17px !important;
    color: var(--navy) !important; border: 2px solid var(--navy) !important; border-radius: 8px;
    font-size: 15px; font-weight: 700; box-shadow: none;
}
.lang-ar #middle .btn-modif { padding: 0 40px 0 18px !important; background-position: right 14px center !important; }
#middle .btn-modif:hover, #middle .btn-modif:focus {
    background-color: var(--navy) !important; color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") !important;
}

/* 2) « الدولة » ne se place plus à côté du titre de la section : saut de ligne forcé après le titre */
#middle fieldset.row::before { content: ""; flex: 0 0 100%; height: 0; margin: 0; padding: 0; order: 0; }

/* 3) lieu de naissance : valeurs en texte simple, comme les autres */
#middle #Label_provinceListe, #middle #Label_communeListe {
    display: inline; padding: 0; background: none; border: 0; box-shadow: none; min-height: 0;
}

/* 4) valeur vide dans le récapitulatif : un tiret au lieu d'un blanc */
#middle .content-bloc > span[id^="Label_"]:empty::before { content: "—"; color: #9aa7b6; }

/* 5) texte légal : encadré calme au lieu d'un bloc en gras */
#middle div.check:not(.nd-ligne):not(.width-100):not(:has(input[type="radio"])):not(:has([id*="panelLivraison"])) {
    margin: 6px 0 16px; padding: 14px 18px;
    background: #f8fafc; border: 1px solid var(--line); border-inline-start: 4px solid var(--navy); border-radius: 8px;
}
#middle div.check:not(.nd-ligne):not(.width-100):not(:has(input[type="radio"])):not(:has([id*="panelLivraison"])), #middle div.check:not(.nd-ligne):not(.width-100):not(:has(input[type="radio"])):not(:has([id*="panelLivraison"])) label { font-weight: 400 !important; color: var(--ink); line-height: 1.9; font-size: 15px; }

/* 6) case « أصرح بأن ... » : plus grande et tout le texte est cliquable */
#middle .accord-case {
    display: inline-flex; align-items: center; gap: 12px; margin: 4px 0 0; padding: 12px 16px;
    border: 2px solid var(--line); border-radius: 10px; background: #fff;
    font-weight: 700; color: var(--ink); cursor: pointer; user-select: none;
}
#middle .accord-case:hover { border-color: var(--navy); }
#middle .accord-case:has(input:checked) { border-color: var(--navy); background: #eef3f9; }
#middle .accord-case input[type="checkbox"] { float: none !important; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); cursor: pointer; flex: none; }

/* ---------- Étape 51 : « رقم بطاقة التعريف الوطنية » à côté de « الجنسية » aussi sur le récapitulatif
   (le panneau reçoit un style display:block côté serveur, qui l'empêchait de se ranger en colonne) ---------- */
#middle fieldset.scheduler-border > #panel_NumeroCin:not([style*="none"]) { display: contents !important; }
#middle .accord-case .AcceptedAgreement { display: inline-flex; }

/* ---------- Étape 52 : bouton final « تأكيد وإرسال الطلب » — largeur selon le texte ---------- */
#middle .line-btn .btn-envoyer { width: auto !important; min-width: 170px; white-space: nowrap; }

/* =====================================================================
   Étape 53 : page « طلب جديد » — conditions et lieu de naissance
   (le style « encadré » de l'étape 50 ne s'applique plus ici)
   ===================================================================== */
/* case « يرجى الإطلاع وقبول شروط استخدام الخدمة » */
.nouvelle-demande div.check.nd-ligne {
    display: flex; align-items: center; gap: 12px; overflow: visible;
    padding: 14px 18px; border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
.nouvelle-demande div.check.nd-ligne:has(input:checked) { border-color: var(--navy); background: #eef3f9; }
.nouvelle-demande div.check.nd-ligne input[type="checkbox"] { float: none; flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); cursor: pointer; }
.nouvelle-demande div.check.nd-ligne label { margin: 0; font-weight: 400; cursor: pointer; }

/* lieu de naissance : deux grandes cases à choisir (المغرب / الخارج) */
.nouvelle-demande .nd-ligne .content-bloc { display: flex; gap: 14px; flex-wrap: wrap; float: none; width: auto; margin-top: 8px; }
.nouvelle-demande .content-bloc > .check.width-100 {
    position: relative; float: none !important; width: auto !important; flex: 0 1 220px;
    margin: 0; padding: 0; background: #fff; border: 2px solid #c7d2df; border-radius: 12px;
    transition: border-color .15s, background-color .15s, color .15s;
}
.nouvelle-demande .content-bloc > .check.width-100:hover { border-color: var(--navy); }
.nouvelle-demande .content-bloc > .check.width-100 input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.nouvelle-demande .content-bloc > .check.width-100 .intitule-auto { float: none; width: auto; margin: 0; padding: 0; }
.nouvelle-demande .content-bloc > .check.width-100 label {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 56px; margin: 0; padding: 0 24px;
    font-size: 17px; font-weight: 700; color: var(--ink); cursor: pointer;
}
/* petit rond à cocher dessiné, à gauche du mot */
.nouvelle-demande .content-bloc > .check.width-100 label::before {
    content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #9aa7b6; background: #fff; box-sizing: border-box;
}
.nouvelle-demande .content-bloc > .check.width-100:has(input:checked) { background: var(--navy); border-color: var(--navy); }
.nouvelle-demande .content-bloc > .check.width-100:has(input:checked) label { color: #fff; }
.nouvelle-demande .content-bloc > .check.width-100:has(input:checked) label::before { border-color: #fff; background: #FFC300; box-shadow: inset 0 0 0 3px var(--navy); }
.nouvelle-demande .content-bloc > .check.width-100:has(input:focus-visible) { outline: 3px solid rgba(0, 53, 102, .3); outline-offset: 2px; }
@media (max-width: 480px) { .nouvelle-demande .content-bloc > .check.width-100 { flex: 1 1 100%; } }

/* ---------- Étape 54 : lieu de naissance en « interrupteur à deux positions » (remplace les cartes de l'étape 53) ---------- */
.nouvelle-demande .nd-ligne .content-bloc {
    display: inline-flex; gap: 0; flex-wrap: nowrap; margin-top: 8px;
    padding: 4px; background: #eef1f5; border: 1px solid #d5dde7; border-radius: 12px;
}
.nouvelle-demande .content-bloc > .check.width-100 {
    flex: 0 0 auto; min-width: 150px; border: 0; border-radius: 9px; background: transparent;
}
.nouvelle-demande .content-bloc > .check.width-100:hover { background: rgba(0, 53, 102, .06); border: 0; }
.nouvelle-demande .content-bloc > .check.width-100 label { min-height: 44px; padding: 0 26px; font-size: 16px; color: #42536a; }
.nouvelle-demande .content-bloc > .check.width-100 label::before { content: none; }
.nouvelle-demande .content-bloc > .check.width-100:has(input:checked) {
    background: var(--navy); box-shadow: 0 2px 6px rgba(0, 36, 71, .25);
}
.nouvelle-demande .content-bloc > .check.width-100:has(input:checked) label { color: #fff; }
@media (max-width: 480px) {
    .nouvelle-demande .nd-ligne .content-bloc { display: flex; }
    .nouvelle-demande .content-bloc > .check.width-100 { flex: 1 1 50%; min-width: 0; }
}

/* ---------- Étape 55 : libellé « مكان الميلاد * » au-dessus de l'interrupteur, comme les autres libellés ---------- */
.nouvelle-demande .nd-ligne > .intitule {
    display: block; float: none; width: auto; margin: 0 0 8px; padding: 0;
    font-size: 16px; font-weight: 700; color: var(--ink);
}
.nouvelle-demande .nd-ligne > .intitule abbr.obligatoire,
#middle abbr.obligatoire {
    color: #c62828; text-decoration: none; border: 0; cursor: default; font-weight: 700; margin-inline-start: 2px;
}
.nouvelle-demande .nd-ligne > .content-bloc { margin-top: 0; }

/* Étape 56 : pas d'astérisque sur « مكان الميلاد » (le choix est de toute façon obligatoire) */
.nouvelle-demande .nd-ligne > .intitule abbr.obligatoire { display: none; }

/* =====================================================================
   Étape 57 : étape 1 « طرق التسليم » — les 3 modes de livraison en lignes à choisir
   (le texte de chaque option devient cliquable : les « for » d'origine ne correspondaient pas)
   ===================================================================== */
#middle div.check:has(.choix-ligne) { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; padding: 0; background: none; border: 0; }
#middle .choix-ligne {
    display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 18px;
    border: 2px solid #d5dde7; border-radius: 10px; background: #fff;
    font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; line-height: 1.6;
    transition: border-color .15s, background-color .15s;
}
#middle .choix-ligne:hover { border-color: var(--navy); }
#middle .choix-ligne input[type="radio"] {
    float: none !important; flex: none; width: 20px; height: 20px; margin: 0;
    accent-color: var(--navy); cursor: pointer;
}
#middle .choix-ligne:has(input:checked) { border-color: var(--navy); background: #eef3f9; color: var(--navy); }
#middle .choix-ligne:has(input:focus-visible) { outline: 3px solid rgba(0, 53, 102, .3); outline-offset: 2px; }

/* ---------- Étape 58 : explication sous chaque mode de livraison ---------- */
#middle .choix-ligne { align-items: flex-start; }
#middle .choix-ligne input[type="radio"] { margin-top: 4px; }
#middle .choix-texte { display: flex; flex-direction: column; gap: 2px; }
#middle .choix-titre { font-size: 16px; font-weight: 700; }
#middle .choix-desc { font-size: 14px; font-weight: 400; color: #5b6b80; line-height: 1.7; }
#middle .choix-desc strong { color: var(--navy); font-weight: 700; }
#middle .choix-ligne:has(input:checked) .choix-desc { color: #3d5070; }

/* ---------- Étape 59 : consigne « ملء الطلب باللغة العربية » en vraie note d'information ---------- */
.nouvelle-demande .nd-note {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0 0; padding: 12px 16px;
    background: #fff8e1; border: 1px solid #f3d98b; border-radius: 10px;
    font-size: 15px; font-weight: 600; color: #6b4e00;
}
.nouvelle-demande .nd-note::before {
    content: "i"; flex: none; width: 24px; height: 24px; border-radius: 50%;
    background: var(--navy); color: #fff; font: italic 700 14px/24px Georgia, serif; text-align: center;
}
.nouvelle-demande .nd-note[style*="none"] { display: none !important; }

/* pièce jointe à refaire / erreur renvoyée par le serveur */
.pj-drop.has-error { border-style: solid; border-color: #c62828; background: #fdf1f1; }
.pj-drop.has-error .pj-drop__sub { color: #c62828; font-weight: 700; }

/* =====================================================================
   Étape 60 : étape 5 « كيفية تسلم السجل العدلي »
   ===================================================================== */
/* résumé : vrai titre de section, plus de trou sous la juridiction */
#middle .recap > h2 {
    display: inline-block; margin: 0 0 20px; padding: 0 0 8px;
    border-bottom: 3px solid #FCC206;
    font-size: 21px; font-weight: 700; line-height: 1.5; color: var(--navy);
}
#middle .recap > br { display: none; }
#middle .recap .control-label.intitule strong { font-weight: 700; color: #5b6b80; font-size: 14px; }

/* choix du tribunal : libellé au-dessus, liste sur toute la largeur, sans encadré latéral */
#middle div.check:has([id*="panelLivraison"]) { margin: 0; padding: 0; background: none; border: 0; }
#middle [id$="panelLivraisonSurPlace"] .line { display: block; margin: 0 0 6px; padding: 0; }
#middle [id$="panelLivraisonSurPlace"] .line > .intitule,
#middle [id$="panelLivraisonSurPlace"] .line > .content-bloc {
    display: block; float: none; width: 100%; max-width: none; padding: 0; margin: 0 0 8px;
}
#middle [id$="panelLivraisonSurPlace"] .line > .intitule { font-weight: 700; color: var(--ink); font-size: 15px; }
#middle [id$="panelLivraisonSurPlace"] select.form-control { width: 100%; max-width: 100%; height: 46px; }
#middle [id$="panelLivraisonSurPlace"] > br,
#middle [id$="UpdatePanelLivraisonSurPlace"] > br { display: none; }
#middle .note-retrait { margin-top: 14px; }

/* =====================================================================
   Étape 61 : étape 5 sans le résumé (déjà vu à l'étape 4) ;
   la juridiction de traitement est affichée en une ligne, et la section prend toute la largeur
   ===================================================================== */
#middle .recap-masque { display: none; }
#middle .jur-traitement {
    flex: 0 0 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 0 0 18px; padding: 12px 16px;
    background: #eef3f9; border: 1px solid #cfdbe9; border-radius: 10px;
    font-size: 15px; color: var(--ink);
}
.lang-ar #middle .jur-traitement__libelle::after { content: " :"; }
.lang-ltr #middle .jur-traitement__libelle::after { content: " :"; }
#middle .jur-traitement__valeur { color: var(--navy); font-size: 16px; }
/* contenu de « طريقة التسليم » sur toute la largeur de la carte */
#middle fieldset .form-inline:has([id*="panelLivraison"]),
#middle fieldset .form-inline:has([id*="panelLivraison"]) > div.check,
#middle [id$="panelLivraisonSurPlace"],
#middle [id$="UpdatePanelLivraisonSurPlace"],
#middle [id$="panelLivraisonPostalRecommande"] { flex: 0 0 100%; width: 100%; max-width: none; float: none; }

/* Étape 61b : étape 1 — la carte « طرق التسليم » ne contient plus que son titre : on la masque,
   et la question « المرجو اختيار طريقة تسليم السجل العدلي » devient le titre de la section */
#middle fieldset.scheduler-border:not(:has(> :not(legend):not(script))) { display: none; }
#middle [id$="panelChoixMoyenLivraison"] > h2 {
    display: inline-block; margin: 8px 0 14px; padding: 0 0 8px;
    border-bottom: 3px solid #FCC206;
    font-size: 21px; font-weight: 700; line-height: 1.5; color: var(--navy);
}
#middle [id$="panelChoixMoyenLivraison"] > h2 b { font-weight: 700; }

/* =====================================================================
   Étape 62 : page de confirmation (CD.aspx)
   ===================================================================== */
#middle .msg-confirmation, #middle .msg-erreur {
    float: none; width: auto; margin: 0 0 8px; padding: 34px 24px 24px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; text-align: center;
}
#middle .msg-confirmation .content, #middle .msg-erreur .content { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; background: none; }
#middle .confirm-icone {
    width: 76px; height: 76px; border-radius: 50%; margin-bottom: 6px;
    background: #2e7d4f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 40px 40px;
    box-shadow: 0 0 0 8px #e3f2e8;
}
#middle .msg-erreur .confirm-icone { background: #c62828 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v8'/%3E%3Cpath d='M12 18.5v.01'/%3E%3C/svg%3E") no-repeat center / 40px 40px; box-shadow: 0 0 0 8px #fbe3e3; }
#middle .msg-confirmation .title, #middle .msg-erreur .title {
    margin: 0 0 6px; padding: 0; background: none !important; border: 0;
    font-size: 26px; font-weight: 700; line-height: 1.5; color: #2e7d4f;
}
#middle .msg-erreur .title { color: #c62828; }
#middle .confirm-numero {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    margin: 6px 0 10px; padding: 16px 34px;
    background: #eef3f9; border: 2px dashed #9fb4cc; border-radius: 12px;
}
#middle .confirm-numero__libelle { font-size: 14px; color: #5b6b80; font-weight: 700; }
#middle .confirm-numero__ligne { display: inline-flex; align-items: center; gap: 12px; }
#middle .confirm-numero__valeur { font-size: 32px; font-weight: 700; letter-spacing: 2px; color: var(--navy); direction: ltr; unicode-bidi: isolate; }
#middle .confirm-copier {
    width: 38px; height: 38px; padding: 0; border: 1px solid #c7d2df; border-radius: 8px; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003566' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E") no-repeat center / 20px 20px;
}
#middle .confirm-copier:hover { border-color: var(--navy); }
#middle .confirm-copier.is-copied { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e7d4f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); border-color: #2e7d4f; }
#middle .msg-confirmation p, #middle .msg-erreur p { margin: 0; font-size: 16px; color: #42536a; line-height: 1.8; }
#middle .msg-confirmation p strong { color: var(--ink); }

/* boutons : imprimer (bordé) · suivre (bordé) · accueil (plein) */
#middle .confirm-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 0; }
#middle .confirm-actions .btn { float: none !important; width: auto !important; min-width: 170px; padding: 0 22px !important; font-size: 15px; }
#middle .confirm-actions .btn-suivi {
    display: inline-flex; align-items: center; justify-content: center; height: 44px;
    background: #fff !important; color: var(--navy) !important; border: 2px solid var(--navy) !important; border-radius: 8px; text-decoration: none; font-weight: 700;
}
#middle .confirm-actions .btn-suivi:hover { background: #f1f5f9 !important; }
@media print { #middle .confirm-copier, #middle .confirm-actions { display: none !important; } }

/* Étape 61c : la grille à 2 colonnes ne s'applique pas au bloc « طريقة التسليم » */
#middle fieldset .form-inline:has([id*="panelLivraison"]) { display: block !important; }
#middle .line-btn.confirm-actions { justify-content: center !important; }

/* =====================================================================
   Étape 63 : résultat du suivi (SD.aspx)
   ===================================================================== */
#middle table.donnees.sans-observation th#col_03,
#middle table.donnees.sans-observation td[headers="col_03"] { display: none; }
#middle table.donnees td { vertical-align: middle; }
.statut-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 1.6;
    background: #eef1f5; color: #42536a; border: 1px solid #d5dde7;
}
.statut-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.statut-badge.statut--nouveau { background: #e8f0fb; color: #1c5aa6; border-color: #c4d8f2; }
.statut-badge.statut--cours   { background: #fff6e0; color: #8a5a00; border-color: #f1d999; }
.statut-badge.statut--pret    { background: #e6f4ea; color: #2e7d4f; border-color: #bfe0ca; }
.statut-badge.statut--refus   { background: #fdecec; color: #c62828; border-color: #f3c4c4; }
@media print { .statut-badge { border: 1px solid #999; background: none !important; } }
/* même ordre des boutons partout : imprimer · (suivre) · accueil */
#middle .line-btn.confirm-actions { flex-direction: row !important; }
#middle .confirm-actions .btn-print { order: 1; }
#middle .confirm-actions .btn-suivi { order: 2; }
#middle .confirm-actions a.btn[href*="ccueil"] { order: 3; }
.lang-ar #middle .confirm-actions { direction: rtl; }
.lang-ltr #middle .confirm-actions { direction: ltr; }

/* =====================================================================
   Étape 64 : suivi (SD.aspx) — carte du statut + barre d'étapes + historique discret
   ===================================================================== */
#middle .suivi { flex: 0 0 100%; width: 100%; }
#middle .suivi-carte {
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    margin: 4px 0 18px; padding: 24px 20px; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px;
}
#middle .suivi-carte__libelle { font-size: 14px; font-weight: 700; color: #5b6b80; }
#middle .suivi-carte__statut { font-size: 20px; padding: 8px 22px; }
#middle .suivi-carte__statut::before { width: 10px; height: 10px; }
#middle .suivi-carte__date { font-size: 14px; color: #5b6b80; }
#middle .suivi-carte__date strong { color: var(--ink); direction: ltr; unicode-bidi: isolate; }

#middle .suivi-alerte { margin: 0 0 18px; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
#middle .suivi-alerte--refus { background: #fdecec; border: 1px solid #f3c4c4; color: #b71c1c; }
#middle .suivi-alerte--paiement { background: #fff8e1; border: 1px solid #f3d98b; color: #6b4e00; }

/* barre d'étapes */
#middle .suivi-etapes { display: flex; margin: 0 0 26px; padding: 0; list-style: none; counter-reset: none; }
#middle .suivi-etapes li {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; font-size: 14px; color: #8a97a8; font-weight: 600;
}
#middle .suivi-etapes li::before {           /* trait vers l'étape précédente */
    content: ""; position: absolute; top: 17px; height: 3px; background: #d5dde7;
    inset-inline-start: -50%; width: 100%; z-index: 0;
}
#middle .suivi-etapes li:first-child::before { display: none; }
#middle .suivi-etapes__rond {
    position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 3px solid #d5dde7; color: #8a97a8; font-weight: 700;
}
#middle .suivi-etapes li.is-fait, #middle .suivi-etapes li.is-actuel { color: var(--navy); }
#middle .suivi-etapes li.is-fait::before, #middle .suivi-etapes li.is-actuel::before { background: var(--navy); }
#middle .suivi-etapes li.is-fait .suivi-etapes__rond { background: var(--navy); border-color: var(--navy); color: #fff; font-size: 0; }
#middle .suivi-etapes li.is-fait .suivi-etapes__rond::after { content: "✓"; font-size: 16px; }
#middle .suivi-etapes li.is-actuel .suivi-etapes__rond { background: #FFC300; border-color: #FFC300; color: var(--navy); box-shadow: 0 0 0 6px rgba(255, 195, 0, .25); }
#middle .suivi-etapes li.is-actuel .suivi-etapes__nom { font-weight: 700; }
#middle .suivi-etapes li.is-arret { color: #c62828; }
#middle .suivi-etapes li.is-arret .suivi-etapes__rond { background: #c62828; border-color: #c62828; color: #fff; font-size: 0; }
#middle .suivi-etapes li.is-arret .suivi-etapes__rond::after { content: "✕"; font-size: 15px; }

/* historique : liste discrète au lieu du grand tableau */
#middle .suivi-historique-titre { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--ink); }
#middle table.suivi-historique { border: 0; background: none; margin: 0; }
#middle table.suivi-historique thead { display: none; }
#middle table.suivi-historique, #middle table.suivi-historique tbody { display: block; width: 100%; }
#middle table.suivi-historique tr {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none !important;
}
#middle table.suivi-historique td { display: block; width: auto !important; padding: 0 !important; border: 0 !important; background: none !important; }
#middle table.suivi-historique td[headers="col_01"] { color: #5b6b80; font-size: 14px; direction: ltr; unicode-bidi: isolate; min-width: 150px; }
#middle table.suivi-historique td[headers="col_03"] { flex-basis: 100%; padding-inline-start: 177px !important; margin-top: -4px; color: #1f2d3d; font-size: 14px; }   /* sous le statut, pas sous la date */
@media (max-width: 600px) { #middle table.suivi-historique td[headers="col_03"] { padding-inline-start: 0 !important; } }
#middle table.suivi-historique.sans-observation td[headers="col_03"] { display: none; }
#middle table.suivi-historique .statut-badge { font-size: 13px; padding: 3px 12px; }

@media (max-width: 600px) {
    #middle .suivi-etapes li { font-size: 12px; }
    #middle .suivi-etapes__rond { width: 30px; height: 30px; }
    #middle .suivi-etapes li::before { top: 14px; }
}
/* pas de place réservée pour une remarque vide */
#middle table.suivi-historique td[headers="col_03"]:has(> div:empty),
#middle table.suivi-historique td[headers="col_03"]:empty { display: none !important; }

/* ===== Étape 68 : adresse de livraison postale (étape 5) ===== */
/* note en texte normal, pas en rouge */
#middle .panel-danger > .panel-heading > div > h1 { color: #1f2d3d !important; font-size: 14px !important; font-weight: 400 !important; }
/* champs plus larges */
#middle [id$="panelLivraisonPostalRecommande"] .form-group > table { width: 100%; max-width: 760px; }
#middle [id$="panelLivraisonPostalRecommande"] .form-group > table td:first-child { width: 210px; }
#middle [id$="panelLivraisonPostalRecommande"] .form-group > table td .content-bloc { width: 100% !important; float: none; padding: 0; }
#middle [id$="panelLivraisonPostalRecommande"] .form-group > table .form-control { width: 100% !important; max-width: none; }
/* logos de paiement : petits, à côté du bouton */
#middle img.logo-paiement { display: block; height: 30px; width: auto; margin: 0 auto 12px; }
#middle .line-btn img.logo-paiement { float: none; align-self: center; margin: 0 16px 0 0; margin-inline-start: auto; margin-inline-end: 16px; }

/* ===== Étape 69 : bouton de paiement dans la carte de suivi ===== */
#middle .suivi-payer { display: flex; justify-content: center; margin: 4px 0 18px; }
#middle .suivi-payer:not(:has(input)) { display: none; }
#middle .suivi-payer .btn { float: none; min-width: 200px; }

/* ===== Étape 73 : bloc paiement du suivi (note + bouton côte à côte, icône carte) ===== */
#middle .suivi-paiement { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
#middle .suivi-paiement .btn-payer { float: none; margin: 0; white-space: nowrap; }
.lang-ar #middle .btn-payer, .lang-ltr #middle .btn-payer { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14' rx='2.5'/%3E%3Cpath d='M2.5 10h19M6.5 15h4'/%3E%3C/svg%3E") !important; background-size: 20px 20px !important; }
.lang-ar #middle .btn-payer { background-position: right 14px center !important; padding-right: 44px !important; padding-left: 20px !important; }
.lang-ltr #middle .btn-payer { background-position: left 14px center !important; padding-left: 44px !important; padding-right: 20px !important; }
@media (max-width: 600px) { #middle .suivi-paiement .btn-payer { width: 100%; } }

/* ===== Étape 76 : page de vérification (CAPTCHA) ===== */
/* largeur normale, comme les autres pages (la carte étroite a été annulée) */
#middle .BlocForm:has(.captcha-bloc) fieldset p { margin-bottom: 18px; }
/* image + bouton + champ sur une ligne */
#middle .captcha-bloc { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#middle .captcha-image { display: flex; align-items: center; gap: 8px; }
#middle .captcha-img { display: block; height: 64px; width: auto; border: 1px solid var(--line, #dbe3ec); border-radius: 8px; float: none; margin: 0; }
#middle .regenerateCaptcha { float: none !important; clear: none; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; font-size: 0;
    border: 1px solid #cbd5e1; border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23163a6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 5.7'/%3E%3Cpath d='M20 4v7h-7'/%3E%3C/svg%3E") no-repeat center / 20px 20px !important; }
#middle .regenerateCaptcha:hover { background-color: #f1f5f9 !important; border-color: var(--navy, #163a6b); }
#middle .captcha-champ { flex: 1 1 200px; width: auto !important; max-width: none !important; height: 44px; font-size: 18px; letter-spacing: 4px; text-align: center; float: none; }
#middle .captcha-statut { margin-top: 10px; min-height: 1em; }
@media (max-width: 600px) { #middle .captcha-champ { width: 100% !important; max-width: none !important; flex-basis: 100%; } }

/* le bloc (image + bouton + champ) s'arrête où s'arrête la phrase d'instruction au-dessus */
#middle fieldset:has(.captcha-bloc) { display: grid; grid-template-columns: max-content; justify-content: start; }
#middle fieldset:has(.captcha-bloc) > * { min-width: 0; }
#middle fieldset:has(.captcha-bloc) > legend { justify-self: start; width: auto; }
@media (max-width: 760px) { #middle fieldset:has(.captcha-bloc) { grid-template-columns: 1fr; } }

/* ===== Étape 77 : suivi sur téléphone ===== */
/* le titre (avec le numéro) passe à la ligne au lieu de sortir de l'écran */
#middle fieldset legend { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    #middle fieldset legend { font-size: 18px; }
    /* historique : la date toujours sur sa propre ligne, le statut en dessous */
    #middle table.suivi-historique td[headers="col_01"] { flex-basis: 100%; min-width: 0; font-size: 13px; }
    #middle table.suivi-historique tr { gap: 6px; }
}

/* ===== Étape 82 : accueil sans texte d'introduction ni sous-titres ===== */
/* titre + petit trait doré, puis deux tuiles avec une flèche ronde en bas */
#middle .hb-hero { padding: 46px 24px 50px !important; }
#middle .hb-hero__title { margin-bottom: 0 !important; }
#middle .hb-hero__title::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 2px; background: #FFBC2B; margin: 16px auto 0; }
#middle .hb-actions { margin-top: 34px !important; gap: 24px !important; }
#middle .hb-action { width: 240px !important; height: 230px !important; position: relative; padding-bottom: 46px !important; transition: transform .15s, box-shadow .15s; }
#middle .hb-action:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 40, 85, .12); }
#middle .hb-action svg { width: 60px !important; height: 60px !important; }
#middle .hb-action__label { font-size: 25px !important; }
#middle .hb-action::after { content: ""; position: absolute; bottom: 20px; left: 50%; margin-left: -17px; width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255, 255, 255, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23FFBC2B' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") no-repeat center / 18px; }
#middle .hb-action:not(.hb-action--primary)::after { background: #eef3f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23003566' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") no-repeat center / 18px; }
/* en français / anglais / espagnol, la flèche pointe vers la droite */
.lang-ltr #middle .hb-action::after { transform: scaleX(-1); }
@media (max-width: 600px) { #middle .hb-action { width: 46% !important; height: 190px !important; } }

/* Étape 82b : flèches retirées des tuiles */
#middle .hb-action::after { content: none !important; display: none !important; }
#middle .hb-action { padding: 20px !important; }   /* même marge en haut et en bas : icône + titre centrés */
