/* ui.css — concurrence, groupes, documents, FAB, finalisation, écrans, a11y */

/* === Compteur groupe === */
.group-counter {
  font-size: 13px;
  color: var(--on-surface-soft);
  margin: var(--sp-1) 0;
}

/* === Toggle groupe === */
.group-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  min-height: 44px;
}

.group-toggle-icon {
  font-size: 13px;
  color: var(--on-surface-soft);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.group-toggle-btn[aria-expanded="true"] .group-toggle-icon { transform: rotate(90deg); }
.group-body[hidden] { display: none; }

/* === Bloc concurrence === */
.concurrence-bloc {
  background: var(--surface-alt);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin: var(--sp-3) 0;
}

.concurrence-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-soft);
  background: var(--surface);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.radio-option:has(input[type="radio"]:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.radio-label   { flex: 1; cursor: pointer; line-height: 1.4; }
.radio-ent     { font-weight: 500; font-size: 14px; color: var(--on-surface); }
.radio-montant { font-size: 13px; color: var(--on-surface-soft); }
.radio-aucune  { font-size: 14px; font-weight: 500; color: var(--error); }

/* === Documents === */
.section-docs { margin: var(--sp-5) 0 var(--sp-4); }

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-surface-soft);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--outline-soft);
}

.doc-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--on-surface);
  margin-bottom: var(--sp-2);
  min-height: 52px;
  box-shadow: var(--shadow-1);
  transition: background 120ms ease, border-color 120ms ease;
}

.doc-link:hover         { background: var(--surface-hover); border-color: var(--outline); text-decoration: none; }
.doc-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.doc-icon  { font-size: 20px; flex-shrink: 0; }
.doc-title { font-weight: 500; font-size: 14px; color: var(--on-surface); }
.doc-size  { font-size: 12px; color: var(--on-surface-soft); margin-top: 2px; }

/* === FAB — bouton flottant bas-droite === */
.fab {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-3);
  z-index: 200;
  min-height: 52px;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.fab:hover         { background: var(--primary-hover); box-shadow: var(--shadow-4); }
.fab:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.fab[hidden]       { display: none; }

/* === Section finalisation === */
#complete-section { margin-top: var(--sp-5); }

.btn-complete {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  min-height: 52px;
  box-shadow: var(--shadow-2);
  transition: background 120ms ease, box-shadow 120ms ease;
}

.btn-complete:hover         { background: var(--primary-hover); box-shadow: var(--shadow-3); }
.btn-complete:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.btn-complete:disabled      { opacity: 0.5; cursor: not-allowed; }

.completed-badge {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: center;
  padding: var(--sp-4);
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-soft);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--shadow-1);
}

/* === Écrans d'état (erreur / chargement) === */
.screen-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: var(--sp-6);
  text-align: center;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-md);
  margin: var(--sp-4);
  box-shadow: var(--shadow-1);
}

.screen-error h2 { font-size: 20px; font-weight: 500; color: var(--on-surface); }
.screen-error p  { color: var(--on-surface-soft); font-size: 15px; max-width: 40ch; }

.loading {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--on-surface-soft);
  font-size: 15px;
}

/* === Responsive / zoom 200% === */
@media (min-width: 720px) {
  .main-content { padding: var(--sp-5); }
}

@media (max-width: 480px) {
  .fab {
    right: var(--sp-3);
    bottom: var(--sp-4);
    font-size: 13px;
    padding: var(--sp-2) var(--sp-3);
  }
}
