/* Styles generaux du site (hors page catalogue, qui a son propre catalogue.css) */

/* Signature discrete du concepteur (pied de page public). */
.site-credit {
  text-align: center;
  color: #9aa0b5;
  font-size: 12px;
  line-height: 1.5;
  padding: 24px 16px 30px;
  margin-top: 8px;
}
.site-credit a { color: #7a8199; text-decoration: none; font-weight: 600; }
.site-credit a:hover { color: #2c4cc5; text-decoration: underline; }

/* POLICE ROBOTO (optionnelle)
   Par defaut on utilise la police systeme (Arial en repli), pour ne dependre
   d'aucun fichier externe. Pour activer Roboto :
   1. Deposez roboto-400.woff2 / roboto-500.woff2 / roboto-700.woff2 /
      roboto-700-italic.woff2 dans assets/fonts/ (fontsource.org ou Google Fonts)
   2. Decommentez le bloc ci-dessous.
   (Ne le decommentez PAS sans les fichiers : le navigateur signalerait des
   erreurs "Failed to decode downloaded font" dans la console.)

@font-face { font-family:"Roboto"; font-style:normal; font-weight:400; font-display:swap;
  src:url("fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family:"Roboto"; font-style:normal; font-weight:500; font-display:swap;
  src:url("fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family:"Roboto"; font-style:normal; font-weight:700; font-display:swap;
  src:url("fonts/roboto-700.woff2") format("woff2"); }
@font-face { font-family:"Roboto"; font-style:italic; font-weight:700; font-display:swap;
  src:url("fonts/roboto-700-italic.woff2") format("woff2"); }
*/

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #16192b;
  background: #f4f5f8;
  line-height: 1.5;
}

a { color: #2c4cc5; }

.site-header {
  background: #2c4cc5;
  color: #fff;
  padding: 14px 20px;
}
.site-header a { color: #fff; text-decoration: none; font-weight: 700; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 20px 60px; }
/* Le formulaire exploite toute la largeur de l'ecran (surtout utile pour
   l'apercu de la page double, 2x plus large). */
.wrap.form-page { max-width: 1760px; }
.narrow { max-width: 640px; }

h1.page-title { font-size: 24px; font-weight: 800; margin: 0 0 20px; }
h2.section-title { font-size: 18px; font-weight: 700; margin: 28px 0 12px; }

.muted { color: #6b7291; }
.center { text-align: center; }

/* --- Boutons --- */
.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #16192b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.btn-blue { background: #2c4cc5; color: #fff; border-color: #2c4cc5; }
.btn-danger { color: #b3261e; border-color: #e2b3b0; background: #fff; }

/* --- Formulaire --- */
.form-layout { display: flex; gap: 28px; align-items: flex-start; }
/* Formulaire a largeur fixe et confortable ; l'apercu prend tout le reste de
   l'ecran (important pour la page double, deux fois plus large). */
.form-col { flex: 0 0 460px; min-width: 0; }
.preview-col { flex: 1 1 auto; min-width: 0; position: sticky; top: 20px; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span, .field > label > span, .field legend { font-size: 14px; font-weight: 600; }
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.field input:not([type]),
.field textarea,
.field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.field textarea { resize: vertical; }
.error { color: #b3261e; font-size: 13px; margin: 4px 0 0; }
.hint { color: #666; font-size: 12px; }

/* Marqueur des champs obligatoires */
.req { color: #b3261e; font-weight: 700; margin-left: 2px; }
.req-legend {
  background: #eef1fb; border: 1px solid #d4dbf5; border-radius: 6px;
  padding: 8px 12px; font-size: 13px; margin: 0 0 18px;
}

/* Jauge de remplissage d'une zone de texte (mesure du debordement reel dans
   l'apercu : verte = de la place, orange = bientot plein, rouge = coupe). */
.fill-gauge { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fill-gauge-bar { flex: 1 1 auto; height: 5px; border-radius: 3px; background: #e6e9f2; overflow: hidden; }
.fill-gauge-bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: #2e9e63; transition: width .12s ease, background .12s ease; }
.fill-gauge-label { font-size: 12px; font-weight: 600; white-space: nowrap; color: #2e9e63; }
.fill-gauge[data-state="warn"] .fill-gauge-bar > i { background: #e08a00; }
.fill-gauge[data-state="warn"] .fill-gauge-label { color: #b4630e; }
.fill-gauge[data-state="over"] .fill-gauge-bar > i { background: #d1483a; }
.fill-gauge[data-state="over"] .fill-gauge-label { color: #c0392b; }

/* Etat de preparation d'une image selectionnee */
.file-status { font-size: 12px; color: #2c4cc5; font-weight: 600; }

.file-row { display: flex; align-items: center; gap: 10px; }
.file-row input[type="file"] { flex: 1 1 auto; min-width: 0; }
.remove-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #e2b3b0;
  background: #fff;
  color: #b3261e;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.chiffre-row { display: flex; gap: 10px; margin-bottom: 8px; }
.chiffre-row input { flex: 1 1 0; }

.consent { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.consent input { margin-top: 4px; }

.progress-track {
  width: 100%; height: 8px; background: #e5e5e5; border-radius: 4px;
  overflow: hidden; margin: 4px 0;
}
.progress-fill { height: 100%; background: #1a1a1a; border-radius: 4px; transition: width 0.15s; }

/* --- Liste deroulante des secteurs --- */
.tags-dd { position: relative; }
.tags-dd-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; background: #fff;
  font-size: 14px; cursor: pointer; text-align: left;
}
.tags-dd-trigger .placeholder { color: #888; }
.tags-dd-chevron { font-size: 10px; color: #666; margin-left: 8px; }
.tags-dd-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid #ccc; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12); max-height: 300px; display: flex;
  flex-direction: column; overflow: hidden;
}
/* Indispensable : sans cette regle, le `display:flex` ci-dessus l'emporte sur
   l'attribut HTML [hidden] et le panneau reste ouvert en permanence. */
.tags-dd-panel[hidden] { display: none; }
.tags-dd-search { margin: 8px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.tags-dd-list {
  overflow-y: auto; padding: 4px 8px 8px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 8px;
}
.tags-dd-option {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 14px;
  cursor: pointer; border-radius: 4px; min-width: 0;
}
.tags-dd-option:hover { background: #f5f5f5; }
.tags-dd-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags-dd-option.is-disabled { opacity: 0.4; cursor: not-allowed; }
.tags-dd-option.is-disabled:hover { background: none; }
.tags-dd-note { margin: 8px 8px 0; font-size: 12.5px; color: #767C97; }
.tags-dd-note.is-max { color: #B4630E; font-weight: 600; }

/* --- Recadrage photo --- */
.cropper-wrap { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.cropper-box { position: relative; width: 100%; height: 280px; background: #222; border-radius: 8px; overflow: hidden; }
.cropper-box img { display: block; max-width: 100%; }
.zoom-slider { width: 100%; cursor: pointer; }

/* Cadre fixe : on masque les poignees de redimensionnement (le cadre ne se
   redimensionne plus, on deplace l'image derriere) et on montre le curseur move. */
.cropper-box .cropper-point,
.cropper-box .cropper-line { display: none !important; }
.cropper-box .cropper-face { cursor: move; }

/* --- Zone de previsualisation --- */
.preview-label { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; color: #6b7291; margin: 0 0 10px; }
.preview-frame { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.preview-note { text-align: center; font-size: 12px; color: #6b7291; margin: 10px 4px 0; }
.catalogue-host { width: 100%; }

/* --- Choix de formule --- */
.formules { display: flex; gap: 20px; flex-wrap: wrap; }
.formule-card {
  flex: 1 1 260px; background: #fff; border-radius: 10px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 10px;
}
.formule-price { font-size: 28px; font-weight: 800; }
.formule-acompte { color: #2c4cc5; font-weight: 600; }
.formule-old { text-decoration: line-through; color: #999; font-size: 16px; }
.badge-early { display: inline-block; background: #47c8a9; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* --- Apercu / actions --- */
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; justify-content: center; }
.validated { color: #1f9d55; font-weight: 700; }

/* --- Paiement --- */
.pay-box { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.pay-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; }
.pay-line strong { font-weight: 700; }
.pay-qr { text-align: center; margin-top: 20px; }
.pay-qr canvas, .pay-qr img { background: #fff; }

@media (max-width: 860px) {
  .form-layout { flex-direction: column; }
  .preview-col { position: static; width: 100%; }
}
