/* ═══════════════════════════════════════════════════════════════════════════
   app.css — COUCHE PARTAGÉE ADMIN + PUBLIC (espace marié)
   ───────────────────────────────────────────────────────────────────────────
   Chargée AVANT admin.css et public.css dans les deux bases. Contient ce qui
   est commun aux deux interfaces : tokens de marque + composants transverses.
   Premier composant : la modale média (bibliothèque centrale d'un mariage,
   partagée par l'admin et l'espace marié). Mobile-first.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --tch-primary: #1E2A5A;
  --tch-primary-hover: #16204A;
  --tch-secondary: #1F7A5C;
  --tch-accent: #C6A15B;
  --tch-accent-hover: #A8843D;
  --tch-bg: #FFF7EA;
  --tch-surface: #FFFFFF;
  --tch-text: #111827;
  --tch-text-muted: #6b7280;
  --tch-border: #E5E7EB;
  --tch-error: #DC2626;

  --tf-radius: 14px;
  --tf-radius-sm: 10px;
  --tf-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  --tf-z-modal: 1080;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALE MÉDIA — .tf-media
   ═══════════════════════════════════════════════════════════════════════════ */
.tf-media {
  position: fixed;
  inset: 0;
  z-index: var(--tf-z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tf-media[hidden] { display: none; }

.tf-media__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.tf-media__dialog {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--tch-surface);
  border-radius: var(--tf-radius) var(--tf-radius) 0 0;
  box-shadow: var(--tf-shadow);
  overflow: hidden;
  animation: tf-media-rise 0.24s ease;
}

@keyframes tf-media-rise {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.tf-media__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--tch-border);
}
.tf-media__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tch-primary);
}
.tf-media__close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--tch-bg);
  color: var(--tch-text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.tf-media__close:hover { background: var(--tch-border); }

.tf-media__tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px 0;
}
.tf-media__tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tch-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.tf-media__tab.is-active {
  color: var(--tch-primary);
  border-bottom-color: var(--tch-accent);
}

.tf-media__panel {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px;
}
.tf-media__panel[hidden] { display: none; }

/* ── Barre d'outils (recherche + filtres) ─────────────────────────────────── */
.tf-media__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.tf-media__search {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--tch-border);
  border-radius: var(--tf-radius-sm);
  background: var(--tch-bg);
  color: var(--tch-text-muted);
}
.tf-media__search-input {
  flex: 1 1 auto;
  min-height: 42px;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  color: var(--tch-text);
  outline: none;
}
.tf-media__filters { display: inline-flex; gap: 4px; }
.tf-media__filter {
  padding: 8px 14px;
  border: 1px solid var(--tch-border);
  border-radius: 999px;
  background: var(--tch-surface);
  color: var(--tch-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.tf-media__filter.is-active {
  background: var(--tch-primary);
  border-color: var(--tch-primary);
  color: #fff;
}

/* ── Grille de vignettes ──────────────────────────────────────────────────── */
.tf-media__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.tf-media__item {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: var(--tf-radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--tch-bg);
}
.tf-media__item img,
.tf-media__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tf-media__item.is-selected {
  border-color: var(--tch-accent);
  box-shadow: 0 0 0 2px var(--tch-accent);
}
.tf-media__item-check {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tch-accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.tf-media__item.is-selected .tf-media__item-check { display: flex; }
.tf-media__item-type {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  font-size: 0.62rem;
}
.tf-media__item-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tf-media__item-edit {
  position: absolute;
  top: 6px;
  right: 34px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tf-media__item:hover .tf-media__item-del,
.tf-media__item:focus-within .tf-media__item-del,
.tf-media__item:hover .tf-media__item-edit,
.tf-media__item:focus-within .tf-media__item-edit { opacity: 1; }

/* ── Panneau détail (description alt + légende) ────────────────────────────── */
.tf-media__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--tch-primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.tf-media__detail-preview {
  max-width: 320px;
  margin: 0 auto 16px;
  border-radius: var(--tf-radius-sm);
  overflow: hidden;
  background: var(--tch-bg);
}
.tf-media__detail-preview img { width: 100%; height: auto; display: block; }
.tf-media__detail-form { display: flex; flex-direction: column; gap: 16px; }
.tf-media__detail-field { display: flex; flex-direction: column; gap: 4px; }
.tf-media__detail-label { font-weight: 600; color: var(--tch-text); font-size: 0.92rem; }
.tf-media__detail-help { font-size: 0.78rem; color: var(--tch-text-muted); }
.tf-media__detail-input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--tch-border);
  border-radius: var(--tf-radius-sm);
  font-size: 0.95rem;
  color: var(--tch-text);
  background: var(--tch-surface);
}
.tf-media__detail-input:focus {
  outline: none;
  border-color: var(--tch-accent);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.18);
}

.tf-media__empty,
.tf-media__loading {
  margin: 24px 0;
  text-align: center;
  color: var(--tch-text-muted);
  font-size: 0.9rem;
}

/* ── Zone d'upload ────────────────────────────────────────────────────────── */
.tf-media__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 18px;
  border: 2px dashed var(--tch-border);
  border-radius: var(--tf-radius);
  background: var(--tch-bg);
  text-align: center;
  cursor: pointer;
  outline: none;
}
.tf-media__dropzone.is-dragover {
  border-color: var(--tch-accent);
  background: #fff;
}
.tf-media__dropzone-icon { font-size: 2rem; color: var(--tch-accent); }
.tf-media__dropzone-text { margin: 0; color: var(--tch-text); }
.tf-media__dropzone-hint { margin: 0; font-size: 0.8rem; color: var(--tch-text-muted); }

.tf-media__queue { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf-media__queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--tch-border);
  border-radius: var(--tf-radius-sm);
  font-size: 0.85rem;
}
.tf-media__queue-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-media__queue-state { flex: 0 0 auto; color: var(--tch-text-muted); }
.tf-media__queue-item.is-done .tf-media__queue-state { color: var(--tch-secondary); }
.tf-media__queue-item.is-error .tf-media__queue-state { color: var(--tch-error); }
.tf-media__bar { flex: 0 0 80px; height: 6px; border-radius: 3px; background: var(--tch-border); overflow: hidden; }
.tf-media__bar-fill { height: 100%; width: 0; background: var(--tch-accent); transition: width 0.2s ease; }

/* ── Pied (compteur + actions) ────────────────────────────────────────────── */
.tf-media__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--tch-border);
  background: var(--tch-surface);
}
.tf-media__count { font-size: 0.82rem; color: var(--tch-text-muted); }
.tf-media__actions { display: inline-flex; gap: 8px; }
.tf-media__btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--tf-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.tf-media__btn--ghost {
  background: transparent;
  border-color: var(--tch-border);
  color: var(--tch-text);
}
.tf-media__btn--primary {
  background: var(--tch-primary);
  color: #fff;
}
.tf-media__btn--primary:hover { background: var(--tch-primary-hover); }
.tf-media__btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Desktop : la modale se centre au lieu de coller au bas ───────────────── */
@media (min-width: 640px) {
  .tf-media { align-items: center; }
  .tf-media__dialog { border-radius: var(--tf-radius); }
  .tf-media__grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .tf-media__dialog { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMULAIRES PARTAGÉS — .tf-form*
   ───────────────────────────────────────────────────────────────────────────
   Système de composants de formulaire AUTONOME (sans dépendance Bootstrap),
   calqué sur la page d'édition mariage admin. Chargé des deux côtés (app.css).
   Destiné à devenir la base unique des formulaires admin ET espace marié, pour
   un rendu cohérent. Migration des templates admin = étape suivante (à vérifier
   au navigateur, page par page). Tokens --tch-* / --tf-*. Mobile-first.
   ═══════════════════════════════════════════════════════════════════════════ */
.tf-form { display: flex; flex-direction: column; gap: clamp(1rem, 3vw, 1.5rem); }

/* ── Section : carte avec en-tête à icône ─────────────────────────────────── */
.tf-form-section {
  padding: clamp(1rem, 3.5vw, 1.5rem);
  border: 1px solid var(--tch-border);
  border-radius: var(--tf-radius);
  background: var(--tch-surface);
}
.tf-form-section__header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--tch-border);
}
.tf-form-section__icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(198, 161, 91, 0.14); color: var(--tch-accent); font-size: 1.05rem;
}
.tf-form-section__title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--tch-primary); }

/* ── Champ : label + contrôle + aide ──────────────────────────────────────── */
.tf-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.tf-field:last-child { margin-bottom: 0; }
.tf-field__label { font-weight: 600; font-size: 0.92rem; color: var(--tch-text); }
.tf-field__hint { font-size: 0.78rem; color: var(--tch-text-muted); }
.tf-control {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--tch-border); border-radius: var(--tf-radius-sm);
  background: var(--tch-surface); color: var(--tch-text); font-size: 1rem; line-height: 1.4;
}
textarea.tf-control { min-height: 96px; resize: vertical; }
.tf-control:focus {
  outline: none; border-color: var(--tch-accent);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.18);
}
.tf-field--row { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ── Bascule (toggle) : icône + texte + interrupteur ──────────────────────── */
.tf-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--tch-border); border-radius: var(--tf-radius-sm);
  background: var(--tch-bg);
}
.tf-toggle__icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tch-surface); color: var(--tch-primary);
}
.tf-toggle__text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.tf-toggle__title { font-weight: 600; color: var(--tch-text); }
.tf-toggle__help { font-size: 0.78rem; color: var(--tch-text-muted); }

/* ── Barre d'actions ──────────────────────────────────────────────────────── */
.tf-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
  margin-top: 4px;
}
.tf-btn {
  min-height: 48px; padding: 0 22px; border: 1px solid transparent;
  border-radius: var(--tf-radius-sm); font-weight: 600; font-size: 0.95rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.tf-btn--ghost { background: transparent; border-color: var(--tch-border); color: var(--tch-text); }
.tf-btn--ghost:hover { background: var(--tch-bg); }
.tf-btn--primary { background: var(--tch-primary); color: #fff; }
.tf-btn--primary:hover { background: var(--tch-primary-hover); }
.tf-btn:disabled { opacity: 0.55; cursor: not-allowed; }

@media (min-width: 640px) {
  .tf-field--row { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXTENSIONS DU SOCLE tf-form-* — couvre tous les champs de l'espace couple
   (dates, select, couleur, range, upload, cases, listes, en-tête de page).
   Tokens --tch-* / --tf-* uniquement → réutilisable côté admin.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Contrôles natifs harmonisés sur .tf-control ──────────────────────────── */
input[type="date"].tf-control,
input[type="datetime-local"].tf-control,
input[type="time"].tf-control,
input[type="number"].tf-control,
input[type="tel"].tf-control,
input[type="email"].tf-control,
input[type="url"].tf-control { appearance: none; -webkit-appearance: none; font-family: inherit; }
input[type="date"].tf-control,
input[type="datetime-local"].tf-control,
input[type="time"].tf-control { min-height: 48px; }
input[type="date"].tf-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].tf-control::-webkit-calendar-picker-indicator,
input[type="time"].tf-control::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.7; }
input[type="date"].tf-control:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"].tf-control:hover::-webkit-calendar-picker-indicator { opacity: 1; }
select.tf-control {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6b7b' d='M6 8 0 1.4 1.4 0 6 4.6 10.6 0 12 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ── Champ : badge facultatif, pleine largeur ─────────────────────────────── */
.tf-field__optional { font-size: 0.75rem; font-weight: 400; color: var(--tch-text-muted); }
.tf-field--full { grid-column: 1 / -1; }

/* ── Couleur : pastille carrée ────────────────────────────────────────────── */
.tf-control--color { width: 56px; min-height: 48px; padding: 5px; cursor: pointer; }
.tf-control--color::-webkit-color-swatch-wrapper { padding: 0; }
.tf-control--color::-webkit-color-swatch { border: none; border-radius: 6px; }

/* ── Curseur (range) ──────────────────────────────────────────────────────── */
.tf-range {
  appearance: none; -webkit-appearance: none; width: 100%; height: 6px;
  border-radius: 999px; background: var(--tch-border); cursor: pointer;
}
.tf-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--tch-accent); border: 2px solid var(--tch-surface); box-shadow: 0 1px 4px rgba(30, 42, 90, 0.3);
}
.tf-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--tch-surface); background: var(--tch-accent);
}

/* ── Bascule oui/non (interrupteur) — rendu de f.checkbox ──────────────────── */
.tf-checkbox {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--tch-border); border-radius: var(--tf-radius-sm);
  background: var(--tch-bg); cursor: pointer;
}
.tf-checkbox__text { flex: 1 1 auto; font-size: 0.92rem; color: var(--tch-text); line-height: 1.4; }
.tf-switch {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 0;
  width: 46px; height: 28px; border-radius: 999px; background: var(--tch-border);
  position: relative; cursor: pointer; transition: background 0.2s ease;
}
.tf-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.tf-switch:checked { background: var(--tch-accent); }
.tf-switch:checked::after { transform: translateX(18px); }
.tf-switch:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.3); }
@media (prefers-reduced-motion: reduce) {
  .tf-switch, .tf-switch::after { transition: none; }
}

/* ── Emplacements média (remplace .cw-photo__*) ───────────────────────────── */
.tf-upload__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tf-upload {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border: 1px solid var(--tch-border); border-radius: var(--tf-radius); background: var(--tch-surface);
}
.tf-upload__remove { margin: 0; }

/* Zone glisser-déposer (clic ou drop) — rendu « Glissez ou cliquez » de l'admin. */
.tf-dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 150px; padding: 18px; cursor: pointer; text-align: center;
  border: 2px dashed var(--tch-border); border-radius: var(--tf-radius);
  background: var(--tch-bg); color: var(--tch-text-muted);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.tf-dropzone:hover, .tf-dropzone.is-dragover {
  border-color: var(--tch-accent); background: color-mix(in srgb, var(--tch-accent) 8%, var(--tch-bg));
}
.tf-dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tf-dropzone__preview { max-width: 120px; max-height: 120px; border-radius: 10px; object-fit: cover; box-shadow: var(--tf-shadow); }
.tf-dropzone__cue { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.9rem; }
.tf-dropzone__cue i { font-size: 1.6rem; color: var(--tch-accent); }

/* Utilitaire : masquer (panneaux d'onglets, etc.). */
.tf-hidden { display: none !important; }
.tf-upload__preview {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: var(--tf-radius-sm); overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--tch-bg); border: 1px solid var(--tch-border);
}
.tf-upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.tf-upload__preview--empty { color: var(--tch-text-muted); font-size: 1.4rem; }
.tf-upload__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tf-upload__label { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--tch-primary); }
.tf-upload__hint { margin: 0; font-size: 0.78rem; color: var(--tch-text-muted); line-height: 1.4; }
.tf-upload__file { font-size: 0.85rem; color: var(--tch-text); max-width: 100%; }
.tf-upload__file::file-selector-button {
  margin-right: 10px; padding: 8px 14px; border: 1px solid var(--tch-border); border-radius: var(--tf-radius-sm);
  background: var(--tch-bg); color: var(--tch-text); font-weight: 600; cursor: pointer;
}
.tf-upload__body form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
@media (max-width: 420px) { .tf-upload { flex-wrap: wrap; } }

/* ── État vide encourageant (remplace .cw-prog__empty) ────────────────────── */
.tf-empty {
  text-align: center; padding: clamp(1.4rem, 5vw, 2.2rem) 1.2rem;
  border: 1px dashed var(--tch-border); border-radius: var(--tf-radius); background: var(--tch-bg);
}
.tf-empty__icon { font-size: 1.8rem; color: var(--tch-accent); margin-bottom: 8px; }
.tf-empty__text { margin: 0; color: var(--tch-text-muted); font-size: 0.92rem; line-height: 1.5; }

/* ── Replis <details> (Modifier / Retirer / Ajouter) ──────────────────────── */
.tf-fold { border-top: 1px solid var(--tch-border); margin-top: 12px; }
.tf-fold__btn {
  cursor: pointer; list-style: none; padding: 10px 0; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.9rem; color: var(--tch-primary);
}
.tf-fold--danger .tf-fold__btn { color: var(--tch-error); }
.tf-add { border: 1px dashed var(--tch-border); border-radius: var(--tf-radius); padding: 0 14px; }
.tf-add__btn {
  cursor: pointer; list-style: none; padding: 12px 0; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.9rem; color: var(--tch-accent);
}
.tf-fold__btn::-webkit-details-marker, .tf-add__btn::-webkit-details-marker { display: none; }

/* ── Confirmation suppression ─────────────────────────────────────────────── */
.tf-confirm { font-size: 0.85rem; color: var(--tch-text-muted); margin: 6px 0 10px; }
.tf-del-btn {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--tch-error); border-radius: var(--tf-radius-sm);
  background: transparent; color: var(--tch-error); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.tf-del-btn:hover { background: var(--tch-error); color: #fff; }

/* ── Ligne couleur (remplace .cw-amb__color-*) ────────────────────────────── */
.tf-color-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--tch-border);
}
.tf-color-row:last-child { border-bottom: 0; }
.tf-color-row > .tf-control { flex: 1 1 140px; min-width: 0; }
.tf-color-row > .tf-control--color { flex: 0 0 auto; }

/* ── Lignes répétables génériques (TchefonForms) ──────────────────────────── */
.tf-repeat__add {
  min-height: 44px; padding: 0 16px; border: 1px dashed var(--tch-border); border-radius: var(--tf-radius-sm);
  background: var(--tch-bg); color: var(--tch-primary); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.tf-repeat__remove { border: 0; background: transparent; color: var(--tch-error); cursor: pointer; font-size: 1rem; padding: 6px; }

/* ── Carte d'une activité répétable (programme : admin + espace couple) ────── */
.tf-repeat-card {
  border: 1px solid var(--tch-border); border-radius: var(--tf-radius);
  padding: clamp(0.85rem, 3vw, 1.25rem); background: var(--tch-bg);
}
.tf-repeat-card + .tf-repeat-card { margin-top: 12px; }
.tf-repeat-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--tch-border);
}
.tf-repeat-card__num {
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--tch-text-muted);
}
.tf-repeat-card__remove {
  width: 32px; height: 32px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(220, 38, 38, 0.1); color: var(--tch-error);
  display: inline-flex; align-items: center; justify-content: center;
}
.tf-repeat-card__remove:hover { background: var(--tch-error); color: #fff; }

/* ── En-tête de page éditeur (remplace client-detail__header + onboarding-back) */
.tf-page { margin-bottom: clamp(1rem, 3vw, 1.5rem); }
.tf-page__back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 8px 14px;
  border-radius: 999px; background: var(--tch-surface); border: 1px solid var(--tch-border);
  color: var(--tch-text); text-decoration: none; font-size: 0.85rem; font-weight: 600;
}
.tf-page__back:hover { color: var(--tch-primary); }
.tf-page__title { margin: 0; font-size: 1.9rem; font-weight: 700; color: var(--tch-primary); line-height: 1.1; }
.tf-page__lede { margin: 8px 0 0; color: var(--tch-text-muted); font-size: 0.95rem; line-height: 1.55; max-width: 60ch; }

/* ── Loader au submit (module TchefonForms, opt-in) ───────────────────────── */
.tf-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.tf-btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: tf-spin 0.6s linear infinite;
}
.tf-btn--ghost.is-loading::after { border-color: rgba(30, 42, 90, 0.3); border-top-color: var(--tch-primary); }
@keyframes tf-spin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .tf-upload__grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tf-btn.is-loading::after { animation: none; }
}
