/* Polices auto-hébergées (sous-ensemble latin/français, SIL Open Font License 1.1,
   voir assets/fonts/LICENSE-*.txt). Aucune requête vers Google Fonts. */
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/dm-serif-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Charte graphique « Recherche MT 67 – Inter CPTS » */
  --indigo: #3F4E78;      /* titres, icônes, texte important */
  --indigo-dark: #2f3b5e;
  --ink-deep: #26304f;    /* texte sur fond corail (contraste) */
  --slate: #6779a4;
  --grey: #cbcbcb;
  --muted: #5e6984;
  --sky: #74a8de;
  --mist: #E8EDF6;        /* fonds d'étapes et de texte */
  --coral: #D9856B;       /* éléments de contraste / à mettre en avant */
  --coral-ink: #B2593E;   /* corail foncé : icônes et textes sur fond clair */
  --peach: #fbefe0;       /* dérivé de #f4daba */
  --white: #FFFFFF;
  --line: #d3daea;
  --focus: #3F4E78;
  --radius: 24px;
  --font-title: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-sub: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font: "Arial MT Pro", Arial, "Helvetica Neue", Helvetica, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--indigo); background: var(--white); line-height: 1.55; font-size: 1.0625rem; }
.wrap { width: min(980px, 100% - 2.5rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: .6rem 1rem; z-index: 10; border-radius: 8px; }
.skip:focus { left: .5rem; top: .5rem; }
/* Texte réservé aux lecteurs d'écran */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* En-tête */
.top { background: var(--indigo); }
.brand { font-family: var(--font-sub); display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .6rem; margin: 0; padding: 1.1rem 0; font-weight: 700; color: var(--white); text-decoration: none; }
.brand small { font-family: var(--font); font-size: .9rem; font-weight: 400; color: var(--mist); }
/* Le contour indigo par défaut serait invisible sur le fond indigo de l'en-tête */
.top :focus-visible { outline-color: var(--white); }
.dot { width: .85rem; height: .85rem; border-radius: 50%; background: var(--coral); box-shadow: 1.1rem -.3rem 0 -.2rem var(--sky); margin-right: 1rem; }

/* Hero */
.hero { position: relative; z-index: 1; background: var(--white); padding: 1.5rem 0 4rem; }
.hero-in { position: relative; }
/* Illustration : fondue dans le fond blanc, à droite du titre sur grand écran */
.illus { display: block; position: absolute; top: -.5rem; right: -1.5rem; width: min(440px, 46%); pointer-events: none; z-index: 0; }
.illus img { display: block; width: 100%; height: auto; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 68% 66% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 68% 66% at 50% 50%, #000 62%, transparent 100%); }
h1, .lead { position: relative; z-index: 1; }
@media (max-width: 899px) {
  .illus { top: 0; right: -2.5rem; width: min(440px, 112%); opacity: .3; }
}
h1 { margin: 2rem 0 1rem; font-family: var(--font-title); font-size: clamp(2.2rem, 5.8vw, 3.8rem); line-height: 1.08; letter-spacing: -.01em; font-weight: 400; max-width: 17ch; color: var(--indigo); }
.lead { margin: 0 0 1.25rem; max-width: 58ch; color: var(--muted); font-size: 1.15rem; }
.avertissement { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: .75rem; max-width: 58ch; margin: 0 0 2.25rem; padding: .85rem 1.1rem; border-radius: 16px; background: var(--peach); box-shadow: inset 4px 0 0 var(--coral); color: var(--indigo); font-size: .98rem; line-height: 1.45; }
.avertissement svg { flex: none; margin-top: .1rem; color: var(--coral-ink); }

/* Recherche */
.search label { font-family: var(--font-sub); display: block; margin: 0 0 .6rem .5rem; font-weight: 700; }
.field { scroll-margin-top: 1rem; position: relative; display: flex; align-items: center; gap: .5rem; background: var(--white); border: 2px solid var(--line); border-radius: 999px; padding: .4rem .4rem .4rem 1.25rem; box-shadow: 0 10px 30px rgba(63, 78, 120, .16); transition: border-color .15s; max-width: 720px; }
.field:focus-within { border-color: var(--indigo); }
.search-ico { display: flex; color: var(--indigo); flex: none; }
.combo { flex: 1; min-width: 0; }
.combo input { width: 100%; font: inherit; font-size: 1.15rem; padding: .7rem .25rem; border: 0; background: transparent; color: var(--indigo); }
.combo input:focus { outline: none; }
.combo input::placeholder { color: var(--muted); }
.field button { font: inherit; font-family: var(--font-sub); font-weight: 600; padding: .8rem 1.6rem; border: 0; border-radius: 999px; background: var(--indigo); color: var(--white); cursor: pointer; transition: background .15s; }
.btn-ico { display: none; }
.field button:hover { background: var(--indigo-dark); }

.step-rue { margin-top: 2rem; padding-left: 1.25rem; border-left: 4px solid var(--coral); }
.hint { margin: 0 0 1rem; color: var(--muted); max-width: 56ch; }
.step-rue[hidden], .suggestions[hidden], .result[hidden] { display: none; }

.suggestions { position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: .5rem; list-style: none; background: var(--white); border-radius: 20px; box-shadow: 0 16px 40px rgba(63, 78, 120, .24); }
.suggestions li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: 12px; cursor: pointer; }
.suggestions li small { color: var(--muted); font-size: .9rem; white-space: nowrap; align-self: center; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--mist); }
.suggestions li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--indigo); }
.suggestions mark { background: none; color: var(--indigo-dark); font-weight: 800; }
.suggestions li.none, .suggestions li.none:hover { cursor: default; color: var(--muted); background: none; box-shadow: none; }

.status { min-height: 1.5rem; margin: 1.25rem 0 0 .5rem; color: var(--muted); }
.status.error { color: #a12d2d; font-weight: 600; }

/* Résultat */
.result { position: relative; margin-top: 2rem; background: var(--mist); border: 3px solid var(--white); border-radius: var(--radius); padding: 1.5rem 2rem 2rem; box-shadow: 0 20px 50px rgba(63, 78, 120, .16); max-width: 720px; }
.result:focus { outline: none; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.result-place { margin: 0; color: var(--muted); font-size: .98rem; }
.again { font-family: var(--font-sub); display: inline-flex; align-items: center; gap: .4rem; flex: none; font: inherit; font-size: .95rem; font-weight: 600; color: var(--indigo-dark); background: var(--white); border: 0; border-radius: 999px; padding: .5rem 1rem; cursor: pointer; }
.again:hover { background: var(--line); }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.result h2 { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(1.7rem, 4.2vw, 2.3rem); line-height: 1.15; color: var(--indigo); }
.result-logo { width: 120px; height: 76px; object-fit: contain; flex: none; mix-blend-mode: multiply; }
.result h2 a { color: inherit; text-decoration: none; }
.result h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.result-logo-link { flex: none; display: block; border-radius: 12px; }
.result-logo-link:hover { box-shadow: 0 0 0 2px var(--sky); }

.contacts { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .75rem; }
.contact { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-radius: 16px; background: var(--white); color: var(--indigo); text-decoration: none; }
a.contact:hover { background: #f6f8fc; box-shadow: inset 0 0 0 2px var(--sky); }
.contact .ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--mist); color: var(--indigo); flex: none; }
.contact small { display: block; color: var(--muted); font-size: .88rem; line-height: 1.3; }
.contact strong { font-family: var(--font-sub); font-size: 1.1rem; overflow-wrap: anywhere; }
.contact.note { background: var(--peach); align-items: flex-start; box-shadow: inset 4px 0 0 var(--coral); }
.contact.note .ico { color: var(--coral-ink); }
.contact.note .consigne { white-space: pre-line; }
.contact .aide { margin-top: .35rem; font-size: .95rem; line-height: 1.45; }
.contacts:last-child { margin-bottom: 0; }
.missing { color: var(--muted); font-style: italic; margin: 0 0 1.5rem; }
.cta { display: inline-flex; align-items: center; justify-content: center; padding: 1rem 1.9rem; background: var(--coral); color: var(--ink-deep); font-family: var(--font-sub); font-weight: 700; font-size: 1.05rem; text-decoration: none; border-radius: 999px; transition: background .15s; }
.cta:hover { background: #e39c85; }

/* Pied de page */
.foot { padding: 3.5rem 0 4rem; }
.foot h2 { margin: 0 0 1.25rem; font-family: var(--font-sub); font-size: 1.1rem; font-weight: 600; }
.inst-title { margin-top: 3rem !important; }
.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .85rem; }
.logos li { display: flex; align-items: center; justify-content: center; height: 100px; padding: .7rem; border-radius: 18px; background: var(--mist); }
.logos img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.logos .maker { grid-column: span 2; gap: 1rem; justify-content: flex-start; padding-inline: 1.2rem; background: var(--peach); }
.logos .maker img { max-width: 80px; flex: none; }
.logos .maker span { font-family: var(--font-sub); font-weight: 600; line-height: 1.3; color: var(--indigo); }
.logos-inst { grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); }
/* Logo lié au site web de la CPTS */
.logos a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 12px; }
.logos .maker a { justify-content: flex-start; gap: 1rem; text-decoration: none; }
/* Le lien remplit toute la carte (marges comprises) : un seul bloc cliquable */
.logos li:has(> a), .logos .maker:has(> a) { padding: 0; }
.logos li > a { padding: .7rem; border-radius: inherit; }
.logos .maker > a { padding-inline: 1.2rem; }
.logos li { transition: box-shadow .15s; }
.logos li:has(a:hover) { box-shadow: inset 0 0 0 2px var(--sky); }

/* Menu de l'en-tête */
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.top-nav a { display: inline-block; padding: .45rem 1.1rem; border-radius: 999px; background: rgba(255, 255, 255, .14); color: var(--white); font-family: var(--font-sub); font-weight: 600; font-size: .95rem; text-decoration: none; transition: background .15s; }
.top-nav a:hover { background: rgba(255, 255, 255, .26); }
.top-nav a[aria-current="page"] { background: var(--coral); color: var(--ink-deep); }

/* Bas de page : copyright et crédit (toutes les pages) */
.foot-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 2rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.foot-bar p { margin: 0; }
.foot-bar a { color: var(--muted); text-underline-offset: 3px; }
.foot-bar a:hover { color: var(--indigo); }
.foot-bar .credit strong { font-family: var(--font-sub); font-weight: 700; color: var(--indigo); letter-spacing: .01em; }
.page + .foot { padding-top: 0; }
.page + .foot .foot-bar { margin-top: 0; }

/* Pages de contenu (FAQ, mentions légales) */
.page { padding: 1.5rem 0 3.5rem; }
.page h1 { max-width: none; font-size: clamp(2rem, 5vw, 3rem); }
.page h2 { margin: 2.25rem 0 .6rem; font-family: var(--font-sub); font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.page p, .page ul { max-width: 68ch; }
.page li { margin-bottom: .35rem; }
.page a { color: var(--indigo-dark); text-underline-offset: 3px; }
.page .lead { margin-bottom: 2rem; }
.back { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-sub); font-weight: 600; font-size: .95rem; text-decoration: none; }
.page .back { color: var(--indigo); }
.back:hover { text-decoration: underline; }
.faq details { max-width: 760px; margin: 0 0 .75rem; border-radius: 16px; background: var(--mist); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; font-family: var(--font-sub); font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--coral-ink); }
.faq details[open] summary::after { content: "\2212"; }
.faq .rep { padding: 0 1.25rem 1.1rem; }
.faq .rep > :first-child { margin-top: 0; }
.faq .rep > :last-child { margin-bottom: 0; }
.encart { max-width: 760px; margin: 2.5rem 0 0; padding: 1.1rem 1.25rem; border-radius: 16px; background: var(--peach); box-shadow: inset 4px 0 0 var(--coral); }
.encart p { margin: 0; }
.a-completer { background: #fff1b8; padding: 0 .25rem; border-radius: 4px; }

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .brand small { flex-basis: 100%; padding-left: 2.45rem; }
  .top-in { align-items: flex-start; }
  .top-nav { padding-top: .85rem; }
  .foot-bar { flex-direction: column; align-items: flex-start; }
  .wrap { width: calc(100% - 2rem); }
  .hero { padding-bottom: 2.5rem; }
    h1 { margin-top: 1rem; }
  .lead { font-size: 1.05rem; margin-bottom: 1rem; }
  .avertissement { margin-bottom: 1.75rem; font-size: .95rem; }
  .search label { margin-left: .25rem; }

  /* Champ : le bouton devient une loupe ronde pour laisser la place à la saisie */
  .field { padding: .3rem .3rem .3rem 1rem; gap: .25rem; }
  .search-ico { display: none; }
  .combo input { padding: .65rem 0; font-size: 1.05rem; }
  .field button { width: 3rem; height: 3rem; padding: 0; display: grid; place-items: center; flex: none; }
  .btn-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .btn-ico { display: block; }
  .suggestions { top: calc(100% + 6px); padding: .35rem; }
  .suggestions li { padding: .8rem .75rem; }

  .step-rue { margin-top: 1.5rem; padding: 1.5rem 0 0; border-left: 0; border-top: 3px solid var(--coral); }

  /* Résultat : pleine largeur, éléments empilés */
  .result { padding: 1.1rem; margin-top: 1.5rem; border-radius: 20px; }
  .result-bar { flex-direction: column-reverse; align-items: center; text-align: center; gap: .75rem; margin-bottom: 1.25rem; }
  .result-place { font-size: 1rem; color: var(--indigo); font-weight: 600; }
  .result-head { flex-direction: column-reverse; align-items: center; text-align: center; gap: .75rem; margin-bottom: 1.5rem; }
  .result-logo { width: 140px; height: 84px; }
  .contact { padding: .8rem; gap: .75rem; }
  .contact .ico { width: 2.3rem; height: 2.3rem; }
  .cta { display: flex; width: 100%; text-align: center; padding: 1rem; }

  .foot { padding: 2.5rem 0 3rem; }
  .logos { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .logos .maker { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) {
  .result:not([hidden]) { animation: reveal .3s ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
}
