/* MarqueComme client portal. Brand look (Outfit titles, Inter text, black bar, yellow accent).
   Fonts are self-hosted in /assets/fonts (no third-party requests). Square corners.
   Follows the computer's light/dark setting through the tokens below. No inline styles (CSP). */

@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/Outfit-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/Outfit-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/Outfit-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --noir: #000; --jaune: #FFDE00; --graphite: #4D4D4D; --gris: #A6A6A6;
  --bg: #fff; --panel: #F2F2F2; --card: #fff; --ink: #000; --muted: #4D4D4D; --line: #DEDEDE; --field: #fff;
  --bad: #A11A1A; --bad-bg: #FCE8E8; --focus: #000;
  --star: var(--graphite);   /* asterisk: graphite on light, yellow on dark (never yellow on white) */
  --display: "Outfit", Arial, sans-serif; --text: "Inter", Arial, sans-serif;
  --wrap: 1120px; --pad: max(24px, env(safe-area-inset-left));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111; --panel: #1C1C1C; --card: #161616; --ink: #F2F2F2; --muted: #B3B3B3; --line: #333; --field: #141414; --bad: #FF9C9C; --bad-bg: #3A1515; --focus: var(--jaune); --star: var(--jaune); }
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { font-size: .9em; }

/* Top bar */
.p-bar { background: var(--noir); color: #fff; }
.p-bar-in { max-width: var(--wrap); margin: 0 auto; min-height: 72px; padding: 12px var(--pad); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.p-bar :focus-visible { outline-color: var(--jaune); }
/* Logo + label. The logo's box runs down to the tail of the q: the letters are its top 75 %.
   The label gets a box as tall as the letters and is centred in it, so it lines up with them. */
.p-brand { --logo-h: 20px; display: inline-flex; align-items: flex-start; gap: 12px; text-decoration: none; }
.p-brand .logo { display: block; height: var(--logo-h); width: auto; flex: none; }
.p-brand .logo .m { fill: #fff; } .p-brand .logo .c, .p-brand .logo .disc { fill: var(--gris); } .p-brand .logo .star { fill: var(--jaune); }
.p-brand-label { height: calc(var(--logo-h) * .75); display: flex; align-items: center; gap: 12px; font: 600 11px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--gris); white-space: nowrap; }
.p-brand-label::before { content: ""; width: 1px; height: 100%; background: var(--graphite); }
.p-tools { margin-left: auto; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-size: 14px; }
.p-tools a { color: #D9D9D9; text-decoration: none; }
.p-tools a:hover { color: #fff; text-decoration: underline; }
.p-tools form { margin: 0; }
.p-logout { font: 600 14px/1 var(--text); color: var(--noir); background: #fff; border: 0; padding: 10px 14px; min-height: 36px; cursor: pointer; }
.p-logout:hover { background: var(--jaune); }
.p-link { color: inherit; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Layout */
.p-main { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 48px var(--pad) 72px; flex: 1; }
.p-narrow { max-width: 480px; padding-top: 10vh; }
/* Page head: a grey band the full width of the window, behind the client's logo and name */
.p-head { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin: -48px 0 40px; padding: 44px 0 40px; background: var(--panel); box-shadow: 0 0 0 100vmax var(--panel); clip-path: inset(0 -100vmax); }
.p-head h1 { font: 700 clamp(32px, 4vw, 48px)/1.02 var(--display); letter-spacing: -.01em; margin: 0; }
.p-kicker { margin: 0 0 8px; font: 600 12px/1 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.p-client-logo { width: 88px; height: 88px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 10px; flex: none; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }
.p-card { background: var(--card); border: 1px solid var(--line); padding: 26px 28px; }
.p-card h2 { font: 600 24px/1.2 var(--display); margin: 0 0 8px; }
.p-card h2::before { content: "*"; color: var(--star); font-weight: 700; margin-right: 8px; }
.p-login h1 { font: 700 32px/1.1 var(--display); margin: 0 0 10px; }
.p-muted { color: var(--muted); margin: 0 0 20px; }
.p-hint { font-size: 13px; color: var(--muted); margin: 18px 0 0; }

/* Forms */
.p-field { margin: 0 0 16px; }
.p-field label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.p-field input { width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 0; padding: 12px 14px; }
.p-field input:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: -1px; }
.p-code { font: 600 28px/1 var(--display) !important; letter-spacing: .3em; text-align: center; }
.p-btn { width: 100%; font: 600 16px/1 var(--display); padding: 15px 20px; border: 2px solid var(--ink); background: var(--ink); color: var(--card); cursor: pointer; }
.p-btn:hover { opacity: .88; }
.p-inline { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin: 18px 0 0; font-size: 14px; }
.p-inline .p-link { color: var(--ink); }
.p-alert { padding: 12px 16px; margin: 0 0 20px; background: var(--card); border-left: 4px solid var(--jaune); }
.p-alert.is-error { background: var(--bad-bg); color: var(--bad); border-left-color: var(--bad); }
.p-brands { display: grid; gap: 10px; }
.p-brand-btn { font: 600 18px/1.2 var(--display); text-align: left; padding: 16px 18px; border: 1px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; }
.p-brand-btn:hover { border-color: var(--ink); }

/* Privacy text */
.p-prose { max-width: 760px; }
.p-prose h1 { font: 700 clamp(28px, 3.5vw, 38px)/1.1 var(--display); margin: 0 0 6px; }
.p-prose h2 { font: 600 20px/1.25 var(--display); margin: 28px 0 8px; }
.p-prose h2::before { content: none; }
.p-prose ul { padding-left: 20px; }
.p-prose li { margin: 0 0 8px; }

/* Footer */
.p-foot { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.p-foot-in { max-width: var(--wrap); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px var(--pad); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Files ---- */
.p-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p-files { list-style: none; margin: 0; padding: 0; }
.p-files li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.p-file-name { font: 600 17px/1.3 var(--display); color: var(--ink); text-decoration: none; }
.p-file-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.p-file-meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.p-files .p-btn-small { grid-column: 2; grid-row: 1 / span 2; }
.p-btn-small { display: inline-flex; align-items: center; min-height: 44px; font: 600 14px/1 var(--display); padding: 0 14px; border: 2px solid var(--ink); color: var(--ink); text-decoration: none; white-space: nowrap; }
.p-btn-small:hover { background: var(--ink); color: var(--card); }
.p-btn-inline { display: inline-block; width: auto; text-decoration: none; margin-top: 8px; }
.p-back { margin: 0 0 14px; }
.p-back a { color: var(--muted); text-decoration: none; }
.p-back a:hover { color: var(--ink); }
.p-file h1 { font: 700 clamp(26px, 4vw, 36px)/1.15 var(--display); margin: 0 0 8px; }
.p-note { margin: 0 0 20px; padding: 14px 16px; background: var(--panel); border-left: 3px solid var(--jaune); }
.p-note p { margin: 0 0 10px; } .p-note p:last-child { margin: 0; }
@media (max-width: 560px) { .p-files li { grid-template-columns: 1fr; } .p-files .p-btn-small { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; } }

/* ---- Invoices ---- */
.p-status { display: inline-block; vertical-align: middle; font: 600 11px/1 var(--text); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.p-status.is-paid, .p-status.is-credited { background: #E3F4E8; color: #0F6B2F; border-color: transparent; }
.p-status.is-overdue { background: var(--noir); color: var(--jaune); border-color: var(--noir); }
.p-status.is-cancelled { color: var(--muted); border-color: var(--line); }
@media (prefers-color-scheme: dark) { .p-status.is-overdue { background: var(--jaune); color: var(--noir); border-color: var(--jaune); } }
h1 .p-status { font-size: 12px; margin-left: 8px; }
.p-big { font: 700 36px/1.1 var(--display); margin: 6px 0 4px; }
.p-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 18px 0 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.p-dl dt { color: var(--muted); } .p-dl dd { margin: 0; }
@media (prefers-color-scheme: dark) { .p-status.is-paid, .p-status.is-credited { background: #12301C; color: #7FD69A; } }

/* Projects: a table across the whole grid (brand: black header, quiet stripes, numbers right-aligned) */
.p-wide { grid-column: 1 / -1; }
.p-table-wrap { overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.p-table th { background: var(--noir); color: #fff; font: 600 12px/1.2 var(--text); letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 10px 12px; white-space: nowrap; }
.p-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.p-table tbody tr:nth-child(even) td { background: var(--panel); }
.p-table td .p-file-meta { display: block; margin-top: 2px; }
.p-table .p-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-dash { color: var(--muted); }
.p-table-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.p-status.is-done { color: var(--muted); border-color: var(--muted); }
@media (prefers-color-scheme: dark) { .p-table th { background: #000; border-bottom: 1px solid var(--line); } }
/* Phones: each project becomes a block, the column names move beside the values */
@media (max-width: 560px) {
  .p-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .p-table, .p-table tbody, .p-table tr, .p-table td { display: block; }
  .p-table tr { border-top: 1px solid var(--line); padding: 12px 0; }
  .p-table td { border: 0; padding: 4px 0; background: transparent !important; }
  .p-table td[data-label] { display: flex; justify-content: space-between; gap: 16px; }
  .p-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  .p-table .p-num { text-align: right; }
}

/* ---- File requests ---- */
.p-status.is-open { background: var(--jaune); color: var(--noir); border-color: var(--jaune); }
.p-request { margin: 0 0 24px; }
.p-upload { margin: 24px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.p-upload h2 { font: 600 20px/1.25 var(--display); margin: 0 0 12px; }
.p-upload h2::before { content: "*"; color: var(--star); font-weight: 700; margin-right: 8px; }
.p-drop { border: 2px dashed var(--line); padding: 18px 20px; background: var(--panel); }
.p-drop.is-over { border-color: var(--ink); }
.p-drop label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 8px; }
.p-drop input[type=file] { width: 100%; font: inherit; font-size: 15px; color: var(--ink); }
.p-drop input[type=file]::file-selector-button { font: 600 14px/1 var(--display); padding: 11px 14px; margin-right: 12px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 0; cursor: pointer; }
.p-drop .p-hint { margin: 10px 0 0; }
.p-upload .p-btn-inline { margin-top: 18px; }
.p-upload .p-btn:disabled { opacity: .45; cursor: wait; }
.p-queue { list-style: none; margin: 16px 0 0; padding: 0; }
.p-queue li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.p-queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.p-queue-state { color: var(--muted); font-variant-numeric: tabular-nums; }
.p-queue-bar { grid-column: 1 / -1; height: 6px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.p-queue-bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.p-queue li.is-done .p-queue-state { color: var(--ink); }
.p-queue li.is-bad .p-queue-state { color: var(--bad); grid-column: 1 / -1; }
.p-queue li.is-bad .p-queue-bar span { background: var(--bad); }
.p-files li.is-off .p-file-name { color: var(--muted); text-decoration: line-through; }
.p-files form { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.p-files button.p-btn-small { background: transparent; cursor: pointer; }
.p-req-due { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .p-files form { grid-column: 1; grid-row: auto; margin-top: 8px; } }
