/* Group C « Demandes et parcours » (Design 2, docs/agents/controleur.md): requests*, request_remove,
   welcome, setup, login, restore, error. Loaded by {% block head %} of these pages only; tokens
   from mediagora.css, no value of its own. Page classes: req-page, rm-page, err-page, auth-form,
   welcome (body). */

/* ── Requests: a head of one line (title, tabs) then ONE zone that takes the rest of the window ── */
.req-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-1) var(--gap); margin-bottom: var(--gap); }
.req-head .page-head { margin: 0; }
.req-head .tabs { margin: 0; max-width: 100%; }
.req-zone .zone-body { max-height: none; }
.req-zone .zone-head { flex-wrap: wrap; }
.req-zone .chips { display: flex; flex-wrap: nowrap; gap: var(--sp-2); min-width: 0; margin: 0; overflow-x: auto; }
.req-zone .chip { flex: none; margin: 0; }
.zone-title .chip-count { margin-left: 0; }
.req-zone .zone-foot { display: flex; flex-direction: column; gap: var(--sp-1); }
.req-zone .bulk-bar { margin: 0; gap: var(--sp-2); }
.req-zone .bulk-bar p { flex: 1 1 12em; }
.bulk-refuse #bulk-reason { width: 13rem; }
.bulk-note { font-size: var(--fs-xs); }
.req-empty { flex: 1; display: grid; align-content: safe center; justify-items: center; gap: var(--sp-3); min-height: 10rem; text-align: center; }
/* « My requests »: dense rows, in a grid of small cards where the window is wide */
.req-mine .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: var(--sp-2) var(--gap); align-content: start; }
.req-mine .item { flex-wrap: wrap; padding: var(--sp-2) var(--sp-3); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-btn); }
.req-mine .item:first-child { padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.item-act { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.item-act .item-end { flex: 1 1 auto; max-width: none; text-align: left; }
.item-act form { display: flex; }
@media (max-width: 899px) {  /* phone: the page scrolls, the rows sit flush in the card */
  .req-zone .data tr { padding-inline: 0; }
}
@media (min-width: 900px) {
  .req-zone .data th, .req-zone .data td { padding: var(--sp-2) var(--sp-3); }
  .req-zone .data thead th { position: sticky; top: 0; z-index: 1; background: var(--card); box-shadow: 0 1px 0 var(--line); }
}
@media (min-width: 900px) and (min-height: 600px) {  /* the window is the frame: only the zone scrolls */
  .req-page { display: flex; flex-direction: column; gap: var(--gap); }
  .req-page > * { margin: 0; }
  .req-page > .req-zone { flex: 1 1 0; min-height: 16rem; }
}

/* ── Removal confirmation: a dialog-sized card in the middle of the window ── */
.confirm { max-width: none; gap: var(--sp-3); }
.restore-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.confirm-items { display: grid; gap: var(--sp-3); }
.confirm-many .confirm-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.confirm-many .confirm-item { padding: var(--sp-3); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-btn); }
.confirm-item > .h3 { margin-bottom: var(--sp-2); }
@media (min-width: 900px) {
  .rm-page { display: flex; flex-direction: column; align-items: center; }
  .rm-page > * { width: min(100%, 44rem); }
  .rm-page > :is(.confirm, .restore-card) { margin-block: auto; }
  .rm-page > .restore-card { width: min(100%, 54rem); }
  .rm-page > .confirm-many { width: min(100%, 72rem); }
}

/* ── Sign-in, first account, restore: a card in the middle of the window, no scrolling if it can fit ── */
.auth, .auth-main { min-height: 100vh; min-height: 100dvh; }
.auth-main { gap: var(--sp-3); padding: var(--sp-4) var(--sp-3); }
.auth-main .foot { margin-top: 0; }
.auth-card { gap: var(--sp-3); padding: var(--sp-4); }
.auth-form { gap: var(--sp-2); }
.auth-form .field { gap: var(--sp-1); }
.auth-form .hint { font-size: var(--fs-xs); }
@media (min-width: 700px) {
  .auth-main:has(.auth-form) { max-width: 54rem; }
  .auth-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--gap); align-items: start; }
  .auth-form > .btn { grid-column: 1 / -1; }
}

/* ── Error (404, 403…): centred in the window ── */
.err-page { display: grid; align-content: safe center; justify-items: center; gap: var(--sp-3); min-height: calc(100dvh - 11rem); text-align: center; }
.err-page .actions { justify-content: center; }
.err-page .err-head .title { font-size: calc(var(--fs-h1) * 1.3); }
@media (min-width: 900px) { .err-page { min-height: 100dvh; } }

/* ── First launch (/bienvenue): the window is the frame; steps and content scroll on their own ── */
.wel-main { padding: var(--pad) var(--pad) var(--sp-5); gap: var(--gap); }
.wel-main .foot { margin-top: auto; padding-top: var(--sp-3); }
.wel-detail form .actions { position: sticky; bottom: 0; z-index: 2; padding-block: var(--sp-2); background: var(--card); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  body.welcome { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
  .wel { min-height: 0; }
  .wel-steps { overflow-y: auto; }
  .wel-steps ol { position: static; }
  .wel-main { flex: 1; min-width: 0; max-width: none; overflow-y: auto; overscroll-behavior: contain; padding: var(--pad); }
}
@media (min-width: 1200px) {
  /* two columns where a card holds a list and a form side by side */
  .wel-main > form.card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--gap); align-items: start; }
  .wel-main > form.card > :is(details, .actions, .field ~ .field) { grid-column: 1 / -1; }
  .wel-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--gap); align-items: start; }
  .wel-detail > h2 { grid-column: 1 / -1; }
}
