/* Refonte de l'accueil : accueil guidé, Créer, Explorer. Chargé après app.css. S'appuie sur shared.css (thème sombre, .btn, .hint, :focus-visible). */
.v-home .hero { padding: clamp(24px, 7vw, 64px) 0 8px; max-width: 36rem; }
.v-home .hero h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: clamp(2.2rem, 9vw, 3.5rem); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 14px; text-wrap: balance; }
.v-home .hero .lead { font-size: 1.08rem; line-height: 1.55; margin: 0 0 22px; opacity: .8; max-width: 30rem; }
.v-home .cta-big { gap: 10px; min-height: 54px; max-width: 24rem; font-size: 17px; }
.v-home .hero .hint { margin-top: 10px; }

.v-home .sec { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 1.35rem; margin: 40px 0 14px; }

/* Les 3 étapes : c'est une vraie suite, donc numérotée */
.v-home .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.v-home .steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; align-items: start; }
.v-home .steps li::before { content: counter(s); grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; border: 1.5px solid currentColor; opacity: .75; }
.v-home .steps b { font-weight: 600; line-height: 34px; }
.v-home .steps span { opacity: .7; font-size: .95rem; line-height: 1.4; }

/* Inspirations : chaque carte reprend les couleurs de son modèle */
.v-home .insp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v-home .insp-c { appearance: none; border: 0; cursor: pointer; text-align: left; color: #fff; font: inherit; min-height: 150px; padding: 16px; border-radius: 18px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--a) 30%, transparent), transparent 62%), linear-gradient(160deg, var(--g), color-mix(in srgb, var(--g) 70%, #000)); }
.v-home .insp-c .sym { font-size: 2rem; line-height: 1; color: var(--a); }
.v-home .insp-c .lb { font-weight: 600; font-size: 1.05rem; }
.v-home .more { margin: 14px 0 0; }

/* Créer / Explorer */
.v-home .h-page { font-family: 'Fraunces', Georgia, serif; font-weight: 500; margin: 8px 0 10px; }
.v-home .step-h { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; margin: 22px 0 10px; }
.v-home .step-h .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; border: 1.5px solid currentColor; opacity: .8; }


/* Fenêtre de fin de publication : choix du téléphone, puis lien (iPhone) ou fichier hors ligne (Android).
   Les couleurs viennent du texte de la fenêtre (currentColor) et de --cta, donc elles suivent le thème. */
dialog#done .d-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 20px; opacity: .7; cursor: pointer; }
dialog#done .d-sec { margin-top: 18px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
dialog#done .d-sec[hidden] { display: none; }
dialog#done .d-q { margin: 0 0 12px; font-weight: 600; }
dialog#done .d-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog#done .d-opt, dialog#done .d-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent); background: transparent; color: inherit; font: 600 15px/1.2 -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
dialog#done .d-opt { min-height: 52px; font-size: 16px; }
dialog#done .d-opt[aria-pressed="true"] { background: var(--cta, linear-gradient(135deg, #db3a72, #b01b6c)); border-color: transparent; color: #fff; }
dialog#done .d-note { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
dialog#done .d-note p { margin: 0; font-size: 15px; line-height: 1.5; opacity: .8; }
dialog#done .d-ic { flex: 0 0 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, #db3a72 12%, transparent); color: #a21d62; }
dialog#done .d-in { width: 100%; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent); background: transparent; color: inherit; font: inherit; font-size: 15px; }
dialog#done .d-row { display: flex; flex-wrap: wrap; gap: 10px; }
dialog#done .d-row .d-btn { flex: 1 1 9.5rem; }
dialog#done .d-row .d-btn.p { flex: 2 1 13rem; }
dialog#done .d-btn.p { background: color-mix(in srgb, #db3a72 12%, transparent); border-color: color-mix(in srgb, #db3a72 30%, transparent); }
dialog#done .d-btn:disabled { opacity: .65; cursor: default; }
dialog#done .d-msg { margin: 12px 0 0; font-size: 14px; line-height: 1.45; opacity: .85; }
dialog#done .d-msg:empty { display: none; }
dialog#done .d-msg.err { color: #c0392b; opacity: 1; }
dialog#done .d-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
dialog#done .d-lnk { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
dialog#done .d-foot .d-btn { flex: 0 0 auto; min-height: 44px; font-weight: 500; }
dialog#done :is(.d-opt, .d-btn, .d-x, .d-lnk):focus-visible { outline: 2px solid #db3a72; outline-offset: 2px; }

/* Mon espace (pages.js) : cartes des pages, boutons et fenêtres Payer / Modifier.
   Tout est limité à .v-pages pour ne rien changer ailleurs. Couleurs = currentColor + --cta, donc le thème est respecté. */
.v-pages h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; margin: 8px 0 16px; }
.v-pages .item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 16px; border-radius: 18px; border: 1.5px solid color-mix(in srgb, currentColor 16%, transparent); }
.v-pages .item h3 { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 1.1rem; font-weight: 600; }
.v-pages .item .hint { flex: 1 1 100%; margin: 0; }
.v-pages .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, currentColor 10%, transparent); }
.v-pages .hint.ok { color: #1e8449; }
.v-pages .hint.err, .v-pages .err { color: #c0392b; }
.v-pages .err:empty { display: none; }

.v-pages .btn, .v-pages .link { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 999px; font: 600 15px/1.2 -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
.v-pages .btn { border: 0; background: var(--cta, linear-gradient(135deg, #db3a72, #b01b6c)); color: #fff; }
.v-pages .btn.alt { border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent); background: transparent; color: inherit; }
.v-pages .btn.sm { flex: 1 1 11rem; min-height: 44px; padding: 0 14px; font-size: 14px; }
.v-pages .btn.cta-big, .v-pages > .btn { display: flex; width: 100%; max-width: 24rem; margin-top: 8px; }
.v-pages .btn:disabled { opacity: .65; cursor: default; }
.v-pages .link { border: 0; background: none; color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.v-pages :is(.btn, .link):focus-visible { outline: 2px solid #db3a72; outline-offset: 2px; }

/* Fenêtres Payer / Modifier */
.v-pages dialog form .btn { width: 100%; margin-top: 8px; }
.v-pages dialog .link { display: flex; margin: 14px auto 0; }
.v-pages dialog .opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; margin: 0 0 10px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent); font-weight: 600; cursor: pointer; }
.v-pages dialog .opt:has(input:checked) { border-color: #db3a72; background: color-mix(in srgb, #db3a72 12%, transparent); }

/* Bouton « Supprimer » d'une page (pages.js) */
.v-pages .btn.alt.danger { color: #c0392b; border-color: color-mix(in srgb, #c0392b 35%, transparent); }

/* =====================================================================
   Affichage ordinateur / grand écran (responsive)
   Le mobile reste inchangé : tout ce qui suit ne s'applique qu'à partir de 640 px.
   Chargé en dernier (après app.css) pour pouvoir ajuster la coque et les écrans.
   ===================================================================== */

/* ---------- Tablette / petit écran : colonne un peu plus large ---------- */
@media (min-width: 640px) {
  .wrap { max-width: 720px; padding-left: 32px; padding-right: 32px; }
  header { flex-wrap: nowrap; justify-content: space-between; }
  header nav { gap: 10px; }
  header nav .link { min-width: 64px; }
  .v-home .chips { flex-wrap: wrap; overflow: visible; margin: 0 0 16px; padding: 2px 0 6px; }
  .v-admin .tabs { flex-wrap: wrap; overflow: visible; margin: 0 0 18px; padding: 2px 0 8px; }
  .v-home .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .v-home .steps li { grid-template-columns: 1fr; row-gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
  .v-home .steps li::before { grid-row: auto; }
  .v-home .steps b { line-height: 1.3; }
}

/* ---------- Ordinateur ---------- */
@media (min-width: 900px) {
  .wrap { max-width: 1120px; padding-left: 48px; padding-right: 48px; }

  /* En-tête : logo à gauche, menu à droite, un peu plus compact */
  header { padding: 20px 0 18px; }
  header .logo-i { height: 48px; }
  header .logo-n { height: 54px; }
  header nav { gap: 18px; }
  header nav .link { min-width: 72px; cursor: pointer; font-size: 12.5px; }
  header nav .link:hover i { background: var(--tint, #ffe9ee); transform: translateY(-2px); }
  header nav #account[data-out]:hover i { filter: brightness(1.08); }

  /* Application installée sur ordinateur : on garde le menu en haut (la barre du bas est faite pour le mobile) */
  html.app { --bnav: 0px; }
  html.app header { justify-content: space-between; }
  html.app header nav { position: static; left: auto; right: auto; bottom: auto; z-index: auto; width: auto; height: auto; padding: 0; gap: 18px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; justify-content: flex-end; }
  html.app header nav .link { flex: 0 0 auto; min-width: 72px; gap: 5px; font-size: 12.5px; }
  html.app header nav .link i { width: 42px; height: 42px; font-size: 17px; box-shadow: 0 8px 16px -10px var(--deep, #b01b6c); }
  html.app header nav .link[aria-current=page]::after { top: auto; bottom: -6px; left: 18%; right: 18%; }

  #app > section { min-height: 60dvh; }
  #toast { max-width: 480px; }
  dialog { width: min(92vw, 480px); }
  .v-pages dialog#ed.wide, .v-pages dialog#ed { width: min(94vw, 600px); }

  /* ----- Accueil ----- */
  .v-home { padding-bottom: 60px; }
  .v-home .hero { max-width: 50rem; padding: 56px 0 12px; }
  .v-home .hero h1 { font-size: 4.2rem; line-height: 1.02; }
  .v-home .hero .lead { font-size: 1.25rem; max-width: 36rem; margin-bottom: 28px; }
  .v-home .cta-big { min-height: 60px; font-size: 18px; max-width: 26rem; }
  .v-home .sec { font-size: 1.7rem; margin: 64px 0 20px; }
  .v-home .steps { gap: 20px; }
  .v-home .steps li { padding: 24px; border-radius: 24px; }
  .v-home .insp { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .v-home .insp-c { min-height: 220px; padding: 20px; border-radius: 22px; transition: transform .2s ease, box-shadow .2s ease; }
  .v-home .insp-c:hover { transform: translateY(-4px); box-shadow: 0 22px 34px -22px #2b1020cc; }
  .v-home .insp-c .sym { font-size: 2.6rem; }
  .v-home .insp-c .lb { font-size: 1.15rem; }
  .v-home .more { margin-top: 24px; }

  /* ----- Créer / Explorer : colonne centrée, lisible ----- */
  .v-home #editor { max-width: 760px; margin-left: auto; margin-right: auto; }
  .v-home #explorer { max-width: 920px; margin-left: auto; margin-right: auto; }
  .v-home .h-page { font-size: 2.6rem; margin-top: 16px; }
  .v-home .card { padding: 44px 40px 34px; }
  .v-home .chip { cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
  .v-home .chip:hover { border-color: var(--deep, #b01b6c); transform: translateY(-1px); }
  .v-home #cats { max-width: 560px; }
  .v-home .bar { padding-left: 48px; padding-right: 48px; }
  .v-home .bar .btn { max-width: 480px; }

  /* ----- Création d'une page, Mon espace, Administration ----- */
  .v-creer { max-width: 760px; margin-left: auto; margin-right: auto; }
  .v-pages { max-width: 860px; margin-left: auto; margin-right: auto; }
  .v-admin { max-width: 1000px; margin-left: auto; margin-right: auto; }
  .v-creer .hero, .v-admin .hero, .v-pages .hero { padding: 24px 28px; }
  .v-creer .hero h1, .v-admin .hero h1, .v-pages .hero h1 { font-size: 1.9rem; }
  .v-creer .phone { height: min(72dvh, 640px); }
  .v-pages .phone { height: min(60dvh, 520px); }
  .v-creer .ph-grid { grid-template-columns: repeat(6, 1fr); }
  .v-pages .cta-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .v-creer .btn, .v-pages .btn.cta { max-width: 460px; margin-left: auto; margin-right: auto; }
  .v-admin .btn.sm, .v-pages .btn.sm { cursor: pointer; }
  .v-admin .row > * { flex: 1 1 200px; }

  /* Curseur « main » sur tous les éléments cliquables */
  button, [role=button], summary, label.opt, .insp-c { cursor: pointer; }
  button:disabled { cursor: default; }
}

/* ---------- Très grand écran ---------- */
@media (min-width: 1400px) {
  .wrap { max-width: 1240px; }
  .v-home .hero h1 { font-size: 4.8rem; }
}

/* =====================================================================
   Aperçus des modèles Spéciaux (Explorer et recherche) : cartes avec le modèle en miniature.
   Le modèle est rendu en 360 × 560 puis réduit à la largeur de la carte (--s posé par home.js).
   ===================================================================== */
.v-home .pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex-wrap: wrap; overflow: visible; margin: 0 0 16px; padding: 2px 0 6px; }
.v-home .pv-grid > .chip, .v-home .pv-grid > .hint { grid-column: 1 / -1; }
.v-home .pv-card { appearance: none; display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 18px;
  border: 1.5px solid color-mix(in srgb, currentColor 16%, transparent); background: transparent; transition: transform .2s ease, border-color .2s ease; }
.v-home .pv-card:focus-visible { outline: 2px solid #db3a72; outline-offset: 2px; }
.v-home .pv-frame { position: relative; display: block; aspect-ratio: 360 / 560; overflow: hidden; --s: .5;
  background: radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--a, #db3a72) 30%, transparent), transparent 62%), linear-gradient(160deg, var(--g, #3a1a33), color-mix(in srgb, var(--g, #3a1a33) 70%, #000)); }
.v-home .pv-ph { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .3s ease; }
.v-home .pv-ph .sym { font-size: 2.6rem; line-height: 1; color: var(--a, #fff); opacity: .9; }
.v-home .pv-in { position: absolute; top: 0; left: 0; width: 360px; height: 560px; overflow: hidden; transform: scale(var(--s)); transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.v-home .pv-on .pv-in { opacity: 1; }
.v-home .pv-on .pv-ph { opacity: 0; }
.v-home .pv-fail .pv-in { display: none; } /* si l'aperçu échoue : on garde les couleurs et le symbole du modèle */
.v-home .pv-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.v-home .pv-lb { font-weight: 600; font-size: .98rem; line-height: 1.25; }
.v-home .pv-sub, .v-home .pv-px { font-size: .8rem; opacity: .7; }
.v-home .pv-px { font-weight: 600; opacity: .85; }
@media (min-width: 640px) { .v-home .pv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) {
  .v-home .pv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .v-home .pv-card:hover { transform: translateY(-4px); border-color: var(--deep, #b01b6c); }
}
@media (prefers-reduced-motion: reduce) { .v-home .pv-card, .v-home .pv-in, .v-home .pv-ph { transition: none; } }
