/* Publication d'une demi-pension — formulaire par étapes (/publier).
   Sans JavaScript (.pw sans .pw-on), toutes les étapes s'affichent à la suite. */

.pw-wrap { max-width: 720px; }
.pw [hidden] { display: none !important; }   /* l'attribut hidden l'emporte sur .btn { display: inline-flex } */
.pw-head h1 { margin-bottom: .25em; }
.pw { padding: clamp(20px, 4vw, 38px); }

/* Progression */
.pw-progress { margin: -4px 0 26px; }
.pw-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: .86rem; }
.pw-count { font-weight: 700; color: var(--green); }
.pw-time { color: var(--muted); }
.pw-bar { height: 6px; border-radius: 99px; background: var(--green-soft); overflow: hidden; }
.pw-bar i { display: block; height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .35s ease; }
.pw-dots { display: flex; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.pw-dots li { flex: 1; min-width: 0; }
.pw-dots button { width: 100%; border: 0; background: none; padding: 4px 2px; font: inherit; font-size: .76rem; font-weight: 600; color: var(--muted); cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; }
.pw-dots button b { display: inline-flex; width: 20px; height: 20px; margin-right: 5px; border-radius: 50%; align-items: center; justify-content: center; font-size: .7rem; background: var(--green-soft); color: var(--green); vertical-align: -1px; }
.pw-dots .is-done button { color: var(--ink); cursor: pointer; }
.pw-dots .is-done button b { background: var(--green); color: #fff; }
.pw-dots .is-current button { color: var(--green); }
.pw-dots .is-current button b { background: var(--gold); color: #fff; }
.pw-dots .is-done button:hover { background: var(--green-soft); }

/* Brouillon retrouvé */
.pw-draft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: 0 0 18px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--gold-soft); font-size: .88rem; }
.pw-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--gold-dark); text-decoration: underline; cursor: pointer; }

/* Étapes */
.pw-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.pw:not(.pw-on) .pw-step + .pw-step { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.pw.pw-on .pw-step { display: none; }
.pw.pw-on .pw-step.is-active { display: block; animation: pwIn .28s ease; }
@keyframes pwIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pw.pw-on .pw-step.is-active { animation: none; } .pw-bar i { transition: none; } }
.pw-q { display: block; width: 100%; padding: 0; margin: 0 0 18px; font-family: var(--font-display); font-size: clamp(1.3rem, 3.6vw, 1.6rem); font-weight: 600; color: var(--ink); line-height: 1.2; }
.pw-sub { margin: -10px 0 16px; color: var(--muted); font-size: .92rem; }

/* Choix du type */
.pw-choices { display: grid; gap: 12px; }
.pw-choice { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.pw-choice:hover { border-color: var(--green); }
.pw-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pw-choice-ico { flex: none; display: flex; width: 52px; height: 52px; border-radius: 14px; align-items: center; justify-content: center; font-size: 1.6rem; background: var(--green-soft); }
.pw-choice-txt { display: flex; flex-direction: column; gap: 3px; }
.pw-choice-txt strong { font-size: 1.04rem; }
.pw-choice-txt small { color: var(--muted); font-size: .88rem; }
.pw-choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 3px rgba(27, 42, 74, .08); }
.pw-choice:has(input:checked) .pw-choice-ico { background: var(--green); }
.pw-choice:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Photos */
.pw-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pw-drop, .field .pw-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--cream); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.pw-drop:hover, .pw-file:focus-visible + .pw-drop { border-color: var(--gold); background: var(--gold-soft); }
.pw-drop-ico { font-size: 1.9rem; }
.pw-drop strong { color: var(--green); font-size: 1rem; }
.pw-drop small { color: var(--muted); font-size: .8rem; max-width: 380px; }
.pw-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pw-thumbs:empty { display: none; }
.pw-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pw-thumb-ex { position: relative; display: block; cursor: pointer; }
.pw-thumb-ex input { position: absolute; opacity: 0; }
.pw-thumb-ex img { display: block; transition: opacity .15s, filter .15s; }
.pw-thumb-x { position: absolute; inset: auto 4px 4px 4px; padding: 1px 0; border-radius: 6px; background: rgba(255,255,255,.92); color: var(--danger); font-size: .7rem; font-weight: 700; text-align: center; opacity: 0; transition: opacity .15s; }
.pw-thumb-ex:hover .pw-thumb-x { opacity: 1; }
.pw-thumb-ex:has(input:checked) img { opacity: .35; filter: grayscale(1); }
.pw-thumb-ex:has(input:checked) .pw-thumb-x { opacity: 1; background: var(--danger); color: #fff; }

/* Puces (cases à cocher / boutons radio) */
.pw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-chip { position: relative; cursor: pointer; }
.pw-chip input { position: absolute; opacity: 0; }
.pw-chip span { display: block; padding: .45em .95em; border: 1.5px solid var(--line); border-radius: 999px; font-size: .86rem; font-weight: 600; transition: .15s; }
.pw-chip:hover span { border-color: var(--green); }
.pw-chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.pw-chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.pw-rules { display: grid; gap: 10px; }
.pw-rules > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .92rem; }

/* Jours : grosses cibles au doigt */
.pw-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pw-days .wd-opt span { padding: .75em 0; text-align: center; }

/* Prix avec unité */
.pw-suffix { position: relative; display: flex; align-items: center; }
.pw-suffix .input { padding-right: 104px; }
.pw-suffix span { position: absolute; right: 14px; color: var(--muted); font-size: .88rem; pointer-events: none; }

/* « Plus de détails » */
.pw-more { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pw-more summary { padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--green); list-style: none; }
.pw-more summary::-webkit-details-marker { display: none; }
.pw-more summary span { margin-left: 6px; font-weight: 400; font-size: .8rem; color: var(--muted); }
.pw-more[open] summary { border-bottom: 1px solid var(--line); }
.pw-more-body { padding: 14px; }
.pw-more-body .field:last-child { margin-bottom: 0; }

.pw-privacy { margin: 4px 0 0; font-size: .84rem; color: var(--muted); }

/* Description */
.pw-desc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.pw-desc-foot .hint { margin: 0; }
.pw-desc-foot .hint.is-ok { color: var(--success); }

/* Aperçu */
.pw-preview { margin-top: 6px; }
.pw-preview-lbl { margin-bottom: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pw-card { display: flex; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.pw-card-img { flex: none; display: flex; width: 104px; height: 104px; border-radius: 12px; align-items: center; justify-content: center; font-size: 2rem; background: var(--green-soft) center / cover no-repeat; }
.pw-card-img.has-img span { display: none; }
.pw-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 4px 0; }
.pw-card-body strong { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.pw-card-meta { font-size: .84rem; color: var(--muted); }
.pw-card-price { margin-top: auto; font-weight: 700; color: var(--green); }

/* Erreurs en direct */
.pw-err { margin-top: 6px; font-size: .84rem; font-weight: 600; color: var(--danger); }
.pw-err::before { content: "⚠ "; }
.field.has-err .input, .field.has-err .select, .field.has-err .textarea, .field.has-err .pw-drop, .field.has-err .galop-picker summary { border-color: var(--danger); }
.field.has-err .pw-drop { background: var(--danger-soft); }

/* Navigation */
.pw-nav { display: flex; gap: 10px; align-items: center; margin-top: 26px; }
.pw-nav [data-pw-prev] { flex: none; }
.pw-nav [data-pw-next], .pw-nav [data-pw-submit] { flex: 1; min-width: 0; justify-content: center; white-space: normal; }
.pw:not(.pw-on) .pw-nav [data-pw-submit] { width: 100%; }

@media (max-width: 640px) {
    .pw { padding: 18px 16px; border-radius: var(--radius); }
    .pw .field-row, .pw .field-row-3 { grid-template-columns: 1fr; gap: 0; }
    .pw-dots button { font-size: 0; text-align: center; }
    .pw-dots button b { margin: 0; font-size: .7rem; }
    .pw-days { gap: 4px; }
    .pw-days .wd-opt span { font-size: .78rem; padding: .8em 0; }
    .pw-choice { padding: 14px; }
    .pw-choice-ico { width: 44px; height: 44px; font-size: 1.35rem; }
    .pw-card-img { width: 84px; height: 84px; }
    .pw-nav .btn-lg { padding: .85em 1em; font-size: 1rem; }
    /* Boutons collés en bas de l'écran : toujours à portée de pouce */
    .pw.pw-on .pw-nav { position: sticky; bottom: 0; z-index: 5; margin: 22px -16px -18px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); backdrop-filter: blur(6px); }
}
