/* preprod/v62-modal.css — Skin B modal structure (v6.62.0)
   Sticky header/footer + scrollable body for .v62 containers.
   Designed for the captation media detail view (medias.js renderDetailInline). */

/* --- Structural backbone (legacy inner wrapper, kept for future v62-host use) ---
   NOTE v6.62.0 extended : la règle générique .v62 {display:flex;height:100%;...}
   a été RETIRÉE car .v62 est désormais sur .modal-bg (qui doit rester display:none
   tant que .open n'est pas posé). La structure flex column est portée par
   .v62.cie-fullpage > .modal plus bas dans ce fichier. */
.v62 > .v62-head,
.v62 > .v62-tabs,
.v62 > .v62-foot {
  flex: 0 0 auto;
}

.v62 > .v62-body {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
  padding: 22px 22px 28px;
  background: var(--v62-bg-soft);
}

/* --- Header --- */
.v62 > .v62-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--v62-bd);
  background: var(--v62-bg);
  position: relative;
}
.v62 > .v62-head::after {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -1px;
  width: 40px;
  height: 1px;
  background: var(--v62-acc);
}
.v62-thumb {
  width: 46px;
  height: 46px;
  border-radius: var(--v62-radius);
  background: linear-gradient(135deg, var(--v62-acc), var(--v62-acc-strong));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--v62-font-display);
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}
.v62-title { flex: 1; min-width: 0; }
.v62-title h2 {
  margin: 0 0 3px;
  font-size: 20px;
  line-height: 1.2;
}
.v62-meta {
  color: var(--v62-tx-soft);
  font-size: 13px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.v62-meta b { color: var(--v62-tx); font-weight: 500; }

/* --- Tabs (sticky) --- */
.v62 > .v62-tabs {
  display: flex;
  gap: 0;
  padding: 0 22px;
  background: var(--v62-bg);
  border-bottom: 1px solid var(--v62-bd);
  position: sticky;
  top: 0;
  z-index: 5;
}
.v62-tab {
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--v62-tx-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.v62-tab:hover { color: var(--v62-tx); }
.v62-tab.active {
  color: var(--v62-acc);
  border-bottom-color: var(--v62-acc);
  font-family: var(--v62-font-display);
  font-style: italic;
  font-weight: 500;
}
.v62-count {
  font-size: 10px;
  background: var(--v62-bg-inset);
  color: var(--v62-tx-soft);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}
.v62-tab.active .v62-count {
  background: var(--v62-acc-soft);
  color: var(--v62-acc);
}

/* --- Footer (sticky) --- */
.v62 > .v62-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--v62-bd);
  background: var(--v62-bg);
  box-shadow: 0 -2px 8px rgba(0,0,0,.03);
}
.v62-save-state {
  font-size: 12px;
  color: var(--v62-tx-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.v62-save-state::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v62-ok);
}

/* --- Cards --- */
.v62-card {
  background: var(--v62-bg);
  border: 1px solid var(--v62-bd);
  border-radius: var(--v62-radius);
  padding: 16px 18px;
  box-shadow: var(--v62-shadow-sm);
}
.v62-card-title {
  margin: 0 0 14px;
  font-family: var(--v62-font-display);
  font-style: italic;
  font-weight: 5;
  letter-spacing: 0.02em;
  font-size: 13px;
  color: var(--v62-acc);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Badges / chips --- */
.v62-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--v62-font-display);
  font-style: italic;
  font-size: 12px;
  font-weight: 500;
  background: var(--v62-acc-soft);
  color: var(--v62-acc);
  letter-spacing: 0.02em;
}
.v62-badge.ok {
  background: rgba(77, 124, 15, 0.12);
  color: var(--v62-ok);
}
.v62-badge.warn {
  background: rgba(185, 28, 28, 0.10);
  color: var(--v62-warn);
}
.v62-tag-chip {
  background: var(--v62-bg);
  border: 1px solid var(--v62-bd-strong);
  color: var(--v62-tx-soft);
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}

/* --- Video preview --- */
.v62-preview {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  border-radius: var(--v62-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  max-height: 60vh;
}
.v62-preview video,
.v62-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  max-height: 60vh;
}

/* --- Inputs --- */
.v62 .v62-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 13px;
}
.v62 .v62-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--v62-tx-soft);
}
.v62 .v62-field input,
.v62 .v62-field select,
.v62 .v62-field textarea {
  font: inherit;
  font-size: 14px;
  padding: 8px 11px;
  border: 1px solid var(--v62-bd-strong);
  border-radius: var(--v62-radius-sm);
  background: var(--v62-bg);
  color: var(--v62-tx);
  width: 100%;
}
.v62 .v62-field input:focus,
.v62 .v62-field select:focus,
.v62 .v62-field textarea:focus {
  outline: 2px solid var(--v62-acc);
  outline-offset: -1px;
  border-color: var(--v62-acc);
}
.v62 .v62-field textarea {
  min-height: 74px;
  resize: vertical;
}

/* --- Scrollbar (discreet) --- */
.v62 > .v62-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.v62 > .v62-body::-webkit-scrollbar-track {
  background: transparent;
}
.v62 > .v62-body::-webkit-scrollbar-thumb {
  background: var(--v62-bd-strong);
  border-radius: 99px;
  border: 3px solid var(--v62-bg-soft);
  background-clip: padding-box;
}

/* --- Shoelace tab-group override --- */
.v62 sl-tab-group { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.v62 sl-tab-group::part(nav) {
  position: sticky;
  top: 0;
  background: var(--v62-bg);
  z-index: 5;
  border-bottom: 1px solid var(--v62-bd);
}
.v62 sl-tab-panel { flex: 1; overflow-y: auto; min-height: 0; }

/* === v6.62.0 extended scope — fiche modale page-pleine v62 ============= */
/* Active quand .modal-bg porte .v62 ET .cie-fullpage. Transforme .modal en
   flex column stricte : head + tabs + scrollable tab-content + sticky footer.
   Override les paddings/margins du legacy.css cie-fullpage. */
.v62.cie-fullpage > .modal {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
  background: var(--v62-bg);
}
.v62.cie-fullpage > .modal > .mh,
.v62.cie-fullpage > .modal > .mf-tabs,
.v62.cie-fullpage > .modal > .mfoot {
  flex: 0 0 auto;
}
.v62.cie-fullpage > .modal > .mh {
  padding: 14px 22px 12px !important;
  margin: 0 !important;
  background: var(--v62-bg) !important;
  border-bottom: 1px solid var(--v62-bd) !important;
  position: static !important;
}
.v62.cie-fullpage > .modal > .mh h2 {
  font-family: var(--v62-font-display) !important;
  font-weight: 500 !important;
  font-size: 19px !important;
  color: var(--v62-tx) !important;
  letter-spacing: -0.01em;
}
.v62.cie-fullpage > .modal > .mf-tabs {
  padding: 0 22px !important;
  margin: 0 !important;
  background: var(--v62-bg);
  border-bottom: 1px solid var(--v62-bd) !important;
}
.v62.cie-fullpage > .modal > .mf-tabs .mf-tab {
  color: var(--v62-tx-soft) !important;
  font-family: var(--v62-font) !important;
  font-weight: 500 !important;
  margin-bottom: -1px !important;
}
.v62.cie-fullpage > .modal > .mf-tabs .mf-tab:hover {
  color: var(--v62-tx) !important;
}
.v62.cie-fullpage > .modal > .mf-tabs .mf-tab.on {
  color: var(--v62-acc) !important;
  border-bottom-color: var(--v62-acc) !important;
  font-family: var(--v62-font-display) !important;
  font-style: italic;
}
.v62.cie-fullpage > .modal > .mf-tab-content {
  flex: 1 1 0;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  padding: 18px 22px 24px !important;
  margin: 0 !important;
  background: var(--v62-bg-soft);
}
.v62.cie-fullpage > .modal > .mfoot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 80px 12px 22px !important;  /* 80px right = réserve assistant IA bubble */
  margin: 0 !important;
  border-top: 1px solid var(--v62-bd) !important;
  background: var(--v62-bg);
  box-shadow: 0 -2px 8px rgba(0,0,0,.03);
}
.v62.cie-fullpage > .modal > .mf-tab-content::-webkit-scrollbar { width: 10px; }
.v62.cie-fullpage > .modal > .mf-tab-content::-webkit-scrollbar-thumb {
  background: var(--v62-bd-strong);
  border-radius: 99px;
  border: 3px solid var(--v62-bg-soft);
  background-clip: padding-box;
}

/* === Variante avec .mtabs / .mtab / .mtab-panel (compagnie, contact, user, profile) === */
.v62.cie-fullpage > .modal > .mtabs {
  flex: 0 0 auto;
  display: flex;
  gap: 0;
  padding: 0 22px !important;
  margin: 0 !important;
  background: var(--v62-bg);
  border-bottom: 1px solid var(--v62-bd) !important;
}
.v62.cie-fullpage > .modal > .mtabs .mtab {
  padding: 11px 14px !important;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--v62-tx-soft) !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  cursor: pointer;
  margin-bottom: -1px;
}
.v62.cie-fullpage > .modal > .mtabs .mtab:hover { color: var(--v62-tx) !important; }
.v62.cie-fullpage > .modal > .mtabs .mtab.active {
  color: var(--v62-acc) !important;
  border-bottom-color: var(--v62-acc) !important;
  font-family: var(--v62-font-display) !important;
  font-style: italic;
}
.v62.cie-fullpage > .modal > .mtab-panel {
  flex: 1 1 0;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  padding: 18px 22px 24px !important;
  margin: 0 !important;
  background: var(--v62-bg-soft);
  display: none;
}
.v62.cie-fullpage > .modal > .mtab-panel.active { display: block; }
.v62.cie-fullpage > .modal > .mtab-panel::-webkit-scrollbar { width: 10px; }
.v62.cie-fullpage > .modal > .mtab-panel::-webkit-scrollbar-thumb {
  background: var(--v62-bd-strong);
  border-radius: 99px;
  border: 3px solid var(--v62-bg-soft);
  background-clip: padding-box;
}

/* Cas modale sans tabs (contact simple) : la .fg directe sous .modal devient le body scrollable */
.v62.cie-fullpage > .modal > .fg {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 24px !important;
  margin: 0 !important;
  background: var(--v62-bg-soft);
}

/* === Form fields inside .v62 fiche modale — coherent avec surface ============
   Override legacy backgrounds (blanc fixe) pour que les inputs respectent le
   token --v62-bg (clair en light mode, sombre en dark mode). Sinon en dark mode
   on a des "blocs blancs aveuglants" sur fond sombre.
   Defined boundary via border (--v62-bd-strong) + focus state avec accent ocre. */
.v62.cie-fullpage > .modal input[type="text"],
.v62.cie-fullpage > .modal input[type="email"],
.v62.cie-fullpage > .modal input[type="tel"],
.v62.cie-fullpage > .modal input[type="number"],
.v62.cie-fullpage > .modal input[type="password"],
.v62.cie-fullpage > .modal input[type="search"],
.v62.cie-fullpage > .modal input[type="date"],
.v62.cie-fullpage > .modal input[type="time"],
.v62.cie-fullpage > .modal input[type="url"],
.v62.cie-fullpage > .modal input:not([type]),
.v62.cie-fullpage > .modal select,
.v62.cie-fullpage > .modal textarea {
  background: var(--v62-bg) !important;
  color: var(--v62-tx) !important;
  border: 1px solid var(--v62-bd-strong) !important;
  border-radius: var(--v62-radius-sm) !important;
}
.v62.cie-fullpage > .modal input::placeholder,
.v62.cie-fullpage > .modal textarea::placeholder {
  color: var(--v62-tx-muted) !important;
}
.v62.cie-fullpage > .modal input:focus,
.v62.cie-fullpage > .modal select:focus,
.v62.cie-fullpage > .modal textarea:focus {
  outline: none !important;
  border-color: var(--v62-acc) !important;
  box-shadow: 0 0 0 3px var(--v62-acc-soft) !important;
}

/* Lignes équipe-contacts (.mf-ct-row) — alignement avec surface v62 */
.v62.cie-fullpage > .modal .mf-ct-row {
  background: var(--v62-bg-inset) !important;
  border: 1px solid var(--v62-bd) !important;
  border-radius: var(--v62-radius-sm) !important;
}
.v62.cie-fullpage > .modal .mf-ct-name {
  color: var(--v62-tx) !important;
}
.v62.cie-fullpage > .modal .mf-ct-role {
  background: var(--v62-bg) !important;
  color: var(--v62-tx-soft) !important;
  border: 1px solid var(--v62-bd) !important;
}
.v62.cie-fullpage > .modal .mf-ct-principal {
  background: var(--v62-acc-soft) !important;
  color: var(--v62-acc) !important;
}
.v62.cie-fullpage > .modal .mf-ct-rm {
  color: var(--v62-tx-muted) !important;
}

/* Boutons hbtn (Annuler, + Nouveau contact, etc.) — cohérence skin */
.v62.cie-fullpage > .modal .hbtn,
.v62.cie-fullpage > .modal .sbtn {
  background: var(--v62-bg) !important;
  border: 1px solid var(--v62-bd-strong) !important;
  color: var(--v62-tx) !important;
  border-radius: var(--v62-radius-sm) !important;
}
.v62.cie-fullpage > .modal .hbtn:hover,
.v62.cie-fullpage > .modal .sbtn:hover {
  background: var(--v62-bg-inset) !important;
  border-color: var(--v62-acc) !important;
}
.v62.cie-fullpage > .modal .hbtn.pri,
.v62.cie-fullpage > .modal .btn-primary {
  background: var(--v62-acc) !important;
  color: #fff !important;
  border-color: var(--v62-acc) !important;
  font-weight: 600 !important;
}
.v62.cie-fullpage > .modal .hbtn.pri:hover,
.v62.cie-fullpage > .modal .btn-primary:hover {
  background: var(--v62-acc-strong) !important;
  border-color: var(--v62-acc-strong) !important;
}

/* Labels et titres de section dans le tab content — couleur cohérente avec surface */
.v62.cie-fullpage > .modal label,
.v62.cie-fullpage > .modal .fsec {
  color: var(--v62-tx-soft) !important;
}
.v62.cie-fullpage > .modal .fsec {
  font-family: var(--v62-font) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  margin-top: 18px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--v62-bd);
}
.v62.cie-fullpage > .modal .fsec.first {
  margin-top: 0;
}

/* === Créneaux répétition (.csl.repetition) — contraste forcé (light mode) ==
   Texte mauve foncé sur fond mauve pâle. Bon contraste WCAG AA. */
.v62 .csl.repetition {
  color: #4a2c6e !important;
}
.v62 .csl.repetition .pill,
.v62 .csl.repetition strong {
  color: #4a2c6e !important;
}

/* === Captation detail toolbar (remplace l'ancien wrapper .v62 interne) === */
.v62-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--v62-bd);
  position: sticky;
  top: -18px;
  background: var(--v62-bg-soft);
  z-index: 4;
}
.v62-detail-title {
  font-family: var(--v62-font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--v62-tx);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
