/* Dowin — fiches de révision (1.167.0).
 *
 * Mobile d'abord : la fenêtre tient sur 369 px, les cibles tactiles font au
 * moins 40 px et les notes de session forment une grille de deux colonnes.
 * Les couleurs viennent de app.css (variables --green, --panel, --border…) et
 * suivent donc le thème clair, le thème sombre et la couleur d'accent.
 */

.fiches .modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/*
 * Les blocs ci-dessous posent `display: flex` : sans cette règle, l'attribut
 * natif `hidden` serait neutralisé par la feuille de style et les blocs
 * masqués resteraient visibles.
 */
.fiches [hidden] {
  display: none !important;
}

.fiches .modal__body > * {
  flex: none;
}

/* ------------------------------- Fenêtre --------------------------------- */

.fiches__entete {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fiches__stats {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-meta);
  overflow-wrap: anywhere;
}

.fiches__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fiches__actions .btn {
  min-height: 40px;
}

.fiches__liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fiches__vide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.fiches__vide p {
  margin: 0;
}

.fiches__vide svg {
  width: 26px;
  height: 26px;
  color: var(--text-faint);
}

/* --------------------------------- Fiche --------------------------------- */

.fiche {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}

.fiche__question {
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fiche__reponse {
  grid-column: 1 / -1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fiche__echeance {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--text-meta);
  font-variant-numeric: tabular-nums;
}

.fiche__supprimer {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -6px -6px 0 0;
  border-radius: 50%;
  color: var(--text-meta);
}

.fiche__supprimer:hover {
  background: var(--hover);
  color: var(--danger-text);
}

.fiche__supprimer:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fiche__supprimer svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------- Formulaire ------------------------------ */

.fiches__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}

.fiches__champs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fiches__form .modal__label {
  font-size: 12.5px;
}

.fiches__question {
  min-height: 62px;
  resize: vertical;
}

.fiches__reponse {
  min-height: 92px;
  resize: vertical;
}

.fiches__enregistrer {
  width: 100%;
  min-height: 40px;
}

/* ------------------------------- Session --------------------------------- */

.fiche-session {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fiche-session__progression {
  font-size: 12px;
  color: var(--text-meta);
  font-variant-numeric: tabular-nums;
}

.fiche-session__question {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fiche-session__reveler {
  min-height: 44px;
}

.fiche-session__reponse {
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--green) 8%, var(--panel-2));
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fiche-session__notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fiche-session__note {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.fiche-session__note:hover {
  filter: brightness(0.97);
}

.fiche-session__note:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fiche-session__note[data-note='encore'] {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-2));
}

.fiche-session__note[data-note='difficile'] {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--border));
  background: color-mix(in srgb, var(--warn) 12%, var(--panel-2));
}

.fiche-session__note[data-note='bien'] {
  border-color: color-mix(in srgb, var(--green) 35%, var(--border));
  background: color-mix(in srgb, var(--green) 10%, var(--panel-2));
}

.fiche-session__note[data-note='facile'] {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 18%, var(--panel-2));
}

.fiche-session__fin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 12px;
  text-align: center;
}

.fiche-session__fin svg {
  width: 30px;
  height: 30px;
  color: var(--green);
}

.fiche-session__fin p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.fiche-session__fin .btn {
  min-height: 40px;
}

/* ------------------------------ Grand écran ------------------------------ */

@media (min-width: 520px) {
  .fiches__entete {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .fiches__actions {
    flex: none;
  }

  .fiches__enregistrer {
    width: auto;
    align-self: flex-start;
  }

  .fiche-session__notes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .fiche__question {
    font-size: 13px;
  }

  .fiche-session__note {
    font-size: 12px;
  }
}
