/* =====================================================================
   Post Wizard (/post) and photo progress tiles (SY.photoTile)
   ===================================================================== */

/* ---------- photo tiles: preparing, then uploading ---------- */
.ph-tile { position: relative; }
.ph-tile img[hidden] { display: none; }
.ph-tile .ph-ico { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; opacity: .5; animation: ph-pulse 1.2s ease-in-out infinite; }
.ph-tile.is-preparing img { filter: saturate(.4) brightness(.75); transform: scale(1.04); transition: filter .4s, transform .4s; }
.ph-tile.is-ready img { animation: ph-reveal .45s ease-out; }
.ph-prog {
    position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 1;
    display: flex; flex-direction: column; gap: 4px; padding: 6px 8px;
    border-radius: 10px; background: rgba(10, 20, 35, .72); color: #fff;
    font-size: .74rem; font-weight: 700; line-height: 1.2; backdrop-filter: blur(4px);
    transition: opacity .35s, transform .35s;
}
.ph-step { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-bar { display: block; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.ph-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #7dd3fc, #ffffff); transition: width .25s ease-out; }
.ph-tile.is-preparing .ph-bar i { background-image: linear-gradient(90deg, #7dd3fc, #fff, #7dd3fc); background-size: 200% 100%; animation: ph-flow 1s linear infinite; }
.ph-tile.is-uploading .ph-bar i { background: linear-gradient(90deg, #fbbf24, #fde68a); }
.ph-tile.ph-idle .ph-prog { opacity: 0; transform: translateY(6px); pointer-events: none; }
.ph-tile .cover { z-index: 2; }
.ph-tile.is-preparing .cover, .ph-tile.is-uploading .cover { display: none; }
.ph-tile > button { z-index: 3; }

@keyframes ph-pulse { 50% { opacity: .2; transform: scale(.92); } }
@keyframes ph-flow { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes ph-reveal { from { opacity: .3; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* Lost & Found form: the step headings are for the wizard only */
.lf-step-title { display: none; }
.modal-box { position: relative; }
.modal-close-x {
    position: absolute; top: .7rem; right: .7rem; width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: var(--bg-alt); color: var(--ink-soft); font-size: .95rem; cursor: pointer;
}
.modal-close-x:hover { color: var(--ink); }

/* ---------- "Post ad": floating button on every page ---------- */
.post-fab {
    position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90;
    display: inline-flex; align-items: center; gap: .45rem; height: 52px; padding: 0 1.25rem 0 1rem; border-radius: 99px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 1rem;
    text-decoration: none; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 4px 14px rgba(46, 119, 192, .3);
    transition: box-shadow .2s, padding .25s, gap .25s;
}
.post-fab:hover { color: #fff; box-shadow: 0 6px 20px rgba(46, 119, 192, .4); }
.post-fab:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.post-fab-plus { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.post-fab-text { white-space: nowrap; overflow: hidden; max-width: 12em; transition: max-width .25s, opacity .2s; }
/* Scrolling down tucks the label away; scrolling up brings it back (app.js) */
.post-fab.is-mini { padding: 0; width: 52px; justify-content: center; gap: 0; }
.post-fab.is-mini .post-fab-text { max-width: 0; opacity: 0; }
/* Not where it would cover a form's own buttons, nor in the wizard itself */
body[data-page="post"] .post-fab, body[data-page="auto-sell"] .post-fab, body[data-page="property-post"] .post-fab,
body[data-page="bass-join"] .post-fab, body[data-page="lf-form"] .post-fab, body[data-page="payment"] .post-fab,
body[data-page="login"] .post-fab, body[data-page="register"] .post-fab, body[data-page="app-frame"] .post-fab { display: none; }
body.svc-lock .post-fab, body.bill-open .post-fab { display: none; }
@media (max-width: 560px) {
    .post-fab { height: 50px; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font-size: .95rem; padding: 0 1.1rem 0 .9rem; }
    .post-fab.is-mini { width: 50px; }
}
@media (prefers-reduced-motion: reduce) { .post-fab { transition: none; } }

/* ---------- the wizard: full screen ---------- */
body[data-page="post"] { overflow: hidden; }
body[data-page="post"] .site-header,
body[data-page="post"] .site-footer,
body[data-page="post"] .ad-rail { display: none; }

.wiz {
    position: fixed; inset: 0; z-index: 250; display: flex; flex-direction: column;
    height: 100vh; height: 100dvh; background: var(--bg);
    animation: wiz-open .3s ease-out;
}
.wiz-top {
    flex: none; padding: .7rem 1rem .55rem; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(20, 60, 110, .06);
}
.wiz-top-row, .wiz-steps-line, .wiz-foot-in, .wiz-inner { width: min(820px, 100%); margin: 0 auto; }
.wiz-top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wiz-title { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.wiz-title strong { display: block; font-size: 1.08rem; font-weight: 800; line-height: 1.2; }
.wiz-title small { display: block; color: var(--ink-soft); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-badge {
    flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 4px 14px rgba(46, 119, 192, .3);
}
.wiz-x {
    flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg-alt);
    color: var(--ink); font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: .2s;
}
.wiz-x:hover { border-color: var(--danger); color: var(--danger); transform: rotate(90deg); }
.wiz-x:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.wiz-progress { width: min(820px, 100%); margin: .6rem auto 0; height: 8px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.wiz-progress i {
    display: block; height: 100%; width: 8%; border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .45s cubic-bezier(.3, .9, .3, 1);
}
.wiz-steps-line { display: flex; justify-content: space-between; gap: 1rem; margin-top: .35rem; font-size: .85rem; color: var(--ink-soft); }
.wiz-steps-line #wizCount { font-weight: 700; color: var(--brand); white-space: nowrap; }
.wiz-next-hint { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wiz-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.wiz-inner { padding: 1.4rem 1rem 2rem; }
.wiz-wait { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 3rem 0; color: var(--ink-soft); font-size: 1.1rem; }
.wiz-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: wiz-spin .8s linear infinite; }

.wiz-foot {
    flex: none; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(20, 60, 110, .07);
}
.wiz-foot-in { display: flex; justify-content: space-between; gap: .8rem; }
.wiz-foot .btn { min-height: 52px; font-size: 1.08rem; justify-content: center; }
.wiz-back { border: 1.5px solid var(--line); }
.wiz-back.is-off { visibility: hidden; }
.wiz-go { flex: 0 1 260px; min-width: 150px; }
.wiz-go:disabled { opacity: .5; cursor: not-allowed; }
.wiz-go .wiz-arrow { transition: transform .2s; }
.wiz-go:not(:disabled):hover .wiz-arrow { transform: translateX(4px); }
.wiz-go.is-final { background: linear-gradient(135deg, var(--success), #22c55e); box-shadow: 0 6px 20px rgba(22, 163, 74, .3); }
.wiz-go.is-final .wiz-arrow { display: none; }

/* --- step 1: what to post --- */
.wiz-h { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; line-height: 1.25; margin-bottom: .4rem; outline: none; }
.wiz-lead { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 1.3rem; }
.wiz-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.wiz-kind {
    position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; row-gap: .15rem;
    align-items: center; padding: 1.1rem 1.1rem; border-radius: 16px; border: 2px solid var(--line); background: var(--surface);
    color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s, background .2s;
    animation: wiz-rise .35s ease-out backwards;
}
.wiz-kind:nth-child(2) { animation-delay: .05s; } .wiz-kind:nth-child(3) { animation-delay: .1s; }
.wiz-kind:nth-child(4) { animation-delay: .15s; } .wiz-kind:nth-child(5) { animation-delay: .2s; }
.wiz-kind:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.wiz-kind:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.wiz-kind-ico { grid-row: span 2; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.8rem; background: var(--bg-alt); transition: transform .25s; }
.wiz-kind-name { font-size: 1.12rem; font-weight: 800; }
.wiz-kind-text { color: var(--ink-soft); font-size: .92rem; line-height: 1.4; }
.wiz-kind.is-on { border-color: var(--brand); background: var(--brand-soft); }
.wiz-kind.is-on .wiz-kind-ico { transform: scale(1.1) rotate(-6deg); background: var(--surface); }
.wiz-kind.is-on::after {
    content: '✓'; position: absolute; top: .6rem; right: .7rem; width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: .9rem; animation: wiz-pop .25s ease-out;
}

/* --- the form inside the wizard: one step at a time --- */
.wiz .pp-head, .wiz .lf-head, .wiz .pp-submit, .wiz #lfSubmit, .wiz .lf-form > .seg, .wiz .pp-n { display: none; }
.wiz .pp-narrow, .wiz .container { max-width: none; width: 100%; padding: 0; }
.wiz .pp-body, .wiz .lf-section { padding: 0; background: none; }
.wiz .lf-form { padding: 0; border: 0; box-shadow: none; background: none; }
.wiz .pp-step, .wiz .lf-step { display: none; }
.wiz .pp-step.is-current, .wiz .lf-step.is-current { display: block; }
.wiz .pp-step { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
.wiz .pp-step > legend, .wiz .lf-step-title {
    display: block; float: none; width: 100%; font-size: clamp(1.45rem, 4vw, 1.95rem); font-weight: 800; line-height: 1.25;
    margin: 0 0 1rem; outline: none;
}
.wiz .lf-step .field > span:first-child, .wiz .lf-fieldset > legend { font-size: 1.05rem; font-weight: 700; }
.wiz .lf-fieldset { border: 0; padding: 0; }
.wiz .lf-fieldset > legend { display: none; }
.wiz .wiz-in-next { animation: wiz-in-next .32s cubic-bezier(.2, .8, .3, 1); }
.wiz .wiz-in-prev { animation: wiz-in-prev .32s cubic-bezier(.2, .8, .3, 1); }
.wiz .terms-field { margin-top: 1.4rem; }
.wiz .pp-loading, .wiz #lfFormGate { margin-top: 1rem; }

/* --- sending: per-photo upload, then saving --- */
.wiz-send {
    position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 1rem;
    background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); animation: wiz-fade .2s ease-out;
}
.wiz-send[hidden] { display: none; }
.wiz-send-box {
    width: min(460px, 100%); max-height: 90%; overflow-y: auto; background: var(--surface); border-radius: 20px;
    padding: 1.6rem 1.4rem; box-shadow: var(--shadow-lg); text-align: center; animation: wiz-pop .3s ease-out;
}
.wiz-send-ico { font-size: 2.6rem; line-height: 1; margin-bottom: .5rem; animation: wiz-bob 1.4s ease-in-out infinite; }
.wiz-send.is-done .wiz-send-ico { animation: wiz-pop .4s ease-out; }
.wiz-send-box h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: .2rem; }
.wiz-send-text { color: var(--ink-soft); margin-bottom: 1rem; }
.wiz-send-all { height: 10px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.wiz-send-all i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .25s ease-out; }
.wiz-send.is-done .wiz-send-all i { background: var(--success); }
.wiz-send-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .55rem; text-align: left; }
.wiz-send-row { display: flex; align-items: center; gap: .7rem; animation: wiz-rise .3s ease-out backwards; }
.wiz-send-row img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--bg-alt); flex: none; }
.wiz-send-meta { flex: 1; display: grid; grid-template-columns: 1fr auto; row-gap: 4px; font-size: .9rem; font-weight: 700; }
.wiz-send-pct { color: var(--brand); }
.wiz-send-row.is-done .wiz-send-pct { color: var(--success); }
.wiz-send-bar { grid-column: span 2; height: 6px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.wiz-send-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #fbbf24); transition: width .2s ease-out; }
.wiz-send-row.is-done .wiz-send-bar i { background: var(--success); }

@media (max-width: 640px) {
    .wiz-top { padding: .55rem .8rem .45rem; }
    .wiz-badge { width: 34px; height: 34px; font-size: 1rem; }
    .wiz-inner { padding: 1.1rem .9rem 1.6rem; }
    .wiz-kinds { grid-template-columns: 1fr; }
    .wiz-foot { padding-inline: .8rem; }
    .wiz-foot .btn { padding-inline: 1rem; }
    .wiz-go { flex: 1 1 auto; }
    .wiz-next-hint { display: none; }
}

@keyframes wiz-open { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wiz-in-next { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes wiz-in-prev { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes wiz-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wiz-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes wiz-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wiz-spin { to { transform: rotate(360deg); } }
@keyframes wiz-bob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
    .wiz, .wiz-kind, .wiz .wiz-in-next, .wiz .wiz-in-prev, .wiz-send, .wiz-send-box, .wiz-send-ico, .wiz-send-row,
    .ph-tile .ph-ico, .ph-tile.is-ready img, .ph-tile.is-preparing .ph-bar i { animation: none; }
}

/* Messages stay above the wizard's Back / Next bar */
body[data-page="post"] .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 2100; }
