/* studio.css -- l'atelier de creation, FR et EN.
   Reprend les variables de site.css : ce fichier ne redefinit aucune couleur,
   il ne fait qu'assembler l'ecran de travail. Chargez site.css AVANT. */

.studio { padding: 34px 0 90px; }
.studio-tete { max-width: 720px; margin-bottom: 30px; }
.studio-tete h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; margin-bottom: 12px; }
.studio-tete p { color: var(--texte-2); margin: 0; }

.studio-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 26px; align-items: start; }
@media (max-width: 980px) { .studio-grille { grid-template-columns: 1fr; } }

/* ---------- etapes ---------- */

.etape {
  background: var(--fond-2); border: 1px solid var(--bord); border-radius: 6px;
  padding: 20px 22px; margin-bottom: 16px;
}
.etape > h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--texte-2); margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.etape > h2 b {
  width: 21px; height: 21px; border-radius: 50%; flex: none;
  background: var(--fond-3); border: 1px solid var(--bord); color: var(--cuivre);
  display: grid; place-items: center; font-size: 11px;
}
.etape[data-fait="1"] > h2 b { background: var(--cuivre); border-color: var(--cuivre); color: #17140f; }
.etape .aide { color: var(--texte-2); font-size: 13.5px; margin: 0 0 12px; }

/* ---------- supports ---------- */

.supports { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.supports button {
  background: var(--fond-3); border: 1px solid var(--bord); border-radius: 5px;
  color: var(--texte); padding: 0; cursor: pointer; overflow: hidden; text-align: left;
  display: flex; flex-direction: column; transition: border-color .15s;
}
.supports button:hover { border-color: var(--texte-2); }
.supports button[aria-pressed="true"] { border-color: var(--cuivre); box-shadow: 0 0 0 1px var(--cuivre) inset; }
.supports button img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.supports button span { padding: 7px 9px; font-size: 12px; line-height: 1.3; }
.supports button i { display: block; color: var(--texte-2); font-style: normal; font-size: 11px; }

/* ---------- brief ---------- */

.studio textarea {
  width: 100%; min-height: 92px; resize: vertical;
  background: var(--fond-3); border: 1px solid var(--bord); border-radius: 5px;
  color: var(--texte); font: inherit; font-size: 14.5px; padding: 11px 13px;
}
.studio textarea:focus, .studio input:focus, .studio select:focus { outline: 2px solid var(--cuivre); outline-offset: 1px; }
.studio input[type="text"], .studio input[type="email"], .studio input[type="tel"],
.studio input[type="number"], .studio select {
  width: 100%; background: var(--fond-3); border: 1px solid var(--bord); border-radius: 5px;
  color: var(--texte); font: inherit; font-size: 14.5px; padding: 10px 12px;
}
.exemples { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.exemples button {
  background: transparent; border: 1px solid var(--bord); border-radius: 999px;
  color: var(--texte-2); font-size: 12px; padding: 5px 11px; cursor: pointer;
}
.exemples button:hover { color: var(--texte); border-color: var(--cuivre); }

.agent { margin-top: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.agent .etat { font-size: 12.5px; color: var(--texte-2); }
.agent-sortie {
  margin-top: 12px; background: var(--fond-3); border: 1px dashed var(--bord);
  border-left: 2px solid var(--cuivre); border-radius: 5px; padding: 12px 14px;
}
.agent-sortie p { margin: 0 0 8px; font-size: 12px; color: var(--texte-2);
  letter-spacing: .1em; text-transform: uppercase; }
.agent-sortie textarea { min-height: 74px; border-style: dashed; }

/* ---------- styles ---------- */

.filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filtres button {
  background: var(--fond-3); border: 1px solid var(--bord); border-radius: 999px;
  color: var(--texte-2); font-size: 12px; padding: 5px 12px; cursor: pointer;
}
.filtres button[aria-pressed="true"] { background: var(--cuivre); border-color: var(--cuivre); color: #17140f; font-weight: 600; }

.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px;
  max-height: 420px; overflow-y: auto; padding-right: 4px; }
.styles button {
  background: var(--fond-3); border: 1px solid var(--bord); border-radius: 5px;
  padding: 0; cursor: pointer; overflow: hidden; color: var(--texte); text-align: left;
}
.styles button:hover { border-color: var(--texte-2); }
.styles button[aria-pressed="true"] { border-color: var(--cuivre); box-shadow: 0 0 0 1px var(--cuivre) inset; }
.styles button svg { width: 100%; height: auto; aspect-ratio: 3 / 2; display: block; }
.styles button span { display: block; padding: 6px 8px; font-size: 11.5px; line-height: 1.25; }

/* ---------- apercu ---------- */

.atelier { position: sticky; top: 74px; }
.toile {
  background: var(--fond-2); border: 1px solid var(--bord); border-radius: 6px;
  padding: 16px; margin-bottom: 16px;
}
.toile-cadre {
  background: var(--fond-3); border: 1px solid var(--bord); border-radius: 4px;
  min-height: 260px; display: grid; place-items: center; overflow: hidden; position: relative;
}
.toile-cadre img { width: 100%; height: auto; display: block; }
.toile-cadre .attente-txt { color: var(--texte-2); font-size: 13px; text-align: center; padding: 30px 22px; }
.toile-cadre[data-charge="1"]::after {
  content: ""; position: absolute; inset: 0; background: rgba(14, 17, 19, .72);
  backdrop-filter: blur(1px);
}
.jauge {
  position: absolute; inset: auto 0 0 0; height: 2px; background: var(--bord); z-index: 2;
  overflow: hidden;
}
.jauge i { display: block; height: 100%; width: 34%; background: var(--cuivre);
  animation: glisse 1.15s ease-in-out infinite; }
@keyframes glisse { 0% { transform: translateX(-100%); } 100% { transform: translateX(390%); } }

.toile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.toile-info { margin: 10px 0 0; font-size: 12px; color: var(--texte-2); }
.toile-erreur { margin: 10px 0 0; font-size: 13px; color: #ff9a7a; }

/* ---------- mentions imprimees ---------- */

.mentions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bord); }
.mentions h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--texte-2); margin: 0 0 6px;
}
.champ-mention { display: block; margin-top: 10px; }
.champ-mention span { display: block; font-size: 12px; color: var(--texte-2); margin-bottom: 4px; }
.champ-mention input {
  width: 100%; padding: 9px 11px; border-radius: 6px; background: var(--fond-2);
  border: 1px solid var(--bord); color: var(--texte); font: inherit; font-size: 14px;
}
.champ-mention input:focus { outline: none; border-color: var(--cuivre); }
.zone-bascule {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 13px; color: var(--texte); cursor: pointer;
}
.zone-bascule input { accent-color: var(--cuivre); width: 16px; height: 16px; }
.align-rangee { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.align-titre { font-size: 12px; color: var(--texte-2); }
.choix-align { display: inline-flex; border: 1px solid var(--bord); border-radius: 6px; overflow: hidden; }
.choix-align button {
  background: var(--fond-2); border: 0; border-right: 1px solid var(--bord);
  color: var(--texte-2); font-size: 12px; padding: 6px 11px; cursor: pointer;
}
.choix-align button:last-child { border-right: 0; }
.choix-align button[aria-pressed="true"] { background: var(--fond-3); color: var(--cuivre); }
#btn-replacer { padding: 5px 11px; font-size: 14px; line-height: 1.2; }
/* pendant le deplacement, le curseur dit ce qui se passe */
.toile-cadre[data-glisse="1"] { cursor: grabbing; }
.toile-cadre img { cursor: grab; }

/* reglage de la zone d'impression */
.regle-zone { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bord); }
.regle-zone h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--texte-2); margin: 0 0 6px;
}
.curseur { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--texte-2); }
.curseur span { flex: 0 0 62px; }
.curseur input[type="range"] { flex: 1; accent-color: var(--cuivre); }

/* apercu en grand */
.loupe {
  position: fixed; inset: 0; z-index: 60; background: rgba(6, 8, 9, .93);
  display: grid; place-items: center; padding: 3vmin; cursor: zoom-out;
}
.loupe[hidden] { display: none; }
.loupe img { max-width: 94vw; max-height: 94vh; border-radius: 6px; }

/* ---------- bibliotheque ---------- */

.biblio { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.biblio figure { margin: 0; position: relative; }
.biblio img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--bord); cursor: pointer; }
.biblio .oter-vis {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(14, 17, 19, .82); border: 1px solid var(--bord); color: var(--texte);
  font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.biblio-vide { color: var(--texte-2); font-size: 13px; margin: 0; }

/* L'essai qu'on regarde en ce moment porte le meme encadrement cuivre que
   l'etape en cours : la colonne de vignettes et le grand cadre disent la meme
   chose, sinon on cherche laquelle est affichee. */
.biblio figure[data-courant="1"] img { border-color: var(--cuivre); box-shadow: 0 0 0 1px var(--cuivre); }
.biblio figure[data-epingle="1"] img { border-color: var(--cuivre); }
.biblio .vis-epingle {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(14, 17, 19, .82); border: 1px solid var(--cuivre); color: var(--cuivre);
  font-size: 8px; line-height: 1; display: grid; place-items: center; pointer-events: none;
}
.biblio img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

/* ---------- quantite et volume ---------- */

.qte-rangee { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.qte-rangee label { font-size: 12px; color: var(--texte-2); display: block; margin-bottom: 5px; }
.qte-rangee > div { flex: 1; min-width: 120px; }

.grille-remise { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.grille-remise th, .grille-remise td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--bord); }
.grille-remise th { color: var(--texte-2); font-weight: 500; font-size: 11.5px;
  letter-spacing: .08em; text-transform: uppercase; }
.grille-remise tr[data-actif="1"] td { color: var(--cuivre); font-weight: 600; }

.chiffrage {
  margin-top: 14px; background: var(--fond-3); border: 1px solid var(--cuivre);
  border-radius: 5px; padding: 14px 16px;
}
.chiffrage .gros { font-size: 26px; font-weight: 800; letter-spacing: -.02em; display: block; }
.chiffrage .sous { color: var(--texte-2); font-size: 12.5px; }

.cases { display: grid; gap: 7px; margin-top: 12px; }
.cases label { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.cases input { margin-top: 3px; accent-color: var(--cuivre); }

.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.champs > div.large { grid-column: 1 / -1; }
.champs label { font-size: 12px; color: var(--texte-2); display: block; margin-bottom: 5px; }
@media (max-width: 560px) { .champs { grid-template-columns: 1fr; } }

.piege-fg { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.reponse-devis { margin-top: 12px; font-size: 13.5px; }
.reponse-devis[data-ok="1"] { color: #8fd694; }
.reponse-devis[data-ok="0"] { color: #ff9a7a; }

.biblio-vide { grid-column: 1 / -1; }

/* ---------- l'etape en cours se voit ----------
   Samuel, en testant : "encadre l'etape, une par une". Sans cela les quatre
   blocs ont le meme poids et rien ne dit ou on en est. Trois etats :
   a venir (en retrait), en cours (encadree cuivre), faite (pastille pleine). */

.etape { transition: border-color .2s, box-shadow .2s, opacity .2s; }

.etape[data-etat="attente"] { opacity: .45; }
.etape[data-etat="attente"] > h2 { color: var(--texte-2); }

.etape[data-etat="encours"] {
  border-color: var(--cuivre);
  box-shadow: 0 0 0 1px var(--cuivre) inset, 0 0 22px -8px var(--cuivre);
}
.etape[data-etat="encours"] > h2 { color: var(--texte); }
.etape[data-etat="encours"] > h2 b {
  background: var(--cuivre); border-color: var(--cuivre); color: #17140f;
  animation: battement 1.8s ease-in-out infinite;
}
@keyframes battement {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 150, 63, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(233, 150, 63, 0); }
}

/* l'etape faite garde sa pastille pleine, sans le halo */
.etape[data-etat="faite"] > h2 b {
  background: var(--cuivre); border-color: var(--cuivre); color: #17140f;
}

/* le bloc apercu suit la meme regle, dans la colonne de droite */
.toile[data-etat="encours"] {
  border-color: var(--cuivre);
  box-shadow: 0 0 0 1px var(--cuivre) inset, 0 0 22px -8px var(--cuivre);
}
.toile[data-etat="attente"] { opacity: .45; }

/* la consigne du moment, sous le titre de l'etape en cours */
.consigne {
  margin: 0 0 12px; font-size: 13.5px; color: var(--cuivre);
}
