/* FJN System — E1-11 tyre-fitter inspection: list „Do kontroli”, assessment F1…Fn (E1-11a), „Kontrola zakończona”.
   Phone (M) and tablet (T/H 1024 × 768) per ModKontrolaUzup.dc.html (lista, lista-pusta, ocena, ocena-ponowna, D114)
   and ModKontrola.dc.html (felga — the choices, koniec). Choices are radio inputs styled as tiles (no JavaScript needed). */

.fjn-insp { gap: 14px; }
.fjn-insp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fjn-insp__title { font-size: 26px; line-height: 34px; }
.fjn-insp__count { font-size: 14px; color: var(--fjn-text-2); white-space: nowrap; }
.fjn-insp__sub { font-size: 14px; line-height: 20px; color: var(--fjn-text-2); }
.fjn-insp__number { display: block; font: 700 22px/28px var(--fjn-font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Office note (blue box with a sticky note): list card and above the assessment */
.fjn-insp__note-box {
  display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 6px;
  background: var(--fjn-brand-50); color: var(--fjn-text); font-size: 14px; line-height: 20px;
}
.fjn-insp__note-box > .fjn-icon { flex: none; margin-top: 2px; color: var(--fjn-brand-600); }
.fjn-insp__note-box--framed { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--fjn-brand-on-dark-2); }
.fjn-insp__note-box--framed > .fjn-icon { margin-top: 1px; }

/* ---------- List ---------- */
.fjn-insp__list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.fjn-insp__tile {
  font-weight: var(--fjn-fw-regular); display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: 12px; color: var(--fjn-text);
}
.fjn-insp__tile:hover { text-decoration: none; color: var(--fjn-text); border-color: var(--fjn-border-strong); }
.fjn-insp__tile--active { box-shadow: 0 0 0 1px var(--fjn-brand-600); border-color: var(--fjn-brand-600); }
.fjn-insp__tile--again, .fjn-insp__tile--again:hover { box-shadow: 0 0 0 1px var(--fjn-danger-700); border-color: var(--fjn-danger-700); }
.fjn-insp__tile:focus-visible { box-shadow: var(--fjn-focus-btn); }
.fjn-insp__tile-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.fjn-insp__tile .fjn-insp__number { font-size: 18px; line-height: 24px; }
.fjn-insp__set { font-size: 15px; line-height: 20px; }
.fjn-insp__when { font-size: 13px; line-height: 18px; color: var(--fjn-text-2); }
.fjn-insp__state { flex: none; height: 26px; padding: 0 10px; font-size: 13px; border-radius: var(--fjn-r-full); }
.fjn-insp__state .fjn-status__marker { width: 8px; height: 8px; }

.fjn-insp__empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 24px; text-align: center;
  background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: 12px;
}
.fjn-insp__empty-icon {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 14px;
  background: var(--fjn-success-100); color: var(--fjn-success-700);
}
.fjn-insp__empty-title { font-size: 20px; line-height: 26px; }
.fjn-insp__empty-text { max-width: 360px; margin: 0; font-size: 15px; line-height: 22px; color: var(--fjn-text-2); }

/* ---------- Assessment (E1-11a) ---------- */
.fjn-insp--assess { min-height: calc(100vh - var(--fjn-topbar-h)); padding-bottom: 0; }
.fjn-insp__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fjn-insp__meta-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.fjn-insp__meta-main .fjn-insp__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fjn-insp__pos { font: 700 28px/34px var(--fjn-font-mono); }
.fjn-insp__progress { flex: none; white-space: nowrap; }

.fjn-insp__form { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.fjn-insp__card {
  display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 14px 16px;
  background: var(--fjn-surface); border: 1px solid var(--fjn-border); border-radius: 12px; min-width: 0;
}
.fjn-insp__legend { float: left; width: 100%; padding: 0; font-size: 18px; line-height: 24px; font-weight: var(--fjn-fw-bold); }
.fjn-insp__legend + * { clear: both; }
.fjn-insp__degrees { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--fjn-sp-2); }
.fjn-insp__card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fjn-insp__card-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: var(--fjn-fw-bold); }
.fjn-insp__card-count { font: 13px var(--fjn-font-mono); color: var(--fjn-text-2); white-space: nowrap; }

/* Radio tile: the input stays focusable, the <span> is the tile */
.fjn-insp__opt { position: relative; display: block; }
.fjn-insp__opt input, .fjn-insp__file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fjn-insp__opt span {
  height: 64px; display: flex; align-items: center; justify-content: center; padding: 0 var(--fjn-sp-2); text-align: center;
  border-radius: var(--fjn-r-lg); background: var(--fjn-surface); color: var(--fjn-text); border: 1px solid var(--fjn-border-strong);
  font-size: 16px; font-weight: var(--fjn-fw-bold); cursor: pointer;
}
.fjn-insp__opt span:hover { background: var(--fjn-surface-2); }
.fjn-insp__opt input:checked + span { background: var(--fjn-brand-600); color: var(--fjn-text-inverse); border: 2px solid var(--fjn-brand-600); }
.fjn-insp__opt input:focus-visible + span { box-shadow: var(--fjn-focus-btn); }
.fjn-insp__opt--small span { height: 52px; border-radius: 8px; }

.fjn-insp__card--toggles { gap: 0; padding: 6px var(--fjn-sp-4); }
.fjn-insp__toggle { display: flex; align-items: center; gap: 12px; min-height: 64px; margin: 0; padding: 6px 0; border: 0; }
.fjn-insp__toggle + .fjn-insp__toggle { border-top: 1px solid var(--fjn-surface-2); }
.fjn-insp__toggle-label { float: left; flex: 1; padding: 0; font-size: 17px; font-weight: var(--fjn-fw-bold); }
.fjn-insp__yesno { margin-left: auto; display: grid; grid-template-columns: repeat(2, 80px); gap: 6px; }

/* Photos: square thumbnails, 5 columns on the tablet, 3 on the phone; „Dodaj” tile disappears at 6 */
.fjn-insp__photos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--fjn-sp-2); margin: 0; padding: 0; list-style: none; }
.fjn-insp__photo { position: relative; aspect-ratio: 1; min-width: 0; }
.fjn-insp__photo-link { display: block; width: 100%; height: 100%; border-radius: 8px; overflow: hidden; background: var(--fjn-surface-2); }
.fjn-insp__photo-link:focus-visible { box-shadow: var(--fjn-focus-btn); }
.fjn-insp__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fjn-insp__photo-label {
  position: absolute; left: 6px; bottom: 6px; padding: 0 4px; border-radius: 4px; pointer-events: none;
  background: rgba(255, 255, 255, .8); font: 11px/16px var(--fjn-font-mono); color: var(--fjn-text-2);
}
.fjn-insp__photo-del {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; padding: 0; display: flex; align-items: center;
  justify-content: center; border: 0; border-radius: 50%; background: rgba(21, 24, 28, .72); color: #fff; cursor: pointer;
}
.fjn-insp__photo-del:focus-visible { box-shadow: var(--fjn-focus-btn); }
.fjn-insp__add {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--fjn-border-strong); border-radius: 8px; color: var(--fjn-brand-600);
  font-size: 12px; font-weight: var(--fjn-fw-bold); cursor: pointer;
}
.fjn-insp__add:hover { background: var(--fjn-surface-2); }
.fjn-insp__add:focus-within { box-shadow: var(--fjn-focus-btn); }
.fjn-insp__hint { font-size: 12px; line-height: 17px; color: var(--fjn-text-2); }

.fjn-insp__remarks { gap: 8px; }
.fjn-insp__remarks .fjn-insp__card-title { font-size: 15px; white-space: nowrap; }
.fjn-insp__remarks .fjn-textarea { min-height: 88px; font-size: 16px; line-height: 22px; }

.fjn-insp__bar {
  position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; margin: auto calc(-1 * var(--fjn-sp-8)) 0;
  padding: 12px var(--fjn-sp-6); background: var(--fjn-surface); border-top: 1px solid var(--fjn-border);
}
.fjn-insp__bar .fjn-btn { height: 56px; border-radius: 8px; font-size: 17px; }
.fjn-insp__back { flex: 1; }
.fjn-insp__next { flex: 2; }

/* ---------- Finished ---------- */
.fjn-insp--done { min-height: calc(100vh - var(--fjn-topbar-h)); justify-content: center; }
.fjn-insp__end { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: var(--fjn-sp-4); text-align: center; }
.fjn-insp__end-icon { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--fjn-success-100); color: var(--fjn-success-700); }
.fjn-insp__end-title { font-size: 26px; line-height: 32px; }
.fjn-insp__end-text { max-width: 420px; margin: 0; font-size: 17px; line-height: 25px; color: var(--fjn-text-2); }
.fjn-insp__end-btn { width: 100%; max-width: 420px; height: 64px; margin-top: var(--fjn-sp-2); border-radius: var(--fjn-r-lg); font-size: 18px; }

@media (max-width: 1279px) {
  .fjn-insp__bar { margin-left: calc(-1 * var(--fjn-sp-6)); margin-right: calc(-1 * var(--fjn-sp-6)); }
}
@media (max-width: 767px) {
  .fjn-insp { gap: 12px; }
  .fjn-insp__title { font-size: 22px; line-height: 30px; }
  .fjn-insp__degrees { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fjn-insp__photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fjn-insp--assess, .fjn-insp--done { min-height: calc(100vh - var(--fjn-topbar-h-m) - var(--fjn-bottomnav-h)); }
  .fjn-insp__bar {
    bottom: var(--fjn-bottomnav-h); padding: 12px var(--fjn-sp-4);
    margin-left: calc(-1 * var(--fjn-sp-4)); margin-right: calc(-1 * var(--fjn-sp-4));
  }
}
