/* ART CONSTRUCTION - hub /outils/ : packs telechargeables (interrupteur « Outils / Modeles & Dossiers », bloc de l'Etage 2, modale de telechargement).
   Tout est prefixe .ot- ; les variables (--ot-*) viennent de outils.css. */

/* ------------------------------------------------------------------ interrupteur (menu de gauche, sous la recherche) */
.ot-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 16px 0; padding: 4px; border: 1px solid var(--ot-bord); border-radius: 12px; background: #F1F5F9; }
.ot-mode-btn { min-width: 0; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--ot-sec); font: 600 12.5px/1.25 inherit; font-family: inherit; text-align: center; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s; }
.ot-mode-btn:hover { color: var(--ot-txt); }
.ot-mode-btn[aria-pressed="true"] { background: #fff; color: var(--ot-bleu-f); box-shadow: 0 1px 2px rgba(15,23,42,.10), 0 2px 8px -2px rgba(15,23,42,.12); }
.ot-menu[data-mode="outils"] .ot-liste-modeles, .ot-menu[data-mode="outils"] .ot-aide-modeles { display: none; }
.ot-menu[data-mode="modeles"] .ot-liste-outils, .ot-menu[data-mode="modeles"] .ot-aide-outils { display: none; }
html:not(.ot-js) .ot-mode, html:not(.ot-js) .ot-aide-modeles, html:not(.ot-js) .ot-liste-modeles { display: none; }
.ot-liste-sous { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 8px 6px; color: var(--ot-txt); font-size: 13px; font-weight: 700; }
.ot-lien-modele { align-items: flex-start; }
.ot-lien-modele .ot-res-code { font-weight: 500; text-transform: none; letter-spacing: 0; }
.ot-fmts { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 78px; margin-left: auto; padding-top: 2px; }
.ot-fmt { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: .02em; }
.ot-fmt-xlsx { background: #DCFCE7; color: #166534; }
.ot-fmt-pdf { background: #FEE2E2; color: #991B1B; }
.ot-fmt-docx { background: #DBEAFE; color: #1E40AF; }

/* ------------------------------------------------------------------ Etage 2 : modeles et dossiers de la page */
.ot-modeles { display: grid; gap: 14px; scroll-margin-top: calc(var(--ot-decal) + 16px); }
.ot-modeles-titre { margin: 0; }
.ot-modeles-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ot-modele { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--ot-bord); border-top: 3px solid #CBD5E1; border-radius: var(--ot-r); background: var(--ot-card); box-shadow: var(--ot-ombre); scroll-margin-top: calc(var(--ot-decal) + 16px); }
.ot-modele-principal { border-top-color: var(--ot-bleu); }
.ot-modele-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ot-modele-tete .ot-fmt { font-size: 11px; padding: 2px 8px; }
.ot-badge-loi { border-color: #DDD6FE; background: #F5F3FF; color: #5B21B6; }
.ot-modele-titre { margin: 0; color: var(--ot-txt); font-size: 1.0625rem; font-weight: 700; line-height: 1.35; }
.ot-modele-desc { margin: 0; color: var(--ot-sec); font-size: 14.5px; line-height: 1.6; }
.ot-modele-contenu { margin: 0; padding-left: 18px; color: var(--ot-sec); font-size: 14px; line-height: 1.55; }
.ot-modele-contenu li + li { margin-top: 3px; }
.ot-modele-formats { margin: 0; color: var(--ot-mut); font-size: 12.5px; }
.ot-modele .ot-btn { margin-top: auto; align-self: flex-start; }
.ot-flash { animation: ot-flash 2.4s ease-out; }
@keyframes ot-flash { 0% { box-shadow: 0 0 0 4px rgba(37,99,235,.55), var(--ot-ombre); } 100% { box-shadow: 0 0 0 4px rgba(37,99,235,0), var(--ot-ombre); } }

/* ------------------------------------------------------------------ modale de telechargement */
html.ot-modale-ouverte { overflow: hidden; }
dialog.ot-modale { width: min(520px, calc(100vw - 24px)); max-height: min(92vh, 92dvh); margin: auto; padding: 28px; overflow: auto; border: 1px solid var(--ot-bord); border-radius: 18px; background: #fff; color: var(--ot-txt);
  box-shadow: 0 30px 80px -20px rgba(15,23,42,.45); }
dialog.ot-modale::backdrop { background: rgba(15,23,42,.55); }
.ot-modale-fermer { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: #F1F5F9; color: var(--ot-txt); cursor: pointer; }
.ot-modale-fermer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ot-modale-sur { margin: 0 0 6px; color: var(--ot-bleu-f); font-size: 13px; font-weight: 700; }
.ot-modale-h { margin: 0 36px 8px 0; font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.ot-modale-fmt { margin: 0 0 6px; color: var(--ot-mut); font-size: 12.5px; }
.ot-modale-aide { margin: 0 0 16px; color: var(--ot-sec); font-size: 14px; line-height: 1.55; }
#ot-modale-form { display: grid; gap: 14px; }
.ot-case-nl { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--ot-bord); border-radius: 12px; background: var(--ot-bg); color: var(--ot-sec); font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.ot-case-nl input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ot-bleu); }
.ot-modale-note { margin: 0; color: var(--ot-mut); font-size: 12.5px; line-height: 1.5; }
.ot-modale-erreur { margin: 0; padding: 10px 12px; border: 1px solid #FECACA; border-radius: 10px; background: #FEF2F2; color: #991B1B; font-size: 13.5px; }
.ot-modale-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.ot-modale-liens { display: grid; gap: 10px; margin: 6px 0 14px; }
.ot-modale-liens .ot-btn { justify-content: flex-start; text-align: left; }
@media (max-width: 560px) {
  dialog.ot-modale { padding: 22px 18px; }
  .ot-modale-actions .ot-btn { flex: 1 1 100%; }
  .ot-modeles-liste { grid-template-columns: minmax(0, 1fr); }
}
