/* Final Input — tunnel de commande & espace client */
.app-hdr { background: var(--card); border-bottom: 1px solid var(--line); }
.app-hdr .wrap { display: flex; align-items: center; gap: 20px; height: 70px; }
.app-hdr img { height: 40px; width: auto; }
.app-hdr .right { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 15px; color: var(--muted); }
.app-hdr .right a { text-decoration: none; display: inline-flex; gap: 7px; align-items: center; }
.app-hdr .right a:hover { color: var(--ink); }
.secure { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; color: var(--green); font-weight: 600; }

/* Étapes */
.wiz { padding: 40px 0 90px; }
.wiz h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 8px; }
.wiz .sub { color: var(--muted); margin: 0 0 30px; }
.progress { display: flex; gap: 8px; margin-bottom: 34px; list-style: none; padding: 0; counter-reset: p; }
.progress li { flex: 1; font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 12px; border-top: 3px solid var(--line); counter-increment: p; transition: color .2s, border-color .2s; }
.progress li::before { content: counter(p) '. '; }
.progress li.on { color: var(--ink); border-color: var(--red); }
.progress li.done { color: var(--ink-2); border-color: var(--ink-2); }
.wiz-grid { display: grid; grid-template-columns: 1fr 360px; gap: 30px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 26px; margin-bottom: 6px; }
.panel > p.muted { color: var(--muted); margin: 0 0 22px; font-size: 15.5px; }
.pane { display: none; }
.pane.on { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }

/* Dépôt */
.tabs { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-weight: 600; color: var(--muted); font-size: 14.5px; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.drop { border: 2px dashed #D3CBBE; border-radius: var(--radius); padding: 44px 20px; text-align: center; background: var(--paper); transition: border-color .2s, background .2s; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-soft); }
.drop .big { width: 58px; height: 58px; border-radius: 50%; background: var(--card); color: var(--red); display: grid; place-items: center; margin: 0 auto 14px; box-shadow: var(--shadow); }
.drop .big .ic { width: 26px; height: 26px; }
.drop b { display: block; font-size: 18px; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 14.5px; }
.drop input { display: none; }
.filecard { display: flex; gap: 16px; align-items: center; border: 1.5px solid var(--ink-2); border-radius: var(--radius); padding: 18px 20px; background: var(--paper); }
.filecard .fi-ic { width: 48px; height: 48px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.filecard .fi-ic .ic { width: 22px; height: 22px; }
.filecard .nm { font-weight: 600; word-break: break-all; }
.filecard .mt { font-size: 14px; color: var(--muted); }
.filecard .rm { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 6px; }
.count-box { display: flex; align-items: center; gap: 18px; margin-top: 16px; padding: 16px 20px; background: var(--green-soft); border-radius: 12px; flex-wrap: wrap; }
.count-box.warn { background: var(--amber-soft); }
.count-box .n { font: 500 30px/1 var(--serif); color: var(--green); }
.count-box.warn .n { color: var(--amber); }
.count-box .t { font-size: 14.5px; color: var(--ink-2); flex: 1; min-width: 180px; }
.count-box input { width: 120px; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 600 16px var(--sans); }
.sample-link { background: none; border: 0; color: var(--red); font-weight: 600; padding: 0; margin-top: 14px; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.grid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.grid-fields .full { grid-column: 1 / -1; }

/* Choix */
.opts { display: grid; gap: 12px; }
.opts.cols3 { grid-template-columns: repeat(3, 1fr); }
.opt { position: relative; display: flex; gap: 14px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: pointer; transition: border-color .15s, background .15s; background: #fff; }
.opt:hover { border-color: #C9C1B4; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #C9C1B4; flex: none; margin-top: 2px; display: grid; place-items: center; transition: border-color .15s; }
.opt .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform .15s; }
.opt:has(input:checked) { border-color: var(--red); background: #FFFCFB; }
.opt:has(input:checked) .radio { border-color: var(--red); }
.opt:has(input:checked) .radio::after { transform: scale(1); }
.opt:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(184, 24, 23, .2); }
.opt .body { flex: 1; }
.opt .body b { display: block; font-size: 16.5px; }
.opt .body small { color: var(--muted); font-size: 14px; }
.opt .px { font-weight: 600; white-space: nowrap; font-size: 15px; }
.opt.vert { flex-direction: column; gap: 6px; }
.opt.vert .radio { position: absolute; top: 16px; right: 16px; }
.opt.vert .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-2); }
.opt.vert .ico .ic { width: 20px; height: 20px; }
.opt .tag { font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: .04em; }
.group-lbl { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }
.group-lbl:first-of-type { margin-top: 0; }
.incl { display: grid; gap: 10px; margin-top: 22px; padding: 18px 20px; background: var(--paper); border-radius: 12px; font-size: 15px; }
.incl div { display: flex; gap: 10px; align-items: center; }
.incl .ic { color: var(--green); }

/* Récapitulatif */
.recap { position: sticky; top: 24px; background: var(--ink); color: #E9E5DE; border-radius: var(--radius); padding: 26px; }
.recap h3 { color: #fff; font-size: 22px; margin-bottom: 16px; }
.recap dl { margin: 0; display: grid; gap: 10px; font-size: 15px; }
.recap dl div { display: flex; justify-content: space-between; gap: 14px; }
.recap dt { color: #B5AFA6; }
.recap dd { margin: 0; text-align: right; font-weight: 500; color: #fff; }
.recap hr { border: 0; border-top: 1px dashed rgba(255, 255, 255, .2); margin: 18px 0; }
.recap .total { display: flex; justify-content: space-between; align-items: baseline; }
.recap .total span { color: #B5AFA6; font-size: 15px; }
.recap .total b { font: 500 34px/1 var(--serif); color: #fff; }
.recap .due { margin-top: 16px; display: flex; gap: 10px; align-items: center; font-size: 14.5px; background: rgba(255, 255, 255, .07); border-radius: 10px; padding: 12px 14px; }
.recap .due .ic { color: #F07B78; }
.recap .min { font-size: 13px; color: #F0B65A; margin-top: 8px; }

/* Paiement */
.pay-wait { text-align: center; padding: 30px 10px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--paper-2); border-top-color: var(--red); margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success { text-align: center; padding: 20px 0 10px; }
.success .ok { width: 76px; height: 76px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 20px; }
.success .ok .ic { width: 38px; height: 38px; }
.success h2 { font-size: 34px; }
.success .ref { display: inline-block; margin: 14px 0 6px; font: 600 15px var(--sans); letter-spacing: .08em; background: var(--paper-2); padding: 8px 16px; border-radius: 999px; }
.success .acts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Espace client ---------- */
.login { min-height: calc(100vh - 110px); display: grid; place-items: center; padding: 40px 16px; }
.login .box { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); }
.login .box h1 { font-size: 34px; margin-bottom: 8px; }
.login .box p { color: var(--muted); margin: 0 0 22px; }
.login form { display: grid; gap: 14px; }
.login .demo { font-size: 13.5px; background: var(--amber-soft); color: var(--amber); padding: 10px 12px; border-radius: 8px; }

.dash { padding: 34px 0 90px; }
.dash-top { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-top h1 { font-size: clamp(30px, 4vw, 42px); }
.dash-top p { margin: 6px 0 0; color: var(--muted); }
.dtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.dtabs button { background: none; border: 0; padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.dtabs button.on { color: var(--ink); border-color: var(--red); }
.orders { display: grid; gap: 14px; }
.order { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left; width: 100%; font: inherit; color: inherit; }
.order:hover { border-color: #C9C1B4; box-shadow: var(--shadow); }
.order .t { font: 500 21px/1.25 var(--serif); }
.order .m { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.order .r { text-align: right; display: grid; gap: 8px; justify-items: end; align-content: start; }
.order .r b { font-size: 16px; }
.mini-track { grid-column: 1 / -1; display: flex; gap: 5px; }
.mini-track i { flex: 1; height: 5px; border-radius: 3px; background: var(--paper-2); }
.mini-track i.d { background: var(--ink-2); }
.mini-track i.c { background: var(--red); }

.detail { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.back { background: none; border: 0; padding: 0; display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 600; margin-bottom: 18px; }
.back:hover { color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 24px 38px; }
.timeline li::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .b { position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; }
.timeline .b .ic { width: 13px; height: 13px; }
.timeline li.d .b { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.timeline li.d::before { background: var(--ink-2); }
.timeline li.c .b { border-color: var(--red); }
.timeline li.c .b::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }
.timeline b { display: block; font-size: 16.5px; }
.timeline small { color: var(--muted); font-size: 14px; }
.timeline li:not(.d):not(.c) b { color: var(--muted); font-weight: 500; }
.kv { display: grid; gap: 12px; font-size: 15px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.kv div:last-child { border: 0; padding: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.deliv { display: grid; gap: 10px; }
.deliv a, .deliv button { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; text-decoration: none; background: #fff; text-align: left; font: inherit; color: inherit; width: 100%; }
.deliv a:hover, .deliv button:hover { border-color: var(--ink-2); }
.deliv .ic { color: var(--red); }
.deliv small { display: block; color: var(--muted); font-size: 13.5px; }
.rate { display: flex; gap: 6px; }
.rate button { background: none; border: 0; padding: 2px; color: #D3CBBE; }
.rate button.on { color: #E3A008; }
.rate button.on .ic { fill: currentColor; }
.rate .ic { width: 26px; height: 26px; }
.empty-note { text-align: center; color: var(--muted); padding: 40px 10px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* Modale */
.modal { position: fixed; inset: 0; background: rgba(30, 28, 26, .55); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 90; }
.modal.on { display: flex; }
.modal .box { background: var(--card); border-radius: 16px; width: min(760px, 100%); max-height: 88vh; overflow: auto; padding: 32px; position: relative; }
.modal .x { position: absolute; top: 14px; right: 14px; background: var(--paper-2); border: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.doc-view { font-family: var(--serif); font-size: 18px; line-height: 1.85; color: var(--ink-2); }
.doc-view .cmt { background: #A86A0022; border-radius: 3px; position: relative; }
.cmt-list { margin-top: 22px; display: grid; gap: 10px; }
.cmt-list div { font-size: 14.5px; background: var(--paper); border-left: 3px solid var(--red); padding: 10px 14px; border-radius: 0 8px 8px 0; }
.cmt-list b { color: var(--ink); }

/* Facture imprimable */
.invoice { font-size: 14.5px; }
.invoice .ih { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 26px; }
.invoice .ih img { height: 46px; width: auto; }
.invoice h2 { font-size: 30px; }

@media (max-width: 960px) {
  .wiz-grid, .detail { grid-template-columns: 1fr; }
  .recap { position: static; }
  .opts.cols3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .panel { padding: 22px 18px; }
  .progress li { font-size: 0; }
  .progress li.on { font-size: 13px; }
  .grid-fields { grid-template-columns: 1fr; }
  .opts.cols3:has(.opt.vert) { grid-template-columns: 1fr 1fr; }
  .opt.vert { padding: 14px; }
  .order { grid-template-columns: 1fr; }
  .order .r { justify-items: start; text-align: left; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .app-hdr .right .hide-sm { display: none; }
  .modal .box { padding: 26px 18px; }
  .login .box { padding: 28px 20px; }
}
@media print {
  body * { visibility: hidden; }
  .modal.on .box, .modal.on .box * { visibility: visible; }
  .modal.on { position: absolute; inset: 0; background: none; padding: 0; display: block; }
  .modal .box { max-height: none; box-shadow: none; width: 100%; }
  .modal .x, .no-print { display: none !important; }
}
