/* Portail client TRUSS — mêmes codes visuels que bytruss.com */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --alabaster: #fafafa;
  --white: #ffffff;
  --obsidian: #0a0a0c;
  --slate: #616771;
  --mist: #d9dce3;
  --line: #e7e8ec;
  --line-dark: rgba(250, 250, 250, 0.14);
  --blue: #2855f6;
  --emerald: #078b64;
  --amber: #a8730a;
  --radius: 20px;
  --ease: cubic-bezier(0.44, 0, 0.56, 1);
  --spring: cubic-bezier(0.22, 1.2, 0.36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--alabaster);
  color: var(--obsidian);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- En-tête ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 250, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--blue); color: var(--alabaster);
  font-size: 14px; font-weight: 800; line-height: 1;
}
.brand__name { font-size: 16px; font-weight: 800; letter-spacing: -0.8px; }
.brand__tag {
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--white); font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--slate);
}
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__user { font-size: 13px; font-weight: 600; color: var(--slate); }

/* ---------- Structure ---------- */

.wrap { max-width: 980px; margin: 0 auto; padding: 32px 24px 80px; }
.wrap--narrow { max-width: 460px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--lg { gap: 28px; }

.card {
  display: flex; flex-direction: column; gap: 18px;
  padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.card--dark { border-color: transparent; background: var(--obsidian); color: var(--alabaster); }
.card--flat { padding: 20px; gap: 12px; }

.label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--slate);
}
.card--dark .label { color: var(--mist); }
.title { font-size: 26px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.15; }
.title--sm { font-size: 19px; letter-spacing: -0.7px; }
.muted { font-size: 14px; line-height: 1.55; color: var(--slate); }
.card--dark .muted { color: var(--mist); }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: 1px solid transparent; border-radius: 100px;
  font-size: 14px; font-weight: 700; letter-spacing: -0.2px; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.25s var(--spring);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--blue); color: var(--alabaster); }
.btn--primary:hover { background: var(--obsidian); }
.btn--ghost { background: var(--white); border-color: var(--line); }
.btn--ghost:hover { background: var(--alabaster); border-color: var(--mist); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--danger { background: var(--white); border-color: var(--line); color: #a12f2f; }
.btn--danger:hover { border-color: #d14343; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------- Formulaires ---------- */

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 700; letter-spacing: -0.1px; }
.input {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid #8a8f99; border-radius: 12px; background: var(--alabaster);
  font-size: 15px; line-height: 1.4;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: #6b707a; }
.input:focus { border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 4px rgba(40, 85, 246, 0.12); }
select.input {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23616771' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
}
textarea.input { min-height: 84px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.code-input {
  width: 100%; padding: 14px; text-align: center;
  font-size: 30px; font-weight: 800; letter-spacing: 12px; text-indent: 12px;
}

.notice {
  display: none; align-items: flex-start; gap: 9px;
  padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; line-height: 1.5;
}
.notice.is-on { display: flex; }
.notice--error { border: 1px solid rgba(209, 67, 67, 0.35); background: rgba(209, 67, 67, 0.06); color: #a12f2f; }
.notice--info { border: 1px solid rgba(40, 85, 246, 0.3); background: rgba(40, 85, 246, 0.06); color: #1f3fb8; }
.notice--ok { border: 1px solid rgba(7, 139, 100, 0.35); background: rgba(7, 139, 100, 0.07); color: #056146; }

/* ---------- Suivi du dossier ---------- */

.steps { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }

.step { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 0;
  width: 2px; border-radius: 2px; background: var(--line);
}
.step:last-child::before { display: none; }
.step--done::before { background: var(--emerald); }

.step__dot {
  position: relative; z-index: 1;
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 100px;
  border: 2px solid var(--line); background: var(--white);
  font-size: 11px; font-weight: 800; color: var(--slate);
}
.step--done .step__dot { border-color: var(--emerald); background: var(--emerald); color: var(--white); }
.step--current .step__dot { border-color: var(--blue); background: var(--white); color: var(--blue); }
.step--current .step__dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 100px;
  border: 2px solid var(--blue); opacity: 0; animation: pulse 2.2s var(--ease) 3;
}
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.6; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

.step__body { display: flex; flex-direction: column; gap: 4px; padding-top: 3px; min-width: 0; }
.step__title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.35; }
.step--todo .step__title { color: var(--slate); font-weight: 600; }
.step__meta { font-size: 13px; color: var(--slate); }
.step__note {
  margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55;
  border: 1px solid rgba(40, 85, 246, 0.25); background: rgba(40, 85, 246, 0.05); color: #1f3fb8;
}
.step__note--action { border-color: rgba(168, 115, 10, 0.3); background: rgba(168, 115, 10, 0.07); color: #7a5405; }

/* ---------- Listes ---------- */

.rows { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--alabaster);
}
.row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row__title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.2px; overflow-wrap: anywhere; }
.row__meta { font-size: 12.5px; color: var(--slate); }
.row__actions { display: flex; align-items: center; gap: 8px; flex: none; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact__value { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; overflow-wrap: anywhere; }
.fact__value a { color: inherit; text-underline-offset: 3px; }
.card--dark .fact__value { color: var(--alabaster); }

.empty {
  padding: 22px; border: 1px dashed var(--mist); border-radius: 14px;
  font-size: 14px; color: var(--slate); text-align: center;
}

.badge {
  display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase;
}
.badge--blue { background: var(--blue); color: var(--alabaster); }
.badge--soft { border: 1px solid var(--line); background: var(--white); color: var(--slate); }

.spinner {
  width: 18px; height: 18px; border: 2px solid var(--mist);
  border-top-color: var(--blue); border-radius: 100px; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; padding: 60px 0; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .wrap { padding: 22px 16px 60px; }
  .topbar { padding: 12px 16px; }
  .card { padding: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .row__actions { justify-content: flex-end; }
  .brand__tag { display: none; }
}

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