/* Parcours de financement Galerie Mahoraise — même identité que le site (noir / or) */
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --bg: #0c0b0a; --surface: #191613; --surface-2: #221e1a; --surface-3: #2c2722;
  --line: rgba(243, 237, 228, .12); --line-2: rgba(243, 237, 228, .22);
  --text: #f3ede4; --muted: #b3a99c; --faint: #8c8378;
  --gold: #d4b27c; --gold-2: #ecd3a5; --ok: #8fd19e; --warn: #f0c070; --err: #ff7a7a;
  --paper: #fbf8f2; --ink: #1e1d1c; --ink-2: #5d5850;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px; --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font-sans); }
a { color: var(--gold-2); }
a:hover { color: #fff; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ en-tête */
.hdr { border-bottom: 1px solid var(--line); background: rgba(12, 11, 10, .92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.hdr__in { max-width: 1100px; margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.logo { font: italic 400 1.7rem/1 var(--font-display); color: var(--text); text-decoration: none; }
.logo small { display: block; font: 600 .68rem/1.4 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 4px; font-style: normal; }
.hdr__nav { display: flex; gap: 14px; align-items: center; font-size: .9rem; }
.hdr__nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.hdr__nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
.hdr__nav a:hover { color: var(--text); }

.bandeau-essai { margin: 0; padding: 8px var(--gutter); background: #6b1d1d; color: #fff; text-align: center; font-size: .88rem; }

.bandeau-vendeur { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center; padding: 8px var(--gutter); background: #1f3a2b; color: #e8f5ec; font-size: .9rem; }
.bandeau-vendeur a { color: #fff; }
.bandeau-vendeur form { margin: 0; }
.bandeau-vendeur button { font: inherit; background: #fff; color: #1f3a2b; border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 700; }

/* Étapes */
.steps { max-width: 1100px; margin: 0 auto; padding: 18px var(--gutter) 0; list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.steps li { font-size: .74rem; color: var(--faint); border-top: 3px solid var(--surface-3); padding-top: 8px; line-height: 1.3; }
.steps li b { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.steps li.is-done { color: var(--muted); border-color: var(--gold); }
.steps li.is-now { color: var(--text); border-color: var(--gold-2); }
@media (max-width: 640px) { .steps li span { display: none; } }

/* ------------------------------------------------------------ mise en page */
main { max-width: 1100px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
.narrow { max-width: 720px; }
h1 { font: 400 clamp(2rem, 5vw, 3rem)/1.05 var(--font-display); margin: .2em 0 .4em; }
h1 em { color: var(--gold-2); }
h2 { font: 400 1.7rem/1.15 var(--font-display); margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 64ch; }
.eyebrow { color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grid2 { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.card, .paper, .alert, .kv td, .table td, .timeline li, .docs li > span, pre.mail { overflow-wrap: anywhere; min-width: 0; }
.grid2 > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); }
.card + .card { margin-top: 18px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* Avertissement légal : plus grand et en gras (art. L. 312-8) */
.avert { font-weight: 800; font-size: 1.15rem; line-height: 1.35; border-left: 4px solid var(--gold); padding: 10px 14px; background: rgba(212, 178, 124, .08); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 16px 0; }
.alert { border-radius: var(--radius-sm); padding: 12px 14px; margin: 14px 0; border: 1px solid var(--line-2); background: var(--surface-2); }
.alert--warn { border-color: rgba(240, 192, 112, .5); background: rgba(240, 192, 112, .1); }
.alert--ok { border-color: rgba(143, 209, 158, .5); background: rgba(143, 209, 158, .1); }
.alert--err { border-color: rgba(255, 122, 122, .55); background: rgba(255, 122, 122, .1); }

/* ------------------------------------------------------------ formulaires */
.form { display: grid; gap: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field { display: grid; gap: 6px; }
.field > span { font-size: .86rem; font-weight: 600; color: var(--muted); }
.field > span i { font-style: normal; color: var(--faint); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=month], input[type=number], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(212, 178, 124, .2); }
.field.has-err input, .field.has-err select { border-color: var(--err); }
.err { color: var(--err); font-size: .85rem; min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; color: var(--gold-2); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); }
.check--box { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.euro { position: relative; }
.euro input { padding-right: 34px; }
.euro::after { content: "€"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 .98rem/1 var(--font-sans); border-radius: 999px; padding: 15px 24px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; min-height: 48px; }
.btn:hover { border-color: var(--gold); color: var(--text); }
.btn--primary { background: var(--gold); color: #17130e; border-color: var(--gold); }
.btn--primary:hover { background: var(--gold-2); color: #17130e; }
.btn--danger { border-color: rgba(255, 122, 122, .6); color: #ffb3b3; }
.btn--sm { padding: 9px 14px; min-height: 38px; font-size: .86rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }

/* Choix du nombre de mensualités */
.plan { text-align: center; }
.plan output { display: block; font: 400 clamp(2.2rem, 6vw, 3.2rem)/1 var(--font-display); color: var(--gold-2); margin: 8px 0 4px; }
.plan input[type=range] { width: 100%; accent-color: var(--gold); }
.plan__scale { display: flex; justify-content: space-between; color: var(--faint); font-size: .8rem; }

/* Récapitulatif panier */
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lines li span:last-child { white-space: nowrap; }
.total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.1rem; padding-top: 12px; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; vertical-align: top; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv th { color: var(--muted); font-weight: 600; width: 45%; padding-right: 12px; }

/* ------------------------------------------------------------ document affiché (feuille claire) */
.paper { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: clamp(18px, 4vw, 44px); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9); max-height: 70vh; overflow: auto; border: 1px solid #e6dfd2; }
.paper a { color: #6c5323; }
.doc { font-size: .93rem; line-height: 1.55; }
.doc__ref { margin: 0; color: #9a7b3d; font-weight: 700; font-size: .8rem; letter-spacing: .08em; }
.doc__title { font: 700 1.35rem/1.25 var(--font-sans); margin: .2em 0; color: var(--ink); }
.doc__sub { color: var(--ink-2); margin: 0 0 1em; font-size: .85rem; }
.doc__h2 { font: 700 1.02rem/1.3 var(--font-sans); color: #8a6a2e; border-bottom: 1px solid #c9b48a; padding-bottom: 4px; margin: 1.6em 0 .6em; }
.doc__h3 { font-size: .95rem; margin: 1.1em 0 .3em; color: var(--ink); }
.doc__p { margin: .5em 0; }
.doc__p--petit { font-size: .8rem; color: var(--ink-2); }
.doc__p--grand { font-size: 1.12rem; }
.doc__p--gras { font-weight: 800; }
.doc__p--italique { font-style: italic; }
.doc__kv, .doc__table { width: 100%; border-collapse: collapse; margin: .4em 0 .8em; font-size: .88rem; }
.doc__kv th, .doc__kv td, .doc__table th, .doc__table td { text-align: left; vertical-align: top; border-bottom: 1px solid #e4dccd; padding: 6px 8px 6px 0; }
.doc__kv th { width: 40%; font-weight: 700; }
.doc__table thead th { background: #f1ebe0; padding-left: 6px; }
.doc__table-wrap { overflow-x: auto; }
.doc__liste { padding-left: 1.2em; }
.doc__liste li { margin: .3em 0; }
.doc__cases { list-style: none; padding: 0; }
.doc__encadre { border-left: 4px solid #c9a35d; padding: 2px 0 2px 14px; margin: .8em 0; }
.doc__signature { margin-top: 1em; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }

/* ------------------------------------------------------------ signature */
.sign { border: 1px solid var(--gold); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); background: linear-gradient(180deg, rgba(212, 178, 124, .08), transparent); margin-top: 20px; }
.sign h2 { margin-top: 0; }
.pad { position: relative; background: #fff; border-radius: var(--radius-sm); touch-action: none; height: 180px; border: 2px dashed #c9b48a; }
.pad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.pad__hint { position: absolute; left: 12px; bottom: 8px; color: #9c917f; font-size: .8rem; pointer-events: none; }
.code-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.code-row .field { flex: 1 1 160px; }
.code-row input { letter-spacing: .3em; font-size: 1.2rem; text-align: center; }

/* ------------------------------------------------------------ pièces */
.pieces { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.piece { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.piece.is-ok { border-color: rgba(143, 209, 158, .45); }
.piece small { display: block; color: var(--muted); }
.piece label.btn { margin: 0; }
.piece input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; background: var(--surface-3); color: var(--muted); }
.badge--ok { background: rgba(143, 209, 158, .16); color: var(--ok); }
.badge--warn { background: rgba(240, 192, 112, .16); color: var(--warn); }
.badge--err { background: rgba(255, 122, 122, .16); color: var(--err); }
.badge--gold { background: rgba(212, 178, 124, .18); color: var(--gold-2); }

/* ------------------------------------------------------------ listes (espace client, gestion) */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.table tr.is-urgent td { background: rgba(255, 122, 122, .06); }
.table-wrap { overflow-x: auto; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--surface-3); }
.timeline li { padding: 4px 0 10px 16px; position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.timeline small { color: var(--faint); display: block; }
.docs { list-style: none; padding: 0; margin: 0; }
.docs li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: .86rem; }
.tabs a.is-on { background: var(--gold); color: #17130e; border-color: var(--gold); }
pre.mail { white-space: pre-wrap; font: inherit; background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; }

/* Mentions discrètes en bas de page (ex. « Renoncer au contrat ici » : visible et accessible, sans être mise en avant) */
.discret { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.lien:hover { color: var(--text); }
footer.ftr { border-top: 1px solid var(--line); color: var(--faint); font-size: .82rem; }
footer.ftr div { max-width: 1100px; margin: 0 auto; padding: 22px var(--gutter); display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer.ftr a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 999px; z-index: 50; max-width: calc(100% - 32px); }
@media print {
  .hdr, .steps, footer.ftr, .sign, .btns, .doc-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .paper { max-height: none; box-shadow: none; border: 0; }
}
