/* Formulaire de personnalisation et aperçu : /creer et "Mon site" */
.builder { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
.builder .preview-col { position: sticky; top: 84px; display: grid; gap: .6rem; }
.preview-col h3 { font-size: 1rem; }

.siteform { display: grid; gap: 1.1rem; }
.sf-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem .4rem; background: var(--surface); margin: 0; min-width: 0; }
.sf-sec legend { font: 700 1.05rem var(--font-display); padding-inline: .4rem; }
.sf-hint { font-size: .9rem; margin: -.2rem 0 .9rem; }
.field .lbl { font-weight: 700; font-size: .88rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 1rem; }

.logo-box { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.logo-prev { height: 56px; width: auto; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.logo-box label { font-weight: 700; }

.palettes { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.palette { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem .35rem .45rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font: 600 .82rem var(--font-body); color: var(--ink); }
.palette:hover { border-color: var(--ink); }
.palette i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-right: -6px; border: 1.5px solid #fff; }
.palette span { margin-left: 8px; }
.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0 1rem; }
.field.color input[type=color] { width: 100%; height: 44px; padding: 3px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.font-opt { display: grid; gap: .1rem; text-align: left; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; color: var(--ink); }
.font-opt strong { font-size: 1.15rem; }
.font-opt span { color: var(--muted); font-size: .85rem; }
.font-opt[aria-checked=true] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

.steps-edit { display: grid; gap: .7rem; margin-bottom: 1rem; justify-items: start; }
.step-edit { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; align-items: start; width: 100%; }
.step-edit .n { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 700; margin-top: .3rem; }
.step-edit > div { display: grid; gap: .4rem; }

/* ----- Aperçu ----- */
.pv { --pv-line: color-mix(in srgb, var(--ink) 14%, var(--paper)); border: 1px solid var(--pv-line); border-radius: 16px; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--font-body); box-shadow: 0 10px 30px rgba(0, 0, 0, .08); }
.pv-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--pv-line); }
.pv-brand { display: inline-flex; align-items: center; gap: .45rem; font: 700 1rem var(--font-display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-brand img { height: 24px; width: auto; max-width: 70px; object-fit: contain; }
.pv-btn, .pv-cta { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pv-hero { display: grid; gap: .45rem; justify-items: start; padding: 1.4rem .9rem; }
.pv-hero small { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; }
.pv-hero strong { font: 700 1.45rem/1.1 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.pv-cta { background: var(--accent); color: var(--ink); margin-top: .3rem; }
.pv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: 0 .9rem 1rem; }
.pv-card { display: grid; gap: .3rem; font-size: .72rem; font-weight: 700; }
.pv-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }

@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; }
  .builder .preview-col { position: static; order: -1; }
}

.pv-trust { display: flex; flex-wrap: wrap; gap: .3rem .8rem; padding: 0 .9rem .7rem; font-size: .7rem; font-weight: 700; color: var(--primary); }
.pv-loc { display: flex; align-items: center; gap: .35rem; padding: .6rem .9rem; border-top: 1px solid var(--pv-line); font-size: .74rem; color: color-mix(in srgb, var(--ink) 70%, var(--paper)); }
.geo-box { display: grid; gap: .5rem; justify-items: start; }
.geo-ok { display: flex; align-items: center; gap: .4rem; font-weight: 700; color: #146c32; margin: 0; }
.trust-edit { grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; }
.trust-edit .n { margin-top: 0; }

/* ----- Choix de la disposition ----- */
.lay-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.lay-opt { display: grid; gap: .35rem; text-align: left; padding: .6rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.lay-opt[aria-checked=true] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.lay-opt small { color: var(--muted); line-height: 1.3; }
.lay-ico { display: grid; gap: 3px; aspect-ratio: 4 / 3; padding: 5px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 5%, #fff); grid-template-columns: repeat(3, 1fr); grid-template-rows: 1.2fr 1fr; }
.lay-ico i { display: block; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, #fff); }
.lay-ico.lay-classique i:nth-child(1) { grid-column: span 2; background: color-mix(in srgb, var(--ink) 12%, #fff); }
.lay-ico.lay-classique i:nth-child(2) { background: var(--primary); }
.lay-ico.lay-vitrine i:nth-child(1) { grid-column: 1 / -1; background: var(--ink); }
.lay-ico.lay-vitrine i:nth-child(5), .lay-ico.lay-galerie i:nth-child(5) { display: none; }
.lay-ico.lay-galerie { grid-template-rows: .7fr 1fr; }
.lay-ico.lay-galerie i:nth-child(1) { grid-column: 1 / -1; background: transparent; border: 1.5px dashed color-mix(in srgb, var(--ink) 30%, #fff); }
.lay-ico.lay-galerie i:nth-child(2) { align-self: start; height: 100%; }
.lay-ico.lay-galerie i:nth-child(3) { align-self: start; height: 65%; }
.lay-ico.lay-galerie i:nth-child(4) { align-self: start; height: 85%; }
.lay-ico.lay-boutique { grid-template-columns: repeat(4, 1fr); grid-template-rows: .5fr 1fr; }
.lay-ico.lay-boutique i:nth-child(1) { grid-column: 1 / -1; background: color-mix(in srgb, var(--primary) 30%, #fff); }

/* Aperçu : la disposition se voit aussi en miniature */
.pv-lay-vitrine .pv-hero { background: var(--ink); }
.pv-lay-vitrine .pv-hero strong { color: #fff; }
.pv-lay-vitrine .pv-hero small { color: var(--accent); }
.pv-lay-galerie .pv-hero { justify-items: center; text-align: center; }
.pv-lay-galerie .pv-top { justify-content: center; }
.pv-lay-boutique .pv-hero { background: var(--soft, color-mix(in srgb, var(--primary) 8%, var(--paper))); padding-block: .8rem; }
.pv-lay-boutique .pv-hero strong { font-size: 1.05rem; }
.pv-lay-boutique .pv-grid { grid-template-columns: repeat(4, 1fr); }

/* Téléphone : les 4 dispositions côte à côte (2 par ligne) */
@media (max-width: 560px) {
  .lay-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .lay-opt { padding: .45rem; }
  .lay-opt small { font-size: .74rem; }
}

/* Logo : une grande case à toucher, bien visible en haut de « Mon site » */
.logo-box { align-items: center; gap: 1rem; flex-wrap: nowrap; margin-bottom: .8rem; }
.logo-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.logo-tile { flex: 0 0 auto; width: 96px; height: 96px; display: grid; place-items: center; cursor: pointer; border: 2px dashed var(--primary); border-radius: 18px; background: var(--soft); overflow: hidden; }
.logo-tile.has { border-style: solid; border-color: var(--line); background: #fff; }
.logo-tile .logo-prev { height: 100%; width: 100%; max-width: none; border: 0; border-radius: 0; object-fit: contain; padding: 8px; }
.logo-empty { font: 700 2.4rem/1 var(--font-display); color: var(--primary); }
.logo-side { display: grid; gap: .5rem; justify-items: start; min-width: 0; }
.logo-box:focus-within .logo-tile { outline: 3px solid var(--accent); outline-offset: 2px; }
.logo-box label.btn { font-weight: 700; cursor: pointer; }

/* La photo de couverture a besoin d'une vignette large, pas carrée comme le logo */
.logo-box.is-cover .logo-tile { width: 150px; height: 96px; border-radius: 14px; }
.logo-box.is-cover .logo-tile .logo-prev { object-fit: cover; padding: 0; }
@media (max-width: 420px) { .logo-box.is-cover .logo-tile { width: 112px; height: 76px; } }

/* Aperçu : la couverture derrière le titre */
.pv-hero.has-cover { position: relative; isolation: isolate; overflow: hidden; border-radius: 10px; padding: 1rem .7rem; }
.pv-hero.has-cover .pv-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.pv-hero.has-cover::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .7)); }
.pv-hero.has-cover small, .pv-hero.has-cover strong { color: #fff; }

/* Cadrage de la photo de couverture : on touche le point important */
.cover-frame { display: grid; gap: .5rem; margin-top: .2rem; }
.cf-area { position: relative; display: block; width: 100%; aspect-ratio: 16 / 7; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: crosshair; background: var(--soft); touch-action: none; }
.cf-area img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cf-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; background: color-mix(in srgb, var(--primary) 75%, transparent); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); pointer-events: none; }
.cf-area:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Générateur de logo */
.logo-maker { display: grid; gap: .7rem; margin-top: .3rem; }
.lm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.lm-opt { display: grid; gap: .3rem; justify-items: center; padding: .5rem .35rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.lm-opt:hover { border-color: var(--primary); }
.lm-opt[aria-checked=true] { border-color: var(--primary); background: var(--soft); }
.lm-prev { display: block; width: 100%; aspect-ratio: 1; }
.lm-prev svg { width: 100%; height: 100%; display: block; }
.lm-opt small { font-weight: 700; font-size: .72rem; color: var(--muted); }
.lm-opt[aria-checked=true] small { color: var(--primary); }

/* Générateur de logo : variantes et grille de 8 modèles */
.lm-variants { margin: .1rem 0 .2rem; }
.lm-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
@media (max-width: 420px) { .lm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lm-opt { transition: border-color .15s ease, transform .15s ease; }
.lm-opt:active { transform: scale(.97); }

/* Les champs d'envoi cachés (logo, couverture) restent vraiment invisibles et minuscules.
   La règle générale « input[type=file] en pleine largeur » est plus forte que .logo-file :
   sans ce correctif, ils mesuraient toute la largeur et faisaient dézoomer la page sur téléphone. */
.logo-box { position: relative; }
.logo-box input[type=file].logo-file {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-width: 0; padding: 0; border: 0;
  opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none;
}
