/* Page d'accueil publique. Encre de chancellerie, papier froid, or de sceau. */
:root {
  --ink: #13294b;
  --ink-soft: #3c4d66;
  --paper: #f2f5f9;
  --slate: #2e5b8a;
  --gold: #f47b20;       /* orange du logo OrganiPro */
  --gold-deep: #d9620c;
  --orange: #f47b20;
  --white: #fff;
  --rule: #d5dde8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 34rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.12; max-width: 22ch; }
h3 { font-size: 1.28rem; line-height: 1.25; }
p { margin: 0; }

/* ---------------------------------------------------------------- en-tête */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1.25rem, 5vw, 4rem); }
.mark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.mark img { width: 40px; height: 34px; }
.mark .pro { color: var(--orange); }
.top nav { display: flex; align-items: center; gap: clamp(.8rem, 2.4vw, 2rem); font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--ink-soft); }
.top nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.top nav .login { white-space: nowrap; color: var(--ink); font-weight: 600; border: 1.5px solid var(--ink); padding: .4rem .95rem; border-radius: 6px; }
.top nav .login:hover { background: var(--ink); color: var(--white); text-decoration: none; }

/* ---------------------------------------------------------------- boutons */
.btn { white-space: nowrap; display: inline-block; text-decoration: none; font-weight: 600; padding: .85rem 1.4rem; border-radius: 6px; font-size: 1rem; border: 1.5px solid transparent; }
.btn.primary { background: var(--ink); color: var(--white); }
.btn.primary:hover { background: var(--slate); }
.btn.ghost { border-color: var(--rule); color: var(--ink); background: var(--white); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.primary.on-dark { background: var(--gold); color: var(--ink); }
.btn.primary.on-dark:hover { background: #ff9445; }
.btn.ghost.on-dark { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .4); }
.btn.ghost.on-dark:hover { border-color: var(--white); }
.ctas { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------------------------------------------------------------- héros */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 4vw, 4.5rem); align-items: center;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); max-width: 1320px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.1rem, 3.6vw, 3.2rem); line-height: 1.08; max-width: 21ch; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: var(--measure); margin: 1.5rem 0 2rem; }
.fine { margin-top: 1.4rem; font-size: .92rem; color: var(--ink-soft); }
.hero-chart { margin: 0; }
.hero-chart svg { width: 100%; height: auto; overflow: visible; }
.hero-chart figcaption { margin-top: 1rem; font-size: .88rem; color: var(--ink-soft); max-width: 40ch; padding-left: 1.2rem; border-left: 2px dashed var(--gold); }
.lines path { stroke: var(--gold-deep); stroke-linejoin: round; }
.lines .transversal { stroke: var(--slate); stroke-dasharray: 5 5; }
.nodes rect { stroke-width: 1.5; }
.n0 { fill: var(--ink); }
.n1 { fill: var(--slate); }
.n2 { fill: var(--white); stroke: var(--slate); }
.n3 { fill: var(--white); stroke: var(--rule); }
.nodes text { text-anchor: middle; font-family: var(--sans); fill: var(--ink); }
.nodes .inv { fill: var(--white); }
.t1 { font-size: 12.5px; font-weight: 700; }
.t2 { font-size: 11.5px; }
.t3 { font-size: 10.5px; font-style: italic; opacity: .85; }
.n2 + .t1, .n3 + .t1 { font-size: 11.5px; }

/* L'organigramme se trace une fois, du sommet vers la base. */
@media (prefers-reduced-motion: no-preference) {
  .lines path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw .9s cubic-bezier(.6, 0, .2, 1) forwards; animation-delay: calc(var(--d) + .25s); }
  .lines .transversal { stroke-dasharray: 5 5; stroke-dashoffset: 0; opacity: 0; animation: appear .6s ease forwards; animation-delay: calc(var(--d) + .25s); }
  .nodes > g { opacity: 0; transform: translateY(6px); animation: appear .5s ease forwards; animation-delay: var(--d); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- vitrine */
.frame { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 var(--rule), 0 30px 60px -30px rgba(19, 41, 75, .45); border: 1px solid var(--rule); }
.frame-bar { display: flex; align-items: center; gap: 6px; padding: .55rem .8rem; background: #e7ecf3; border-bottom: 1px solid var(--rule); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: #c3ccd8; }
.frame-bar span { margin-left: .8rem; font-size: .78rem; color: var(--ink-soft); }
.showcase { background: var(--ink); color: var(--white); padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem); }
.showcase .frame { max-width: 1180px; margin: 0 auto; border-color: rgba(255, 255, 255, .15); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.callouts { list-style: none; padding: 0; margin: 2.5rem auto 0; max-width: 1180px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.callouts li { color: #c9d3e1; font-size: .98rem; padding-top: 1rem; border-top: 2px solid var(--gold); }
.callouts strong { display: block; color: var(--white); font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-bottom: .35rem; }

/* ---------------------------------------------------------------- étapes */
.steps, .gallery, .facts { max-width: 1180px; margin: 0 auto; padding: clamp(3.5rem, 7vw, 6rem) clamp(1.25rem, 5vw, 2rem); }
.steps ol { list-style: none; counter-reset: step; padding: 0; margin: 2.75rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
.steps li { counter-increment: step; position: relative; padding-top: 3.4rem; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 4px; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; background: var(--white); }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 1.2rem; left: 3.2rem; right: -1.5rem; border-top: 1.5px solid var(--gold); }
.steps p { margin-top: .6rem; color: var(--ink-soft); max-width: 32ch; }

/* ---------------------------------------------------------------- galerie */
.gallery { padding-top: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 2rem 0 1.4rem; border-bottom: 1px solid var(--rule); }
.tabs button { font: 600 .98rem var(--sans); color: var(--ink-soft); background: none; border: 0; padding: .75rem 1rem; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--gold); }
.panel > p { max-width: 60ch; color: var(--ink-soft); margin-bottom: 1.4rem; }

/* ---------------------------------------------------------------- document */
.document { background: var(--white); border-block: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem);
  align-items: center; padding: clamp(3.5rem, 7vw, 6rem) max(clamp(1.25rem, 5vw, 4rem), calc((100% - 1180px) / 2)); }
.doc-text > p { margin: 1.2rem 0 2rem; color: var(--ink-soft); max-width: var(--measure); }
.formats { margin: 0; display: grid; gap: 0; }
.formats > div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--rule); }
.formats dt { font-weight: 700; }
.formats dd { margin: 0; color: var(--ink-soft); }
.doc-visual { position: relative; }
.papers { position: absolute; left: 0; bottom: -2rem; width: 30%; max-width: 190px; overflow: visible; }
.papers rect { fill: none; stroke: var(--gold-deep); stroke-width: 3; }
.papers .a4 { fill: var(--gold); fill-opacity: .25; }
.papers text { font: 700 44px var(--serif); fill: var(--gold-deep); }
.sheet { margin-left: 18%; width: 82%; border: 1px solid var(--rule); box-shadow: 0 24px 50px -24px rgba(19, 41, 75, .4); transform: rotate(-1.2deg); background: var(--white); }

/* ---------------------------------------------------------------- faits */
.fact-grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem clamp(2rem, 5vw, 5rem); }
.fact-grid > div { padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.fact-grid p { margin-top: .5rem; color: var(--ink-soft); max-width: 46ch; }
.models { font-family: var(--serif); font-size: 1.08rem; line-height: 1.7; color: var(--ink) !important; }

/* ---------------------------------------------------------------- fin */
.closing { background: var(--ink); color: var(--white); text-align: left; padding: clamp(3.5rem, 7vw, 6rem) max(clamp(1.25rem, 5vw, 4rem), calc((100% - 1180px) / 2)); }
.closing h2 { max-width: none; }
.closing > p { color: #c9d3e1; margin: .7rem 0 2rem; font-size: 1.15rem; }
.foot { display: flex; justify-content: space-between; padding: 1.4rem clamp(1.25rem, 5vw, 4rem); font-size: .9rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- petits écrans */
@media (max-width: 900px) {
  .hero, .document { grid-template-columns: 1fr; }
  .callouts, .steps ol { grid-template-columns: 1fr; }
  .steps li:not(:last-child)::after { display: none; }
  .fact-grid { grid-template-columns: 1fr; }
  .papers { width: 22%; bottom: -1rem; }
}
@media (max-width: 600px) {
  .top nav a:not(.login) { display: none; }
  body { font-size: 16px; }
  .formats > div { grid-template-columns: 1fr; gap: .1rem; }
}

/* ---------------------------------------------------------------- pied de page enrichi */
.foot { display: grid; grid-template-columns: 1.4fr 1.4fr .7fr; gap: 2rem; border-top: 1px solid var(--rule); padding: 2.5rem clamp(1.25rem, 5vw, 4rem); background: var(--white); }
.foot p { margin: 0 0 .4rem; max-width: 40ch; }
.foot-brand { font-weight: 700; color: var(--ink); }
.foot-brand span { color: var(--orange); }
.foot-title { font-weight: 700; color: var(--ink); }
.foot ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.foot nav[aria-label="Compte"] ul { columns: 1; }
.foot li { margin-bottom: .3rem; break-inside: avoid; }
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------- FAQ */
.faq { max-width: 860px; margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 5vw, 2rem); }
.faq-list { margin-top: 2rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2rem 1.1rem 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .2rem; top: .9rem; font-size: 1.5rem; color: var(--orange); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq summary h3 { font-size: 1.15rem; display: inline; }
.faq details p { margin: 0 0 1.2rem; color: var(--ink-soft); max-width: 65ch; }
ul.models { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
ul.models a { display: inline-block; font-size: .9rem; text-decoration: none; padding: .25rem .65rem; border: 1px solid var(--rule); border-radius: 99px; background: var(--white); color: var(--ink); }
ul.models a:hover { border-color: var(--orange); }

/* ---------------------------------------------------------------- pages de modèles */
.crumbs { max-width: 1180px; margin: 0 auto; padding: .5rem clamp(1.25rem, 5vw, 2rem) 0; font-size: .88rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.tpl-head, .tpl-chart, .tpl-tips, .tpl-others, .tpl-grid { max-width: 1180px; margin: 0 auto; padding: 2rem clamp(1.25rem, 5vw, 2rem); }
.tpl-head h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.1; max-width: 24ch; }
.tpl-head .lede { max-width: 62ch; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; padding-bottom: 4rem; }
.tpl-card { background: var(--white); border: 1px solid var(--rule); border-radius: 10px; padding: 1.3rem 1.4rem; }
.tpl-card:hover { border-color: var(--orange); }
.tpl-card h2 { font-size: 1.25rem; max-width: none; }
.tpl-card h2 a { text-decoration: none; }
.tpl-card h2 a::after { content: ""; position: absolute; inset: 0; }
.tpl-card { position: relative; }
.tpl-card p { color: var(--ink-soft); margin-top: .5rem; font-size: .95rem; }
.tpl-card .meta { font-size: .85rem; color: var(--slate); }
.tpl-chart h2, .tpl-tips h2, .tpl-others h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); max-width: none; }
.hint { color: var(--ink-soft); font-size: .9rem; margin: .4rem 0 1rem; }
.tpl-tips ul, .tpl-tips ol { max-width: 70ch; color: var(--ink-soft); padding-left: 1.2rem; margin: 1rem 0 2rem; }
.tpl-tips li { margin-bottom: .5rem; }
.tpl-others ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.tpl-others a { display: inline-block; padding: .4rem .8rem; border: 1px solid var(--rule); border-radius: 99px; background: var(--white); text-decoration: none; font-size: .92rem; }
.tpl-others a:hover { border-color: var(--orange); }

/* Organigramme en listes imbriquées : traits dessinés en CSS, texte réel indexable. */
.orgtree { overflow-x: auto; padding: 1.5rem .5rem 2rem; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; }
.orgtree ul { display: flex; justify-content: center; padding: 1.4rem 0 0; margin: 0; position: relative; list-style: none; }
.orgtree > ul { padding-top: 0; width: max-content; min-width: 100%; }
.orgtree li { position: relative; padding: 1.4rem .35rem 0; text-align: center; }
.orgtree > ul > li { padding-top: 0; }
.orgtree li::before, .orgtree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 1.4rem; border-top: 1.5px solid var(--orange); }
.orgtree li::after { right: auto; left: 50%; border-left: 1.5px solid var(--orange); }
.orgtree li:only-child::before, .orgtree li:only-child::after { border-top: 0; }
.orgtree li:first-child::before, .orgtree li:last-child::after { border-top: 0; }
.orgtree li:last-child::before { border-right: 1.5px solid var(--orange); border-top: 1.5px solid var(--orange); border-radius: 0 4px 0 0; }
.orgtree li:first-child::after { border-radius: 4px 0 0 0; }
.orgtree > ul > li::before, .orgtree > ul > li::after { display: none; }
.orgtree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 1.4rem; border-left: 1.5px solid var(--orange); }
.tn { display: inline-block; min-width: 7.5rem; max-width: 11rem; padding: .5rem .6rem; border-radius: 6px; font-size: .78rem; line-height: 1.25; border: 1.5px solid var(--slate); background: var(--white); }
.tn b { display: block; font-weight: 700; }
.tn small { font-size: .72rem; }
.tn em { display: block; font-size: .7rem; color: var(--ink-soft); margin-top: .15rem; }
.tn.d0 { background: var(--ink); color: var(--white); border-color: var(--ink); }
.tn.d1 { background: var(--slate); color: var(--white); border-color: var(--slate); }
.tn.d0 em, .tn.d1 em { color: #c9d3e1; }
@media (max-width: 900px) { .foot { grid-template-columns: 1fr; } }

/* Un seul subordonné : uniquement le trait vertical (la règle :last-child ci-dessus ne doit pas ajouter de trait horizontal). */
.orgtree li:only-child::before { border: 0; }
.orgtree li:only-child { padding-left: 0; padding-right: 0; }

.foot-credit { grid-column: 1 / -1; margin: .5rem 0 0 !important; max-width: none !important; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: .85rem; }
.foot .foot-credit a { color: var(--ink); font-weight: 700; letter-spacing: .02em; }
.foot .foot-credit a:hover { color: var(--orange); }
