/* MENU — boutons métalliques lisibles */
.tool-menu__button {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  height: 26px;
  margin-top: 10px !important;
  margin-bottom: 0;
  padding: 2px 15px;
  border: 1px solid #989da1;
  border-radius: 6px;
  background: linear-gradient(180deg, #f0f1f2 0%, #c9cdd0 52%, #e1e3e5 100%);
  color: #555 !important;
  font:
    400 12px/18px "Quicksand",
    sans-serif;
  cursor: pointer;
  box-shadow:
    0 1px 3px #0003,
    inset 0 1px 0 #fff;
}
/* MENU — survol */
.tool-menu__button:hover {
  background: linear-gradient(180deg, #f7f8f8 0%, #d3d6d8 52%, #e8eaeb 100%);
  transform: translateY(-1px);
}
/* MENU — bouton enfoncé ou sélectionné */
.tool-menu__button:active,
.tool-menu__button.is-active {
  border-color: #303438;
  background: linear-gradient(180deg, #484e53, #303438);
  color: #fff !important;
  transform: translateY(0);
  box-shadow:
    inset 0 2px 4px #0007,
    inset 0 1px 0 #73797e;
}
/* MENU — espacement régulier entre les éléments */
.toolbar-line {
  gap: 8px;
}
.toolbar-line > *,
.toolbar-line .tool-menu__button {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* MENU — signature sō web */
.toolbar-brand {
  align-self: center;
  padding-left: 10px !important;
  padding-right: 10px !important;
  color: #555;
  font:
    400 20px "Quicksand",
    sans-serif;
  text-shadow:
    0 1px 0 #fff,
    0 -1px 1px #0003;
}
/* MENU — alignement des champs sur les boutons */
#formatSelect,
#format-width,
#format-height {
  height: 27px !important;
  align-self: flex-start;
  margin-top: 5px !important;
  box-sizing: border-box;
}
/* MENU — espace réservé à la barre d’outils */
.toolbar-line {
  margin-bottom: 1px;
}
/* EXPORT IMAGE — ligne sans cadre */
#step-3.toolbar-export {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}
/* BARRE D’OUTILS — marge à gauche */
#controls {
  margin-left: 10px;
}
/* BARRE D’OUTILS — hauteur identique aux boutons du menu */
#panel-title .tool-panel__row input,
#panel-title .tool-panel__row select,
#panel-title .tool-panel__row button,
#panel-title #text-style-controls input,
#panel-title #text-style-controls select,
#panel-title #text-style-controls button {
  box-sizing: border-box;
  height: 26px !important;
}
#panel-title #text-style-controls[style*="display: block"] {
  display: flex !important;
}
/* BARRE Titre — police, sliders et boutons de style */
#formatSelect,
#font-select {
  font-family: "Quicksand", sans-serif;
}
#panel-title #text-style-controls input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  padding: 0;
}
#panel-title #text-style-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #666;
  border-radius: 2px;
}
#panel-title #text-style-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: #555;
}
#panel-title #text-style-controls input[type="range"]::-moz-range-track {
  height: 3px;
  background: #666;
  border-radius: 2px;
}
#panel-title #text-style-controls input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #555;
}
#panel-title #reset-text1-btn,
#panel-title #toggle-bold-btn,
#panel-title #toggle-italic-btn {
  box-sizing: border-box;
  width: 40px;
  min-width: 40px;
  padding-right: 0;
  padding-left: 0;
}
/* BARRE TITRE — curseur centré sur la ligne */
input[type="range"] {
  width: 80px !important;
  height: 12px !important;
  background: #ddd !important;
  outline: none !important;
  margin: 0 1px !important;
  appearance: none;
  -webkit-appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #aaa;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  transform: translateY(12px);
  border: 0;
  border-radius: 50%;
  background: #555;
  appearance: none;
  -webkit-appearance: none;
}
input[type="range"]::-moz-range-track {
  height: 3px;
  background: #eee;
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #555;
}
/* POPUP TEXTE — position et apparence */
#slogan-text-dialog {
  position: fixed;
  top: 200px !important;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: 500px !important;
  /* background: #17191d66; */
  margin: 0;
  padding: 22px;
  overflow: auto;
  border: 1px solid #b8b8b8;
  border-radius: 10px;
  background: linear-gradient(#fff, #f2f2f2);
  color: #222;
  box-shadow: 0 12px 32px #0003;
}
#slogan-text-dialog::backdrop {
  background: transparent;
  backdrop-filter: blur(2px);
}
#slogan-text-dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
}
#slogan-text-dialog #slogan-input {
  display: block;
  box-sizing: border-box;
  width: 350px !important;
  margin-left: -15px;
  height: 250px !important;
  margin-left: 30px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font:
    14px/1.5 "Quicksand",
    sans-serif;
  resize: vertical;
}
#slogan-text-dialog form {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
#slogan-text-dialog button {
  padding: 7px 16px;
  border: 1px solid #888;
  border-radius: 6px;
  background: linear-gradient(#e5e5e5, #c9c9c9);
  color: #222;
  font:
    600 13px "Quicksand",
    sans-serif;
  cursor: pointer;
}
#slogan-text-dialog button:hover {
  background: linear-gradient(#d7d7d7, #bcbcbc);
}
/* BARRE TEXTE — largeur du champ de taille */
#slogan-font-size-input {
  width: 60px !important;
}
/* BARRES TITRE ET TEXTE — largeur des champs de taille */
#font-size-input,
#slogan-font-size-input {
  width: 60px !important;
}
/* BARRES TITRE ET TEXTE — sans ombre, angles harmonisés */
#controls .bo,
.tool-menu__button,
.toolbar-brand,
#panel-title *,
#panel-text *,
#slogan-text-dialog,
#slogan-text-dialog * {
  box-shadow: none !important;
  text-shadow: none !important;
}
.tool-menu__button,
#panel-title button,
#panel-title input:not([type="range"]),
#panel-title select,
#panel-text button,
#panel-text input:not([type="range"]),
#panel-text select,
#slogan-text-dialog,
#slogan-text-dialog textarea,
#slogan-text-dialog button {
  border-radius: 6px !important;
}
#panel-title input[type="range"]::-webkit-slider-runnable-track,
#panel-text input[type="range"]::-webkit-slider-runnable-track {
  border-radius: 2px;
}
#panel-title input[type="range"]::-webkit-slider-thumb,
#panel-text input[type="range"]::-webkit-slider-thumb,
#panel-title input[type="range"]::-moz-range-thumb,
#panel-text input[type="range"]::-moz-range-thumb {
  border-radius: 50%;
}
/* BARRES TITRE ET TEXTE — filet autour de la police et de la taille */
#font-select,
#font-size-input,
#slogan-font-select,
#slogan-font-size-input {
  box-sizing: border-box;
  border: 1px solid #989da1;
  border-radius: 6px;
}
/* BARRES TITRE ET TEXTE — alignement et curseurs identiques */
#panel-title .tool-panel__row,
#panel-text .tool-panel__row {
  align-items: center !important;
}
#panel-title #text-style-controls[style*="display: block"],
#panel-text #slogan-text-style-controls[style*="display: block"] {
  display: flex !important;
  align-items: center;
}
#panel-title #text-style-controls input[type="range"],
#panel-text #slogan-text-style-controls input[type="range"] {
  width: 80px !important;
  height: 12px !important;
}
#panel-title #text-style-controls input[type="range"]::-webkit-slider-runnable-track,
#panel-text #slogan-text-style-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #aaa;
  border-radius: 2px;
}
#panel-title #text-style-controls input[type="range"]::-webkit-slider-thumb,
#panel-text #slogan-text-style-controls input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  transform: translateY(12px);
  border-radius: 50%;
  background: #555;
  appearance: none;
  -webkit-appearance: none;
}
#panel-title #text-style-controls input[type="range"]::-moz-range-track,
#panel-text #slogan-text-style-controls input[type="range"]::-moz-range-track {
  height: 3px;
  background: #eee;
  border-radius: 2px;
}
#panel-title #text-style-controls input[type="range"]::-moz-range-thumb,
#panel-text #slogan-text-style-controls input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #555;
}
.draggable-text.resize-selected {
  outline: 1px dashed #2584e8;
}
.draggable-text.resize-selected::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-bottom: 14px solid #2584e8;
  cursor: nwse-resize;
}
#text1 {
  align-items: center;
}
.title-toolbar {
  column-gap: 5px;
}
.title-toolbar input:not([type="color"]):not([type="range"]),
.title-toolbar select {
  box-sizing: border-box;
  height: 26px !important;
  padding: 2px 6px !important;
  font-size: 12px !important;
}
.title-toolbar #title-input {
  width: 170px !important;
}
.title-toolbar #font-size-input {
  width: 70px !important;
}
.title-toolbar input[type="color"] {
  box-sizing: border-box;
  width: 26px;
  height: 26px;
}
.title-toolbar input[type="range"] {
  width: 65px !important;
}
.title-toolbar label {
  font-size: 12px !important;
}
#panel-title #reset-text1-btn,
#panel-title #toggle-bold-btn,
#panel-title #toggle-italic-btn {
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  padding: 0px;
}
.title-toolbar button {
  box-sizing: border-box;
  height: 26px !important;
  min-height: 26px;
  /* padding: 2px 4px !important; */
  font-size: 12px !important;
  line-height: 1;
}
.title-toolbar #title-input {
  width: 150px !important;
}
.title-toolbar #font-size-input {
  width: 60px !important;
}
#panel-text #open-slogan-dialog-btn {
  align-self: center;
  margin-top: 0 !important;
}
#controls {
  display: block;
  text-align: left; /* Aligne le contenu à gauche */
  margin: 0px 0 !important;
  margin-top: -2px !important;
  width: 100%; /* Utilise toute la largeur disponible */
  max-width: 100%; /* Ne dépasse pas la largeur parent */
}
#panel-image .button-groups {
  gap: 1px !important;
}
#panel-image .button-groups .bordered-container,
#panel-title #title-align-controls,
#panel-text #slogan-align-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px !important;
}
#panel-title #reset-text1-btn,
#panel-title #title-align-controls {
  margin-right: 1px !important;
}
#panel-title #toggle-bold-btn,
#panel-title #toggle-italic-btn,
#panel-text #toggle-bold-btn-slogan,
#panel-text #toggle-italic-btn-slogan {
  margin-left: 0 !important;
}
#panel-title #toggle-bold-btn {
  margin-right: 5px !important;
}
#panel-image .button-groups > .bordered-container,
#panel-title #title-align-controls,
#panel-text #slogan-align-controls {
  box-sizing: border-box;
  height: 26px !important;
  min-height: 26px;
  /* padding: 2px 4px !important; */
  font-size: 12px !important;
  align-items: center;
  gap: 10px !important;
  padding: 1px !important;
}
#panel-image .button-groups > .bordered-container {
  display: inline-flex;
}
#panel-text #toggle-bold-btn-slogan,
#panel-text #toggle-italic-btn-slogan {
  margin-left: 0 !important;
}
#panel-title #title-align-controls,
#panel-text #slogan-align-controls {
  padding: 3px !important;
}
/* JCL------------------------------------------------- */
.mba {
  padding-bottom: 10px;
}
.mba2 {
  padding-bottom: 3px;
}
.bo {
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.65);
}
.bof {
  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.65);
}
.bo2 {
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  border-radius: 8px;
  width: 100%;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.65);
}
.minh {
  min-height: 100px !important;
}
/* adaptations ---------------------------------- */
/* =========================================================
   UNIFORMISATION — boutons et cadres de regroupement
   - Boutons métalliques dans les barres d'outils
   - Boutons NOIRS dans les cadres de regroupement
   - Boutons-icônes 26×26 partout, padding 0
   - Flèches reset au style fond blanc
   ========================================================= */
/* ---------------------------------------------------------
   1. Base commune à TOUS les boutons des barres d'outils
   --------------------------------------------------------- */
#controls button,
#controls .btn,
.toolbar-line button,
.toolbar-line .btn,
.toolbar-export button,
.toolbar-export .btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 2px 12px !important;
  border: 1px solid #989da1 !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, #f0f1f2 0%, #c9cdd0 52%, #e1e3e5 100%) !important;
  color: #555 !important;
  font:
    400 12px/1 "Quicksand",
    sans-serif !important;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none;
}
#controls button:hover,
#controls .btn:hover,
.toolbar-line button:hover,
.toolbar-line .btn:hover,
.toolbar-export button:hover,
.toolbar-export .btn:hover {
  background: linear-gradient(180deg, #f7f8f8 0%, #d3d6d8 52%, #e8eaeb 100%) !important;
}
#controls button:active,
#controls .btn:active,
#controls button.is-active,
#controls .btn.is-active,
.toolbar-line button:active,
.toolbar-line .btn:active,
.toolbar-line button.is-active,
.toolbar-line .btn.is-active {
  border-color: #303438 !important;
  background: linear-gradient(180deg, #484e53, #303438) !important;
  color: #fff !important;
  box-shadow:
    inset 0 2px 4px #0007,
    inset 0 1px 0 #73797e !important;
}
/* ---------------------------------------------------------
   2. Boutons carrés (icônes) : 26×26 dans TOUTES les zones
   --------------------------------------------------------- */
#reset,
#reset-text1-btn,
#reset-text2-btn,
#toggle-bold-btn,
#toggle-italic-btn,
#toggle-bold-btn-slogan,
#toggle-italic-btn-slogan,
#flip-horizontal-btn,
#flip-vertical-btn,
#zoom-in,
#zoom-out,
#move-up,
#move-left,
#move-right,
#move-down,
#align-left-btn,
#align-center-btn,
#align-right-btn,
#align-left-title-btn,
#align-center-title-btn,
#align-right-title-btn,
#brightness-decrease,
#brightness-increase,
#brightness-reset,
#contrast-decrease,
#contrast-increase,
#contrast-reset,
#grayscale-decrease,
#grayscale-increase,
#grayscale-reset {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
}
/* Icônes Font Awesome : taille fixe pour cohérence Titre / Texte / Image */
#controls button i,
#controls .btn i {
  font-size: 13px !important;
  line-height: 1 !important;
}
/* ---------------------------------------------------------
   3. Boutons « OK » : largeur unifiée
   --------------------------------------------------------- */
#set-format-btn,
#set-font-size-btn,
#set-title-btn,
#set-slogan-font-size-btn,
#set-slogan-btn {
  min-width: 44px !important;
  padding: 2px 10px !important;
}
/* ---------------------------------------------------------
   4. Cadres de regroupement (bordered-container)
   --------------------------------------------------------- */
#panel-image .button-groups > .bordered-container,
#panel-image .zone-controle.bordered-container,
#panel-title #title-align-controls,
#panel-text #slogan-align-controls {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  box-sizing: border-box;
  height: 34px !important; /* 26px bouton + 3px padding × 2 + 2px bord */
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 3px !important; /* air entre le bord et les boutons */
  border: 1px solid #c4c7ca !important;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, 0.45) !important;
}
/* Neutraliser les marges dans les cadres */
#panel-image .bordered-container button,
#title-align-controls button,
#slogan-align-controls button {
  margin: 0 !important;
}
/* ---------------------------------------------------------
   5. Boutons NOIRS dans les cadres de regroupement
   --------------------------------------------------------- */
#panel-image .button-groups > .bordered-container button,
#panel-image .zone-controle.bordered-container button,
#panel-title #title-align-controls button,
#panel-text #slogan-align-controls button {
  background: #555 !important;
  background-image: none !important;
  color: #fff !important;
  border: 1px solid #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
#panel-image .button-groups > .bordered-container button:hover,
#panel-image .zone-controle.bordered-container button:hover,
#panel-title #title-align-controls button:hover,
#panel-text #slogan-align-controls button:hover {
  background: #333 !important;
  background-image: none !important;
}
#panel-image .button-groups > .bordered-container button:active,
#panel-image .zone-controle.bordered-container button:active,
#panel-title #title-align-controls button:active,
#panel-title #title-align-controls button.is-active,
#panel-text #slogan-align-controls button:active,
#panel-text #slogan-align-controls button.is-active {
  background: #000 !important;
  background-image: none !important;
  color: #fff !important;
}
/* ---------------------------------------------------------
   6. Champs et selects alignés sur la hauteur des boutons
   --------------------------------------------------------- */
#controls input:not([type="range"]):not([type="color"]):not([type="file"]),
#controls select,
.toolbar-line input:not([type="range"]):not([type="color"]):not([type="file"]),
.toolbar-line select,
.toolbar-export input:not([type="range"]):not([type="color"]):not([type="file"]),
.toolbar-export select {
  box-sizing: border-box;
  height: 26px !important;
  min-height: 26px !important;
  padding: 2px 6px !important;
  border: 1px solid #989da1 !important;
  border-radius: 6px !important;
  font:
    400 12px "Quicksand",
    sans-serif !important;
  background: #fff;
}
#controls input[type="color"] {
  box-sizing: border-box;
  width: 26px !important;
  height: 26px !important;
  padding: 1px !important;
  border: 1px solid #989da1 !important;
  border-radius: 6px !important;
}
/* ---------------------------------------------------------
   7. Gaps cohérents entre groupes et enfants directs
   --------------------------------------------------------- */
.toolbar-line {
  gap: 8px !important;
}
.tool-panel__row {
  gap: 8px !important;
}
#panel-image .button-groups {
  gap: 8px !important;
}
#panel-image .zone-filtres {
  gap: 8px !important;
}
#panel-image .zone-controle {
  gap: 8px !important;
}
.toolbar-line > *,
.tool-panel__row > *,
.button-groups > *,
.zone-controle > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* ---------------------------------------------------------
   8. Flèches reset : style « fond blanc » identique
   (width/height/padding déjà fixés en section 2)
   --------------------------------------------------------- */
#reset-text1-btn,
#reset-text2-btn {
  border: 1px solid #989da1 !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, #f0f1f2 0%, #c9cdd0 52%, #e1e3e5 100%) !important;
  background-image: linear-gradient(180deg, #f0f1f2 0%, #c9cdd0 52%, #e1e3e5 100%) !important;
  color: #555 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none;
}
#reset-text1-btn:hover,
#reset-text2-btn:hover {
  background: linear-gradient(180deg, #f7f8f8 0%, #d3d6d8 52%, #e8eaeb 100%) !important;
  background-image: linear-gradient(180deg, #f7f8f8 0%, #d3d6d8 52%, #e8eaeb 100%) !important;
}
#reset-text1-btn:active,
#reset-text2-btn:active {
  border-color: #303438 !important;
  background: linear-gradient(180deg, #484e53, #303438) !important;
  background-image: linear-gradient(180deg, #484e53, #303438) !important;
  color: #fff !important;
}
.toolbar-line > *,
.tool-panel__row > *,
.button-groups > *,
.zone-controle > * {
  margin-left: 5px !important;
  margin-right: 0 !important;
}
/* ---------------------------------------------------------
   Neutraliser le gap sur les rangées imbriquées
   (le panneau Texte a un tool-panel__row dans un tool-panel__row)
   --------------------------------------------------------- */
.tool-panel__row .tool-panel__row {
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Et s'assurer que les enfants directs du panneau (section)
   n'ont pas d'espace vertical parasite */
#panel-text > .tool-panel__row,
#panel-title > .tool-panel__row,
#panel-image > .tool-panel__row {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* Verrou anti-zoom sur la barre Titre (cause du décalage de 2-3 px) */
#panel-title .title-toolbar,
#panel-title .tool-panel__row,
#panel-title * {
  zoom: 1 !important;
}
