/* accidents.css — « Accidents et sinistres »: list, detail, edit, the driver's declaration and the printed report. */

/* ---- List ---------------------------------------------------------------- */
.acc-place { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---- Claim progress strip ------------------------------------------------- */
.acc-steps { list-style: none; margin: 0 0 var(--s-4); padding: 12px 14px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.acc-steps__s { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.acc-steps__s::before { content: ""; position: absolute; top: 12px; right: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.acc-steps__s:first-child::before { display: none; }
.acc-steps__s.is-done::before, .acc-steps__s.is-on::before { background: var(--accent); }
.acc-steps__dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: var(--fw-semi); background: var(--surface-inset); color: var(--muted); border: 2px solid var(--border); }
.acc-steps__s.is-done .acc-steps__dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.acc-steps__s.is-on .acc-steps__dot { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.acc-steps__l { font-size: var(--fs-xs); color: var(--muted); line-height: 1.25; overflow-wrap: anywhere; }
.acc-steps__s.is-on .acc-steps__l { color: var(--ink); font-weight: var(--fw-semi); }

/* ---- Detail --------------------------------------------------------------- */
.acc-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.acc-facts > div { min-width: 0; font-size: var(--fs-md); overflow-wrap: anywhere; }
.acc-facts b { display: block; font-size: var(--fs-xs); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
.acc-facts__wide { grid-column: span 2; }
.acc-desc { margin: var(--s-4) 0 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-inset); border-radius: 0 var(--r-md) var(--r-md) 0; white-space: pre-wrap; line-height: 1.5; }
.acc-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.acc-money { margin-top: var(--s-3); padding-top: var(--s-2); border-top: 1px solid var(--border-subtle); }
.acc-money > .row:last-child { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px !important; }

.tl__dot[data-tone="purple"] { background: var(--purple-soft); color: var(--purple); }

.acc-tasks { list-style: none; margin: 0; padding: 0; }
.acc-task { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--border-subtle); }
.acc-task .check { align-items: flex-start; }
.acc-task .check span { overflow-wrap: anywhere; }
.acc-task.is-done .check span { color: var(--muted); text-decoration: line-through; }
.acc-task__due { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.acc-task.is-late .acc-task__due { color: var(--danger); font-weight: var(--fw-semi); }
.acc-addtask { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 6px; padding: 10px 12px; }

/* ---- Edit ----------------------------------------------------------------- */
.acc-edit > .card { margin-bottom: var(--s-4); }
.acc-rep { display: grid; gap: 10px; }
.acc-rep:empty::before { content: "—"; color: var(--faint); }
.acc-rep__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-inset); }
.acc-rep__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.acc-rep__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acc-rep__grid .field { margin: 0; }
.acc-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--border); }

/* ---- The driver's declaration -------------------------------------------- */
.acc-declare { max-width: 640px; margin: 0 auto; }
.acc-declare .card { margin-bottom: var(--s-3); }
.acc-declare .alert { margin-bottom: var(--s-3); }
.acc-declare .field { margin-bottom: var(--s-3); }
.acc-declare__two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.acc-declare__where { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.acc-declare__other { margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px dashed var(--border); }
.acc-declare__cam { min-height: 56px; font-size: var(--fs-lg); border-style: dashed; }
.acc-declare__send { min-height: 56px; font-size: var(--fs-lg); margin: var(--s-2) 0 var(--s-3); }
.acc-declare__broker { text-align: center; }
.acc-declare .input, .acc-declare .select, .acc-declare .textarea { font-size: 16px; } /* no zoom on iOS */

.acc-yn { border: 0; margin: 0 0 var(--s-3); padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acc-yn__l { float: left; padding: 0; font-weight: var(--fw-semi); font-size: var(--fs-md); }
.acc-yn__opts { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; }
.acc-yn__opts label { position: relative; cursor: pointer; }
.acc-yn__opts input { position: absolute; opacity: 0; pointer-events: none; }
.acc-yn__opts span { display: block; min-width: 72px; padding: 10px 16px; text-align: center; font-weight: var(--fw-semi); color: var(--muted); background: var(--surface); }
.acc-yn__opts label + label span { border-left: 1px solid var(--border-strong); }
.acc-yn__opts input:checked + span { background: var(--accent); color: #fff; }
.acc-yn__opts input[value="yes"]:checked + span { background: var(--warning); color: #fff; }
.acc-yn__opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }

.acc-done { text-align: center; padding: var(--s-6) var(--s-4) var(--s-4); }
.acc-done__icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.acc-done__title { font-size: var(--fs-2xl); margin: 0; }
.acc-done__no { font-size: var(--fs-lg); font-weight: var(--fw-semi); margin: 6px 0; }
.acc-done__actions { display: grid; gap: 8px; margin-top: var(--s-3); }
.acc-next { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.45; }

/* ---- Printed report (screen preview + paper) ----------------------------- */
.accdoc__wide { grid-column: span 2; }
.accdoc__desc { white-space: pre-wrap; line-height: 1.5; margin: 0; }
.accdoc__photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3mm; }
.accdoc__photos figure { margin: 0; break-inside: avoid; }
.accdoc__photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #ccc; display: block; }
.accdoc__photos figcaption { font-size: 8pt; color: #444; margin-top: 1mm; }
@media print {
  .printdoc table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .printdoc th, .printdoc td { border-bottom: 1px solid #ccc; padding: 1.5mm 2mm; text-align: left; }
  .acc-steps, .acc-savebar { display: none !important; }
}

/* ---- Narrow screens -------------------------------------------------------- */
@media (max-width: 900px) {
  .acc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-rep__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .acc-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .acc-steps__s:nth-child(4)::before { display: none; }
  .acc-facts { grid-template-columns: minmax(0, 1fr); }
  .acc-facts__wide { grid-column: auto; }
  .acc-rep__grid, .acc-rep__grid--2 { grid-template-columns: minmax(0, 1fr); }
  .acc-addtask { grid-template-columns: minmax(0, 1fr) auto; }
  .acc-addtask input[type="date"] { grid-column: 1; }
  .acc-place { max-width: 160px; }
  .accdoc__photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accdoc__wide { grid-column: auto; }
}
