/* couleurs de synatome.ca (encre, craie, gris-bleu acier) ; police système, celle que synatome.ca prend sans Geist */
:root {
  --ink: #0d0d0d;
  --ink-soft: #3f3f46;
  --ink-mute: #6b6b74;
  --paper: #f4f4f5;
  --card: #ffffff;
  --field: #cfcfd6;
  --steel: #8fa9c6;
  --steel-deep: #34506f;
  --steel-wash: #edf2f7;
  --green: #1f6b3e;
  --green-wash: #e3f1e7;
  --amber: #7a5612;
  --amber-wash: #f6efdd;
  --red: #b3261e;
  --red-wash: #fbe9e7;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 0; }
small { color: var(--ink-mute); font-weight: 400; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--steel-deep); outline-offset: 2px; }

.wordmark { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 8px; background: none; color: var(--ink); font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.btn-main { background: var(--ink); color: #fff; }
.btn-main:hover:not(:disabled) { background: #26262b; }
.btn-quiet { border-color: var(--field); background: var(--card); }
.btn-quiet:hover:not(:disabled) { border-color: var(--ink); }
.btn-link { min-height: 40px; padding: 0; border: 0; color: var(--ink-mute); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--red); }
.btn-danger { border-color: var(--red); background: var(--red); color: #fff; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-on-dark { border-color: rgba(244, 244, 245, 0.35); color: #f4f4f5; }
.btn-on-dark:hover { border-color: #f4f4f5; }

.field { display: grid; gap: 6px; }
label { font-size: 14px; font-weight: 600; }
input, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff; color: var(--ink); font: 400 16px/1.4 var(--sans); }
textarea { resize: vertical; }
input[type='file'] { padding: 9px; font-size: 14px; }
input::placeholder, textarea::placeholder { color: #9b9ba3; }

.error { padding: 10px 12px; border-radius: 8px; background: var(--red-wash); color: var(--red); font-weight: 500; }
.sent { padding: 10px 12px; border-radius: 8px; background: var(--green-wash); color: var(--green); font-weight: 600; }

/* connexion */
.page-login { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; }
.login-box { width: min(380px, 100%); }
.login-box .wordmark { margin-bottom: 36px; }
.login-box h1 { font-size: 28px; font-weight: 700; }
.login-lead { margin-top: 8px; color: var(--ink-soft); }
#login-form { display: grid; gap: 16px; margin-top: 28px; }
.field-hint { color: var(--ink-mute); font-size: 13px; }
.login-help { margin-top: 20px; color: var(--ink-mute); font-size: 14px; }

/* page du club */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px clamp(16px, 3vw, 40px); background: var(--ink); color: #f4f4f5; }

.app { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; max-width: 1360px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 64px; }

.side { display: grid; gap: 18px; }
.side-head { display: grid; gap: 4px; }
.eyebrow { color: var(--ink-mute); font-size: 14px; font-weight: 500; }
.side-head h1 { font-size: 30px; font-weight: 700; overflow-wrap: anywhere; }
.site-link { justify-self: start; color: var(--steel-deep); font-size: 14px; font-weight: 500; text-underline-offset: 3px; }

/* séparées par l'espace et le fond, sans filet (Gabriel B. : aucune ligne décorative) */
.requests { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.request { display: grid; gap: 6px; padding: 12px 14px; border-radius: 8px; text-decoration: none; }
.request:hover { background: rgba(255, 255, 255, 0.7); }
.request[aria-current='page'] { background: var(--card); box-shadow: inset 3px 0 0 var(--steel-deep); }
.request-title { font-weight: 600; overflow-wrap: anywhere; }
.request[data-status='done'] .request-title, .request[data-status='cancelled'] .request-title { color: var(--ink-mute); font-weight: 500; }
.request-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.request-date { color: var(--ink-mute); font-size: 13px; }
.empty { color: var(--ink-mute); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #e7e7ea; color: var(--ink-soft); font-size: 12px; font-weight: 650; white-space: nowrap; }
.chip[data-status='working'], .chip[data-status='publishing'] { background: var(--steel-wash); color: var(--steel-deep); }
.chip[data-status='preview_ready'] { background: var(--steel-deep); color: #fff; }
.chip[data-status='done'] { background: var(--green-wash); color: var(--green); }
.chip[data-status='needs_human'], .chip[data-status='failed'] { background: var(--amber-wash); color: var(--amber); }
.chip[data-status='cancelled'] { background: #ececef; color: var(--ink-mute); }

.panel { min-width: 0; padding: clamp(20px, 2.4vw, 32px); border-radius: 12px; background: var(--card); }
.panel:focus { outline: none; }
.panel section { display: grid; gap: 16px; }
.panel h2 { font-size: 26px; font-weight: 700; overflow-wrap: anywhere; }
.lead { color: var(--ink-soft); }
.back { display: none; justify-self: start; color: var(--ink-soft); font-size: 15px; font-weight: 500; text-underline-offset: 3px; }
.back::before { content: '← '; }
#new-form { display: grid; gap: 18px; max-width: 720px; }
#new-form .btn-main { justify-self: start; min-width: 170px; }

.task-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.meta { color: var(--ink-mute); font-size: 14px; }
.explain { color: var(--ink-soft); }
.task-details { max-width: 72ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.files img { display: block; width: 132px; height: 88px; object-fit: cover; border-radius: 6px; background: var(--paper); }
.file-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 6px; background: var(--paper); font-size: 14px; overflow-wrap: anywhere; }

.preview { display: grid; gap: 12px; padding: 16px 18px; border-radius: 10px; background: var(--steel-wash); }
.preview h3 { font-size: 15px; font-weight: 650; color: var(--steel-deep); }
.preview-summary { white-space: pre-wrap; overflow-wrap: anywhere; }
.preview > .btn { justify-self: start; }
.publish { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.publish .btn { min-width: 132px; }
.publish-hint { color: var(--ink-soft); font-size: 14px; }
.confirm { display: grid; gap: 12px; padding: 14px; border-radius: 8px; background: var(--paper); }
.preview .confirm { background: var(--card); }
.confirm p { font-weight: 600; }
.confirm-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.thread { display: grid; gap: 10px; }
.thread h3 { font-size: 15px; font-weight: 650; }
.replies { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.replies li { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: #f6f6f7; }
.replies li[data-author='robot'], .replies li[data-author='synatome'] { background: var(--steel-wash); }
.reply-meta { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.reply-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.reply { display: grid; gap: 8px; max-width: 720px; margin-top: 8px; }
.reply input[type='file'] { margin-bottom: 4px; }
.cancel { display: grid; gap: 10px; justify-items: start; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  /* au téléphone, une vue à la fois : la liste, ou le formulaire, ou une demande */
  body[data-route='list'] .panel { display: none; }
  body:not([data-route='list']) .side { display: none; }
  .back { display: inline-block; }
  .panel { padding: 18px 16px 22px; }
  .panel h2 { font-size: 23px; }
  .side-head h1 { font-size: 26px; }
}
