@import url("/static/css/doc-common.css");
/* Epipay · charte L'Épicurieuse : blanc, noir, Montserrat, une touche de lilas. Sobre. */
@font-face { font-family: "Montserrat"; src: url("/static/fonts/Montserrat.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FFFFFF; --ink: #0B0B0C; --muted: #6B6573; --line: #ECE8F0; --soft: #F8F6FA;
  --lilas: #F0CFF8; --lilas-fort: #8E4FA8; --menthe: #D9F7EA; --creme: #FAF1D9; --rouge: #B3261E; --rouge-bg: #FCEBEA;
  --f: "Montserrat", "Helvetica Neue", Arial, system-ui, sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.6 var(--f); font-feature-settings: "tnum" 1; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
h2 small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: .85rem; margin-left: 6px; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
ul { margin: 6px 0 0; padding-left: 20px; }
:focus-visible { outline: 2px solid var(--lilas-fort); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .bad { color: var(--rouge); } .mt { margin-top: 14px; }

.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
main.wrap { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 20px; }
main.narrow { max-width: 620px; }

/* En-tête */
.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.badge { width: 38px; height: 38px; }
.badge .b1 { fill: var(--lilas); } .badge .b2 { fill: var(--ink); }
.brand b { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.brand small { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 20px; }
.nav a { text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.logout { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .8rem; color: var(--muted); }
.who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.foot { padding-block: 24px 40px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }

/* Mise en page */
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
.lede { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.crumb { font-size: .85rem; } .crumb a { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.grid-doc { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 920px) { .grid2, .grid-doc { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.end, .row-end { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 10px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1 1 180px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; background: var(--bg); min-width: 0; }
.card.center { text-align: center; align-items: center; }
.card.link { text-decoration: none; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s; }
.card.link:hover { border-color: var(--ink); }
.row-card { flex-direction: row !important; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
form.inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
form.block { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* Formulaires */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
label.f { display: block; font-size: .78rem; font-weight: 600; color: var(--ink); min-width: 0; }
label.f small { font-weight: 500; color: var(--muted); margin-left: 4px; }
label.f > input, label.f > select, label.f > textarea { display: block; margin-top: 6px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; font: 500 .92rem var(--f); color: var(--ink); padding: 10px 12px; border: 1px solid #DCD6E2; border-radius: 10px; background: #fff; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input.err, canvas.err { border-color: var(--rouge) !important; background: var(--rouge-bg); }
.w-s { width: 90px !important; } .w-m { width: 180px !important; } .w-l { width: min(320px, 100%) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 4px; }
canvas.pad { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 1px dashed #CFC7D8; border-radius: 12px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.sig-preview { max-height: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font: 700 .78rem var(--f); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2A272E; }
.btn.small { padding: 7px 14px; font-size: .7rem; }
.btn.ghost { border-color: var(--line); }
.btn.danger { border-color: var(--rouge); color: var(--rouge); }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 14px; font: 700 .72rem var(--f); letter-spacing: .04em; cursor: pointer; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* États */
.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--ink); }
.p-brouillon { color: var(--muted); }
.p-envoyee { background: var(--lilas); }
.p-validee, .p-devis_signe { background: var(--creme); }
.p-contrat_signe, .p-declaree { background: var(--menthe); }
.p-payee, .p-cloturee { background: var(--ink); color: #fff; }
.p-refusee { background: var(--rouge-bg); color: var(--rouge); }
.steps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.steps i { height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--ink); }
.note { padding: 12px 16px; border-radius: 12px; background: var(--soft); font-size: .9rem; }
.note.warn { background: var(--creme); } .note.ok { background: var(--menthe); } .note.lil { background: var(--lilas); }
.note.bad { background: var(--rouge-bg); color: var(--rouge); }
.flash { padding: 12px 18px; border-radius: 12px; background: var(--menthe); font-weight: 600; font-size: .9rem; transition: opacity .6s; }
.flash.err { background: var(--rouge-bg); color: var(--rouge); }
.flash.fade { opacity: 0; }
.empty { border: 1px dashed #DCD6E2; border-radius: var(--r); padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { margin: 0; } .empty p { color: var(--muted); max-width: 48ch; }
.year { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .9rem; color: var(--muted); }
.year b { color: var(--ink); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--lilas); font-size: .72rem; margin-left: 6px; letter-spacing: 0; }

/* Tableaux et listes */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.card table.t th, .card table.t td { padding-left: 0; }
table.t .n { text-align: right; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.journal { list-style: none; padding: 0; margin: 8px 0 0; font-size: .82rem; display: flex; flex-direction: column; gap: 4px; }
.journal span { color: var(--muted); margin-right: 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { text-decoration: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.tabs a b { margin-left: 6px; color: var(--muted); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs a[aria-current="page"] b { color: #fff; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Étapes d'un dossier */
.flow { display: flex; flex-direction: column; padding-block: 8px; }
.fstep { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fstep:last-child { border-bottom: 0; }
.fstep h3 { font-size: .92rem; margin-bottom: 6px; }
.fstep .row, .fstep form { margin-top: 8px; }
.fnum { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--soft); color: var(--muted); }
.fstep.done .fnum { background: var(--menthe); color: var(--ink); }
.fstep.now .fnum { background: var(--ink); color: #fff; }
.dimona { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 8px; font-size: .88rem; }
.dimona details { flex-basis: 100%; }
pre.json { font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--soft); padding: 12px; border-radius: 10px; overflow: auto; max-height: 300px; }
details summary { cursor: pointer; color: var(--muted); margin-top: 8px; }

/* Formulaire de demande */
.regime { margin-bottom: 10px; font-size: .9rem; }
.ligne { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ligne.bad { border-color: var(--rouge); }
.ligne .label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.min-msg { font-size: .82rem; color: var(--muted); }
.min-msg.bad { color: var(--rouge); background: var(--rouge-bg); padding: 10px 12px; border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--lilas); font-size: .82rem; font-weight: 600; }
.chip button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; }
.chip button:hover { background: #fff; }
.frais-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(130px, 1.4fr) 90px 110px 96px 28px; gap: 10px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.frais-row .tot { font-weight: 700; text-align: right; padding-bottom: 10px; white-space: nowrap; }
.frais-row .x { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; padding-bottom: 6px; }
.frais-help { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.frais-help.bad { color: var(--rouge); font-weight: 600; }
@media (max-width: 760px) { .frais-row { grid-template-columns: 1fr 1fr; } .frais-row .tot { text-align: left; } }

/* Ticket de calcul */
.ticket { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.ticket-head { background: var(--lilas); padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.ticket-head b { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.ticket-head span { font-size: .75rem; }
.ticket-body { padding: 10px 20px 14px; font-size: .88rem; }
.tl { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl span:last-child { white-space: nowrap; }
.tl.op { color: var(--muted); font-size: .82rem; }
.tl.big { font-weight: 700; font-size: 1rem; }
.tl.alert { color: var(--rouge); font-weight: 700; }
.ticket-foot { padding: 12px 20px; font-size: .75rem; color: var(--muted); background: var(--soft); }

/* Connexion */
.login { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; min-height: 60vh; }
.login-art { position: relative; aspect-ratio: 1; max-width: 420px; width: 100%; justify-self: center; overflow: hidden; }
.login-art::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 56px solid var(--lilas); }
.login-art::after { content: ""; position: absolute; width: 22%; height: 22%; left: 39%; top: 39%; background: var(--ink); transform: rotate(45deg); }
.login-card { display: flex; flex-direction: column; gap: 18px; max-width: 440px; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; min-height: 0; } .login-art { max-width: 200px; } }

/* Document dans la page client */
.doc-frame { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; background: var(--soft); padding: 16px; }
.doc-frame .doc { background: #fff; padding: 36px; min-width: 640px; font-size: 13px; }
.mail-frame { width: 100%; min-height: 560px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
form.block > .btn { align-self: flex-start; }
/* Adhésion */
.adhesion.warn { border-color: var(--lilas-fort); }
.seg-choice { display: inline-flex; gap: 6px; }
.seg-choice label { cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: inline-block; padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: .85rem; }
.seg-choice input:checked + span { background: var(--ink); color: #fff; }
.seg-choice input:focus-visible + span { outline: 2px solid var(--lilas-fort); outline-offset: 2px; }
/* Aide */
.faq { border-bottom: 1px solid var(--line); }
.faq:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 500; font-size: 1.2rem; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq-body { padding: 0 0 14px; max-width: 70ch; display: flex; flex-direction: column; gap: 8px; }
.faq-body ol, .faq-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.formula-line { background: var(--lilas); border-radius: 10px; padding: 10px 14px; font-weight: 700; }
#artistes, #argent, #droits, #clients, #equipe { scroll-margin-top: 16px; }
form.row select, form.row input[type=number] { width: auto; }

/* Récap comptable */
.t th.sec { background: var(--soft); text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; padding-top: 14px; }
.t.recap td:nth-child(2) { white-space: nowrap; }
@media print {
  .top, .foot, .no-print, .nav, .flash { display: none !important; }
  main.wrap { padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
}
