/* Espace client : page publique, lue surtout sur téléphone. Mêmes couleurs que l'application (bleu nuit, ambre). */
:root {
  --navy: #002237; --amber: #ffb81c; --ink: #13202b; --ink-2: #4a5a68; --muted: #6b7a87;
  --bg: #f5f7f9; --card: #fff; --line: #e1e6eb; --good: #1f7a4d; --good-bg: #e6f4ec; --warn-bg: #fff6e0; --warn: #8a5a00;
  --r: 8px; --r-lg: 12px; --shadow: 0 1px 2px rgba(0, 34, 55, .05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: #1b6fa8; }
button, input { font: inherit; }

.top { background: var(--navy); color: #fff; }
.top-in { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.top img { height: 28px; }
.top-label { font-size: 13px; opacity: .8; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .3); }
.top-out { margin-left: auto; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--r); padding: 5px 12px; cursor: pointer; font-size: 13px; }
.top-out:hover { background: rgba(255, 255, 255, .1); }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 32px; }
.loading { color: var(--muted); }
.foot { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 12px; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

/* Connexion */
.login { max-width: 420px; margin: 24px auto 0; }
.login label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.login input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 16px; }
.login input:focus { outline: none; border-color: #1b6fa8; box-shadow: 0 0 0 3px rgba(27, 111, 168, .2); }
.login .code { letter-spacing: .4em; text-align: center; font-size: 22px; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #0a3350; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.block { width: 100%; margin-top: 14px; }
.link { background: none; border: 0; padding: 0; color: #1b6fa8; cursor: pointer; text-decoration: underline; font-size: 14px; }
.error { color: #b42318; font-size: 14px; margin: 10px 0 0; }
.note { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; }

/* Dossier */
.dos-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 4px; }
.dos-head h2 { margin: 0; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: #e8f1f8; color: #1b5a86; white-space: nowrap; }
.tag.good { background: var(--good-bg); color: var(--good); }
.meta { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.bar { height: 6px; background: #edf1f4; border-radius: 99px; overflow: hidden; margin: 0 0 18px; }
.bar span { display: block; height: 100%; background: var(--amber); border-radius: 99px; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 0 0 16px 32px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: -2px; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps li.done::before { background: var(--good); }
.dot { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; }
.done .dot { background: var(--good); border-color: var(--good); }
.done .dot::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.current .dot { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255, 184, 28, .25); }
.current .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.step-name { font-weight: 500; }
.todo .step-name { color: var(--muted); font-weight: 400; }
.current .step-name { font-weight: 700; }
.step-date { color: var(--muted); font-size: 13px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--r); padding: 10px 12px; font-size: 14px; margin: 0 0 16px; }
.next { background: #f1f6fa; border-radius: var(--r); padding: 10px 12px; font-size: 14px; margin: 0 0 16px; color: var(--ink-2); }

.section-title { font-size: 14px; font-weight: 650; margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.files { list-style: none; margin: 0 0 12px; padding: 0; }
.files li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f3f5; }
.files li:last-child { border-bottom: 0; }
.files a { word-break: break-word; }
.upload { position: relative; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Paiements */
.pay-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pay-total strong { font-size: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px 9px 0; border-bottom: 1px solid #f0f3f5; vertical-align: top; }
td.num, th.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ok { color: var(--good); font-weight: 600; }

.contact p { margin: 4px 0; }

@media (max-width: 560px) {
  h1 { font-size: 20px; }
  .card { padding: 16px; }
  .hide-sm { display: none; }
  .top-label { display: none; }
}

/* Paiement en ligne */
.pay-online { margin-top: 6px; }
.small-btn { height: 34px; padding: 0 12px; font-size: 13px; }
.pay-form { margin-top: 16px; padding: 16px; background: #f7f9fb; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pay-form h3 { font-size: 15px; margin: 0 0 12px; }
.pay-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.pay-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 18px; background: #fff; font-variant-numeric: tabular-nums; }
.pay-form input:focus { outline: none; border-color: #1b6fa8; box-shadow: 0 0 0 3px rgba(27, 111, 168, .2); }
.pay-form .muted { margin: 8px 0 12px; }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-actions .primary { flex: 1 1 200px; }
.files li > a.small { white-space: nowrap; }
.pay-note { margin: 12px 0 0; }
.banner { border-radius: var(--r); padding: 12px 14px; margin: 0 0 16px; font-size: 14px; }
.banner.good { background: var(--good-bg); color: var(--good); }
.banner.bad { background: #fdecea; color: #b42318; }
.banner.info { background: #e8f1f8; color: #1b5a86; }
.pay-sum { margin: 0 0 14px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.pay-sum:empty { display: none; }
.pay-sum div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.pay-sum dt { color: var(--ink-2); }
.pay-sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.pay-sum .pay-total-line { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; font-weight: 700; }
.pay-sum .pay-total-line dt { color: var(--ink); }

/* ---------- Thème « Terre & Encre » (comme l'application de l'équipe) ---------- */
@font-face { font-family: "Geist UI"; src: url(/vendor/geist/Geist-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist UI"; src: url(/vendor/geist/Geist-Regular.ttf) format("truetype"); font-weight: 300 500; font-display: swap; }
:root {
  --navy: #002237; --amber: #ffb81c; --ink: #0b1b2b; --ink-2: #4a5868; --muted: #8a94a0;
  --bg: #f6f2ea; --card: #fcfaf6; --line: #e3dbcc; --sand: #ece5d8; --good: #2f7a55; --good-bg: #dcefe3; --warn-bg: #fff0c7; --warn: #8a5a00;
  --r: 12px; --r-lg: 18px; --shadow: 0 1px 2px rgba(11, 27, 43, .04);
  --f-title: "Geist UI", system-ui, sans-serif;
}
body { font-family: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); }
h1, h2, h3, .pay-total strong { font-family: var(--f-title); letter-spacing: -.02em; }
a { color: #1d6e8c; }
.top { background: rgba(246, 242, 234, .9); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.top-in, main, .foot { max-width: 1140px; }
.top-in { padding: 14px 24px; }
.top img { width: 28px; height: 28px; object-fit: cover; object-position: left; }
.top-word { font: 600 19px var(--f-title); letter-spacing: -.03em; }
.top-label { border-left-color: var(--line); color: var(--ink-2); opacity: 1; }
.top-out { color: var(--ink); border-color: var(--line); border-radius: 999px; background: var(--card); padding: 7px 16px; }
.top-out:hover { background: #fff; }
main { padding: 28px 24px 40px; }
.card { background: var(--card); border-color: var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.btn { border-radius: 999px; border-color: var(--line); background: var(--card); }
.btn.primary { background: var(--ink); border-color: var(--ink); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.ghost { background: rgba(246, 242, 234, .08); border-color: rgba(246, 242, 234, .22); color: #f6f2ea; }
.tag { background: #dceef4; color: #1d6e8c; }
.tag.warn { background: var(--warn-bg); color: #b07800; }
.bar { height: 8px; background: var(--sand); }
.bar span { background: linear-gradient(90deg, var(--amber), #ffcf5c); transform-origin: left; animation: cl-grow 1.1s cubic-bezier(.22, .8, .24, 1) both .3s; }
@keyframes cl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.login input, .pay-form input { border-radius: var(--r); background: var(--card); }
.login h1 { font-size: 34px; }

/* Bandeau d'accueil */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; margin: 0 0 18px; padding: 34px 40px; border-radius: 24px; background: var(--navy); color: #f6f2ea; }
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 184, 28, .3), transparent 62%); pointer-events: none; }
.hero-l { position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(246, 242, 234, .72); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.hero h1 { font-size: 40px; line-height: 1.05; margin: 10px 0; color: #f6f2ea; }
.hero h1 em { font-style: normal; font-weight: 300; color: var(--amber); }
.hero p { color: rgba(246, 242, 234, .72); margin: 0 0 20px; line-height: 1.6; }
.hero-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-card { position: relative; z-index: 1; background: rgba(252, 250, 246, .97); color: var(--ink); border-radius: 18px; padding: 20px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.hero-lbl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.hero-step { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.hero-step .tag { margin-left: auto; }
.hero-step.todo { color: var(--muted); }
.hero-step.current span:not(.tag) { font-weight: 600; }
.hero-dot { width: 20px; height: 20px; border-radius: 50%; flex: none; border: 2px dashed var(--line); display: grid; place-items: center; }
.hero-step.done .hero-dot { background: var(--good); border: 0; }
.hero-step.done .hero-dot::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.hero-step.current .hero-dot { border: 2px solid #fff0c7; border-top-color: var(--amber); animation: cl-spin 1s linear infinite; }
@keyframes cl-spin { to { transform: rotate(360deg); } }
.hero-card .bar { margin: 14px 0 0; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .hero h1 { font-size: 30px; }
  .top-word { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bar span, .hero-step.current .hero-dot { animation: none; } }

/* ---------- Espace client façon maquette : avatar, cartes « Mes paiements » / « Mes documents » ---------- */
.top-av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #c4532f; color: #fff; font: 600 13px var(--f-title); flex: none; }
.top-av:empty, .top-out[hidden] + .top-av { display: none; }
.top-in { gap: 14px; }
.top-out { margin-left: auto; }
.top-label { margin-left: auto; border-left: 0; padding-left: 0; }
.top-label + .top-out { margin-left: 0; }
main { max-width: 1140px; }
.cl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.cl-card { margin: 0; padding: 0; overflow: hidden; }
.cl-grid + .cl-card, .cl-card + .cl-card { margin-top: 18px; }
.cl-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 22px 12px; }
.cl-card-h h2 { margin: 0; font-size: 17px; }
.cl-empty { padding: 0 22px 20px; margin: 0; }
.cl-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 84px; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); }
.cl-pay-main b { display: block; font-weight: 600; }
.cl-pay-main small, .cl-doc-main small { display: block; color: var(--muted); font-size: 12.5px; }
.cl-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-act { text-align: right; }
.cl-due { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); }
.cl-due strong { font: 600 20px var(--f-title); letter-spacing: -.02em; }
#pay-area:not(:empty) { padding: 0 22px 18px; }
.pay-note { padding: 0 22px 16px; }
.cl-doc { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-top: 1px solid var(--line); }
.cl-doc-main { flex: 1; min-width: 0; }
.cl-doc-main a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-dl { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }
.cl-dl:hover { background: var(--bg); color: var(--ink); }
.cl-dl svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cl-upload { padding: 14px 22px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: start; }
.cl-upload p { margin: 0; }
.cl-card .dos-head, .cl-card .meta, .cl-card .steps, .cl-card > .bar, .cl-card > .notice, .cl-card > .next { margin-left: 22px; margin-right: 22px; }
.cl-card .dos-head { padding-top: 20px; }
.cl-card .steps { padding-bottom: 20px; }
.cl-contact { text-align: center; color: var(--muted); font-size: 14px; margin: 26px 0 0; }
.hero-warn { background: rgba(255, 184, 28, .14); border-radius: 12px; padding: 10px 12px; color: #ffe3a3 !important; font-size: 14px; }
/* Vignettes de type de fichier (comme dans l'application) */
.ext { position: relative; display: inline-grid; place-items: end center; flex: none; width: 40px; height: 48px; padding-bottom: 6px; border-radius: 9px; color: #fff; font-size: 9.5px; font-weight: 700; overflow: hidden; }
.ext::before { content: ""; position: absolute; top: 0; right: 0; width: 12px; height: 12px; background: rgba(255, 255, 255, .35); border-radius: 0 9px 0 4px; z-index: 1; }
.ext-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(1.4px) saturate(1.15); transform: scale(1.12); }
.ext-img b { position: relative; z-index: 1; padding: 1px 4px; border-radius: 4px; background: rgba(11, 27, 43, .55); font-size: 8.5px; }

@media (max-width: 760px) {
  main { padding: 16px 14px 32px; }
  .top-in { padding: 12px 14px; }
  .cl-grid { grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
  .hero { padding: 24px 20px; border-radius: 22px; gap: 20px; }
  .hero h1 { font-size: 30px; }
  .hero-acts .btn { flex: 1 1 auto; }
  .hero-card { padding: 16px; }
  .cl-card-h { padding: 18px 16px 10px; }
  .cl-pay { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 13px 16px; }
  .cl-amt { text-align: right; }
  .cl-state { grid-column: 1; }
  .cl-act { grid-column: 2; grid-row: 2; }
  .cl-act:empty { display: none; }
  .cl-doc { padding: 12px 16px; gap: 12px; }
  .cl-due, .cl-upload, #pay-area:not(:empty), .pay-note, .cl-empty { padding-left: 16px; padding-right: 16px; }
  .cl-card .dos-head, .cl-card .meta, .cl-card .steps, .cl-card > .bar, .cl-card > .notice, .cl-card > .next { margin-left: 16px; margin-right: 16px; }
  .top-out { padding: 6px 12px; font-size: 13px; }
}
html, body { overflow-x: clip; }
.cl-grid > .cl-card { margin-top: 0; } /* les deux cartes côte à côte commencent à la même hauteur */
@media (max-width: 560px) { .top-label + .top-out { margin-left: auto; } } /* « Espace client » masqué sur petit écran : la déconnexion et l'avatar restent à droite */
