/* modules_perso.css : page de commande de modules sur mesure (+ admin) */
.mp, .mpa {
    --mp-bg: #070b12;
    --mp-panel: #0d1420;
    --mp-panel-2: #111b2b;
    --mp-line: #1d2a3d;
    --mp-text: #e6ecf3;
    --mp-muted: #8a98ab;
    --mp-brass: #d9a441;
    --mp-teal: #3fb6a8;
    --mp-red: #e0675a;
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 24px 96px;
    color: var(--mp-text);
    font-family: 'Inter', system-ui, sans-serif;
}
.mp h1, .mp h2, .mp h3, .mpa h1, .mpa h2, .mpa h3 {
    font-family: 'Big Shoulders Display', 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: .01em;
    margin: 0;
}
.mp-num, .mpa .mp-num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 500; }

/* ---------- en-tête ---------- */
.mp-hero { max-width: 760px; margin-bottom: 48px; }
.mp-hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: .98; margin-bottom: 20px; }
.mp-hero > p { color: var(--mp-muted); font-size: 1.05rem; line-height: 1.65; max-width: 62ch; margin: 0 0 32px; }
.mp-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step;
           border-top: 1px solid var(--mp-line); }
.mp-flow li { counter-increment: step; padding: 18px 20px 0 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.mp-flow li + li { padding-left: 20px; border-left: 1px solid var(--mp-line); }
.mp-flow li::before { content: counter(step); font-family: 'JetBrains Mono', monospace; color: var(--mp-brass); font-size: .85rem; }
.mp-flow strong { font-weight: 600; }
.mp-flow span { color: var(--mp-muted); font-size: .92rem; line-height: 1.5; }

/* ---------- accès ---------- */
.mp-gate { background: var(--mp-panel); border: 1px solid var(--mp-line); border-left: 3px solid var(--mp-brass);
           padding: 32px; max-width: 620px; border-radius: 6px; }
.mp-gate h2 { font-size: 1.9rem; margin-bottom: 8px; }
.mp-gate p { color: var(--mp-muted); margin: 0 0 20px; line-height: 1.6; }

/* ---------- commande ---------- */
.mp-order { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.mp-form { display: flex; flex-direction: column; gap: 24px; }
.mp-field { display: flex; flex-direction: column; gap: 8px; }
.mp-field > label, .mp-options legend { font-weight: 600; font-size: .95rem; }
.mp-field input, .mp-field select, .mp-field textarea, .mp-qty input {
    background: var(--mp-panel); color: var(--mp-text); border: 1px solid var(--mp-line); border-radius: 5px;
    padding: 12px 14px; font: inherit; width: 100%; box-sizing: border-box;
}
.mp-field textarea { resize: vertical; line-height: 1.55; }
.mp-field input:focus, .mp-field select:focus, .mp-field textarea:focus, .mp-qty input:focus,
.mp-opt-main:has(.mp-check:focus-visible) { outline: 2px solid var(--mp-teal); outline-offset: 1px; }
.mp-hint { color: var(--mp-muted); font-size: .82rem; }

.mp-options { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mp-options legend { padding: 0; margin-bottom: 10px; }
.mp-opt { background: var(--mp-panel); border: 1px solid var(--mp-line); border-radius: 5px; border-left: 3px solid transparent;
          transition: border-color .15s, background .15s; }
.mp-opt.is-on { border-left-color: var(--mp-brass); background: var(--mp-panel-2); }
.mp-opt-main { display: grid; grid-template-columns: 20px 1fr auto; gap: 14px; align-items: start; padding: 14px 16px; cursor: pointer; }
.mp-check { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--mp-brass); }
.mp-opt-text { display: flex; flex-direction: column; gap: 3px; }
.mp-opt-name { font-weight: 600; }
.mp-opt-desc { color: var(--mp-muted); font-size: .88rem; line-height: 1.45; }
.mp-opt-price { font-family: 'JetBrains Mono', monospace; color: var(--mp-brass); white-space: nowrap; text-align: right; display: flex; flex-direction: column; }
.mp-opt-price small { color: var(--mp-muted); font-family: 'Inter', sans-serif; font-size: .72rem; }
.mp-qty { display: flex; align-items: center; gap: 10px; padding: 0 16px 14px 50px; }
.mp-qty[hidden] { display: none; }
.mp-qty label { color: var(--mp-muted); font-size: .88rem; }
.mp-qty input { width: 84px; padding: 8px 10px; }

/* ---------- devis ---------- */
.mp-quote { position: sticky; top: 24px; background: var(--mp-panel); border: 1px solid var(--mp-line); border-top: 3px solid var(--mp-brass);
            border-radius: 6px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.mp-quote h2 { font-size: 1.5rem; }
.mp-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .92rem; }
.mp-lines li { display: flex; justify-content: space-between; gap: 12px; color: var(--mp-muted); }
.mp-lines .mp-num { color: var(--mp-text); }
.mp-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--mp-line); padding-top: 16px; }
.mp-total-label { font-weight: 600; }
.mp-total-value { font-family: 'Big Shoulders Display', sans-serif; font-weight: 800; font-size: 3.4rem; line-height: 1; color: var(--mp-brass); }
.mp-total.tick .mp-total-value { animation: mp-tick .22s ease-out; }
@keyframes mp-tick { from { color: var(--mp-teal); transform: translateY(-3px); } to { color: var(--mp-brass); transform: none; } }
.mp-quote-note { margin: 0; color: var(--mp-muted); font-size: .84rem; line-height: 1.5; }
.mp-quote .btn[disabled] { opacity: .6; cursor: wait; }
.mp-msg { margin: 0; font-size: .9rem; min-height: 1.2em; }
.mp-msg.ok { color: var(--mp-teal); }
.mp-msg.err { color: var(--mp-red); }

/* ---------- suivi ---------- */
.mp-orders { margin-top: 72px; }
.mp-orders > h2 { font-size: 2rem; margin-bottom: 20px; }
#mpOrders { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.mp-order-card { background: var(--mp-panel); border: 1px solid var(--mp-line); border-left: 3px solid var(--mp-line); border-radius: 6px;
                 padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.mp-order-card.st-quoted, .mp-order-card.st-pending { border-left-color: var(--mp-brass); }
.mp-order-card.st-paid, .mp-order-card.st-in_progress, .mp-order-card.st-delivered { border-left-color: var(--mp-teal); }
.mp-order-card.st-cancelled, .mp-order-card.st-refused { border-left-color: var(--mp-red); opacity: .75; }
.mp-order-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mp-order-top h3 { font-size: 1.35rem; }
.mp-status { font-size: .8rem; color: var(--mp-muted); white-space: nowrap; }
.mp-order-meta, .mp-order-opts, .mp-order-note { margin: 0; font-size: .86rem; color: var(--mp-muted); line-height: 1.5; }
.mp-order-note { color: var(--mp-text); border-left: 2px solid var(--mp-line); padding-left: 10px; }
.mp-order-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.mp-order-foot > .mp-num { font-size: 1.15rem; color: var(--mp-brass); }
.mp-order-actions { display: flex; gap: 8px; }

/* ---------- admin ---------- */
.mpa h1 { font-size: 2.6rem; margin-bottom: 8px; }
.mpa-sub { color: var(--mp-muted); margin: 0 0 28px; }
.mpa-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.mpa-filters button { background: var(--mp-panel); color: var(--mp-muted); border: 1px solid var(--mp-line); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: .85rem; }
.mpa-filters button.on { color: #111; background: var(--mp-brass); border-color: var(--mp-brass); }
.mpa-list { display: flex; flex-direction: column; gap: 16px; }
.mpa-card { background: var(--mp-panel); border: 1px solid var(--mp-line); border-left: 3px solid var(--mp-brass); border-radius: 6px; padding: 22px;
            display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
.mpa-card h3 { font-size: 1.5rem; margin-bottom: 4px; }
.mpa-meta { color: var(--mp-muted); font-size: .86rem; margin: 0 0 12px; }
.mpa-desc { white-space: pre-wrap; line-height: 1.6; margin: 0 0 12px; font-size: .95rem; }
.mpa-opts { color: var(--mp-muted); font-size: .88rem; margin: 0; }
.mpa-est { font-family: 'JetBrains Mono', monospace; color: var(--mp-brass); }
.mpa-form { display: flex; flex-direction: column; gap: 10px; }
.mpa-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--mp-muted); }
.mpa-form input, .mpa-form select, .mpa-form textarea { background: var(--mp-bg); color: var(--mp-text); border: 1px solid var(--mp-line); border-radius: 5px; padding: 9px 11px; font: inherit; }
.mpa-form input:focus, .mpa-form select:focus, .mpa-form textarea:focus { outline: 2px solid var(--mp-teal); outline-offset: 1px; }
.mpa-save-msg { font-size: .84rem; min-height: 1.1em; color: var(--mp-teal); }
.mpa-save-msg.err { color: var(--mp-red); }
.mpa-empty { color: var(--mp-muted); }

@media (max-width: 960px) {
    .mp-order { grid-template-columns: 1fr; }
    .mp-quote { position: static; }
    .mpa-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .mp, .mpa { padding: 36px 16px 72px; }
    .mp-flow { grid-template-columns: 1fr; }
    .mp-flow li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--mp-line); margin-top: 16px; }
    .mp-opt-main { grid-template-columns: 20px 1fr; }
    .mp-opt-price { grid-column: 2; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
    .mp-qty { padding-left: 50px; }
}
@media (prefers-reduced-motion: reduce) {
    .mp-total.tick .mp-total-value { animation: none; }
    .mp-opt { transition: none; }
}
