/* ===== Polices (hébergées sur le site, licence OFL : polices/LICENCE-OFL.txt) ===== */
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url(polices/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Montserrat; font-weight: 800; font-display: swap; src: url(polices/montserrat-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(polices/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(polices/inter-latin-600-normal.woff2) format("woff2"); }

/* ===== Couleurs du logo ===== */
:root {
  --marine: #0B2545; --marine-2: #13315C; --marine-3: #1D4372;
  --orange: #F28C28; --orange-clair: #FF9D3F; --vert: #3DBB62;
  --encre: #0F1B2D; --texte: #3A4657; --doux: #5D6A7D; --fond: #F5F7FA; --carte: #FFFFFF; --bord: #E1E7EF;
  --rouge: #C62828;
  --titres: Montserrat, "Segoe UI", Arial, sans-serif;
  --corps: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --rayon: 16px;
  --ombre: 0 1px 2px rgba(11, 37, 69, .06), 0 10px 30px rgba(11, 37, 69, .07);
}
[data-couleur="technologie"] { --c: #2F80ED; --c-texte: #1E5FB8; --c-fond: #EAF2FD; }
[data-couleur="agriculture"] { --c: #3DBB62; --c-texte: #1F7A3C; --c-fond: #E8F7ED; }
[data-couleur="construction"] { --c: #F28C28; --c-texte: #A8560B; --c-fond: #FEF1E4; }
[data-couleur="genie-civil"] { --c: #D9A21B; --c-texte: #8A6407; --c-fond: #FBF4E1; }

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 400 16px/1.65 var(--corps);
  touch-action: manipulation;
}
:lang(ar) { --titres: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif; --corps: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif; }
:lang(zh-Hans) { --titres: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; --corps: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
h1, h2, h3 { font-family: var(--titres); color: var(--encre); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 2.8vw, 32px); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 18px; font-weight: 700; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(zh-Hans) h1, :lang(zh-Hans) h2 { letter-spacing: 0; }
p { margin: 0 0 12px; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { flex-shrink: 0; }
[dir="rtl"] .fleche { transform: scaleX(-1); }
.conteneur { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saut { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--orange); color: var(--marine); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.saut:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
main:focus { outline: none; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 2px solid transparent;
  font: 700 15px/1.2 var(--titres); text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-grand { min-height: 52px; padding: 14px 26px; font-size: 16px; }
.btn-orange { background: var(--orange); color: var(--marine); }
.btn-orange:hover { background: var(--orange-clair); }
.btn-ligne { background: transparent; color: var(--marine); border-color: #C5D0DE; }
.btn-ligne:hover { border-color: var(--marine); }
.btn-ligne-clair { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ligne-clair:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== En-tête (logo BATKO repris) ===== */
.batko-header { background: var(--marine); padding: 16px 24px; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.batko-header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 12px 28px; }
.batko-brand { display: inline-block; line-height: 0; flex-shrink: 0; }
.batko-logo { width: 250px; max-width: 100%; height: auto; display: block; direction: ltr; }
.batko-logo text { font-family: Montserrat, Arial, sans-serif; fill: #FFFFFF; }
.batko-nav { display: flex; gap: 4px; }
.batko-nav a {
  font: 700 15px/1 var(--titres); color: #D7E1EE; text-decoration: none; padding: 12px 14px; border-radius: 10px;
}
.batko-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.batko-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--orange); border-radius: 10px 10px 0 0; }
.entete-outils { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

/* Sélecteur de langue */
.langues { position: relative; }
.langues summary {
  list-style: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  color: #fff; border: 2px solid rgba(255, 255, 255, .2); border-radius: 12px; cursor: pointer; font: 700 14px/1 var(--titres);
}
.langues summary::-webkit-details-marker { display: none; }
.langues summary:hover, .langues[open] summary { border-color: rgba(255, 255, 255, .5); }
.langues ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; min-width: 180px; padding: 6px;
  background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(11, 37, 69, .25);
}
.langues a { display: block; padding: 10px 14px; border-radius: 9px; color: var(--encre); text-decoration: none; font-weight: 600; }
.langues a:hover { background: var(--fond); }
.langues a[aria-current="true"] { background: #FEF1E4; color: #8A4A0A; }

/* ===== Accueil ===== */
.hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(242, 140, 40, .18), transparent 60%),
    radial-gradient(700px 380px at 0% 110%, rgba(61, 187, 98, .14), transparent 60%),
    linear-gradient(180deg, var(--marine) 0%, var(--marine-2) 100%);
  color: #C9D6E8; padding: 72px 0 80px;
}
.hero h1, .page-titre h1 { color: #fff; max-width: 860px; }
.surtitre { display: inline-flex; align-items: center; gap: 8px; color: var(--orange); font: 700 14px/1 var(--titres); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.surtitre::before { content: ""; width: 28px; height: 3px; background: var(--orange); border-radius: 2px; }
:lang(ar) .surtitre, :lang(zh-Hans) .surtitre { letter-spacing: 0; }
.hero-intro { font-size: clamp(16px, 1.6vw, 19px); max-width: 760px; margin-bottom: 28px; }
.hero-domaines { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.hero-domaines li {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-weight: 600; font-size: 14px;
}
.hero-domaines .icone-petite { color: var(--c); }
.icone-petite { width: 18px; height: 18px; }

.bloc { padding: 72px 0; }
.bloc-clair { background: #fff; border-block: 1px solid var(--bord); }
.intro-bloc { color: var(--doux); max-width: 680px; margin-bottom: 32px; }
#titre-domaines { margin-bottom: 28px; }
.grille-domaines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.carte-domaine {
  position: relative; display: flex; flex-direction: column; background: var(--carte); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 26px 22px 22px; box-shadow: var(--ombre); overflow: hidden;
}
.carte-domaine::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.carte-domaine h3 { font-size: 20px; margin: 16px 0 4px; }
.carte-sous { color: var(--c-texte); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.carte-domaine p:not(.carte-sous) { color: var(--doux); font-size: 15px; }
.pastille { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--c-fond); color: var(--c-texte); }
.lien-fleche { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; color: var(--c-texte); font: 700 15px/1.3 var(--titres); text-decoration: none; min-height: 44px; }
.lien-fleche:hover { text-decoration: underline; text-underline-offset: 4px; }
.lien-fleche::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */

.etapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: etape; }
.etapes li { padding: 24px 22px; border-radius: var(--rayon); background: var(--fond); border: 1px solid var(--bord); }
.numero { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--marine); color: #fff; font: 800 15px/1 var(--titres); margin-bottom: 14px; }
.etapes p { color: var(--doux); font-size: 15px; margin: 0; }

.appel {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--bord); border-radius: 22px; padding: 36px 40px; box-shadow: var(--ombre);
  border-inline-start: 6px solid var(--orange);
}
.appel p { color: var(--doux); margin: 0; }
.appel h2 { margin-bottom: 6px; }

/* ===== Services ===== */
.page-titre {
  background: radial-gradient(800px 380px at 90% -20%, rgba(242, 140, 40, .16), transparent 60%), linear-gradient(180deg, var(--marine), var(--marine-2));
  color: #C9D6E8; padding: 56px 0 40px;
}
.sommaire { display: flex; flex-wrap: wrap; gap: 10px; }
.sommaire a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none; font-weight: 600;
}
.sommaire a:hover { background: rgba(255, 255, 255, .13); }
.sommaire .icone-petite { color: var(--c); }
.service { padding: 64px 0; border-bottom: 1px solid var(--bord); }
.service:nth-of-type(even) { background: #fff; }
.service-tete { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.service-tete h2 { margin: 0; }
.surtitre-service { color: var(--c-texte); font: 700 14px/1 var(--titres); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; }
:lang(ar) .surtitre-service, :lang(zh-Hans) .surtitre-service { letter-spacing: 0; }
.service-texte { max-width: 820px; font-size: 17px; margin-bottom: 28px; }
.service-listes { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; margin-bottom: 28px; }
.groupe { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); }
.service:nth-of-type(even) .groupe { background: var(--fond); box-shadow: none; }
.groupe h3 { font-size: 16px; margin-bottom: 14px; }
.groupe-secondaire h3 { color: var(--doux); }
.liste li { position: relative; padding-inline-start: 26px; margin-bottom: 10px; line-height: 1.5; }
.liste li:last-child { margin-bottom: 0; }
.liste li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .5em; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.groupe-secondaire .liste li::before { background: transparent; border: 2px solid var(--c); }

/* ===== Pied de page ===== */
.pied { background: var(--marine); color: #B9C7DA; padding: 56px 0 0; }
.pied-grille { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr 1fr; gap: 32px; }
.pied-nom { font: 800 26px/1 Montserrat, Arial, sans-serif; color: #fff; letter-spacing: .06em; margin-bottom: 10px; }
.pied-titre { font-size: 13px; color: var(--orange); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }
:lang(ar) .pied-titre, :lang(zh-Hans) .pied-titre { letter-spacing: 0; }
.pied a { display: block; color: #E3EAF3; text-decoration: none; padding: 5px 0; width: fit-content; }
[dir="rtl"] .pied a[dir="ltr"] { text-align: right; }
.pied a:hover { color: #fff; text-decoration: underline; }
.pied-bas { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 40px; padding-block: 20px; font-size: 14px; color: #8EA0B8; }
.barre-mobile { display: none; }

/* ===== Formulaires (fenêtres) ===== */
.fenetre {
  width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 20px;
  background: #fff; color: var(--texte); box-shadow: 0 30px 80px rgba(11, 37, 69, .35); overflow: auto; overscroll-behavior: contain;
}
.fenetre::backdrop { background: rgba(11, 37, 69, .6); }
.fenetre-tete {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--bord);
}
.fenetre-tete h2 { margin: 0; font-size: 22px; }
.fermer { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--fond); color: var(--encre); cursor: pointer; }
.fermer:hover { background: var(--bord); }
.formulaire { padding: 22px 24px 24px; }
.grille-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ[data-champ="sujet"], .champ[data-champ="message"], .champ[data-champ="description"],
.champ[data-champ="prestation_libre"], .champ[data-champ="pieces"] { grid-column: 1 / -1; }
.champ label { font-weight: 600; color: var(--encre); font-size: 15px; }
.facultatif { font-weight: 400; color: var(--doux); font-size: 14px; }
.champ input, .champ select, .champ textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid #C9D3E0; border-radius: 12px;
  background: #fff; color: var(--encre); font: 400 16px/1.4 var(--corps);
}
.champ textarea { resize: vertical; min-height: 120px; }
.champ input[type="file"] { padding: 10px; background: var(--fond); }
[dir="rtl"] .champ input[dir="ltr"] { text-align: right; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--marine-3); box-shadow: 0 0 0 3px rgba(29, 67, 114, .18); }
.champ [aria-invalid="true"] { border-color: var(--rouge); }
.aide { font-size: 14px; color: var(--doux); margin: 0; }
.erreur { color: var(--rouge); font-size: 14px; font-weight: 600; margin: 0; }
.erreur:empty { display: none; }
.piege { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.etat { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: #FDECEC; color: #8E1B1B; font-weight: 600; }
.etat:empty { display: none; }
.etat a { color: inherit; }
.fenetre-pied { display: flex; justify-content: flex-end; margin-top: 20px; }
.fenetre-pied .btn { min-width: 160px; }
.succes { padding: 40px 28px 36px; text-align: center; color: var(--texte); }
.succes svg { color: var(--vert); margin-bottom: 12px; }
.succes:focus { outline: none; }
body.fenetre-ouverte { overflow: hidden; }

/* ===== Écrans moyens ===== */
@media (max-width: 1080px) {
  .grille-domaines { grid-template-columns: repeat(2, 1fr); }
  .etapes { grid-template-columns: repeat(2, 1fr); }
  .pied-grille { grid-template-columns: 1fr 1fr; }
  .entete-action.btn-ligne-clair { display: none; }
}

/* ===== Téléphone ===== */
@media (max-width: 820px) {
  html { scroll-padding-top: 16px; }
  .batko-header { position: static; padding: 12px 16px 0; }
  .batko-header-inner { flex-wrap: wrap; }
  .batko-logo { width: 190px; }
  .batko-nav { order: 3; width: 100%; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 4px; }
  .batko-nav a { padding: 14px 12px; }
  .entete-action { display: none; }
  .conteneur { padding-inline: 16px; }
  .hero { padding: 44px 0 52px; }
  .bloc, .service { padding: 48px 0; }
  .appel { padding: 26px 22px; }
  .service-listes { grid-template-columns: 1fr; }
  .barre-mobile {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; position: fixed; inset: auto 0 0 0; z-index: 40;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--bord); box-shadow: 0 -6px 20px rgba(11, 37, 69, .08);
  }
  .barre-mobile .btn { padding-inline: 10px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .fenetre { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .fenetre-tete { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .formulaire { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .fenetre-pied .btn { width: 100%; }
}
@media (max-width: 560px) {
  .grille-domaines, .etapes, .pied-grille, .grille-champs { grid-template-columns: 1fr; }
  .hero .actions .btn, .appel .actions .btn, .service .actions .btn { flex: 1 1 100%; }
  .langues summary { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
