/* ===== صفحات عمومی: نظرسنجی، سؤال، تشکر، ورود — سربرگ رسمی ===== */
body.pub { background: var(--ground); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 780px; margin-inline: auto; padding-inline: 20px; }

/* سربرگ: لوگو و همکار برگزاری */
.mast { background: #fff; border-bottom: 1px solid var(--line); }
.mast-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 16px; }
.mast-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mast-logo { height: 52px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.mast-name { display: flex; flex-direction: column; line-height: 1.5; }
.mast-name strong { font-size: 1.12rem; font-weight: 800; color: var(--ink); }
.mast-name small { font-size: .76rem; color: var(--muted); }
.mast-partner { font-size: .84rem; color: var(--muted); text-align: end; line-height: 1.7; max-width: 24ch; padding-inline-start: 18px; border-inline-start: 1px solid var(--line-2); }
.mast-partner span { display: block; color: var(--brass-d); font-weight: 700; font-size: .78rem; }

/* نوار عنوان همایش */
.band { background: var(--ink); color: #fff; border-bottom: 3px solid var(--brass); padding-block: 30px 32px; }
.band.thin { padding-block: 5px; }
.band h1 { font-size: clamp(1.35rem, 4.6vw, 2rem); font-weight: 700; line-height: 1.6; max-width: 30ch; text-wrap: balance; }
.band-sub { margin-top: 6px; color: #b9d3cd; font-size: .95rem; }

/* برگهٔ محتوا */
.sheet-wrap { margin-top: 28px; flex: 1; padding-bottom: 28px; }
.sheet-wrap.narrow { max-width: 500px; }
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 38px 42px 44px; }
.greet h2 { font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.greet p { margin-top: 8px; color: var(--muted); max-width: 58ch; }
.lead { color: var(--muted); margin-top: 8px; }

/* سؤال‌ها */
.q { border: 0; margin: 0; padding: 28px 0; border-top: 1px solid var(--line); min-width: 0; }
.greet + .q, .alert + .q { margin-top: 26px; }
.q legend { float: none; width: 100%; padding: 0; font-weight: 700; font-size: 1.04rem; color: var(--ink); display: flex; align-items: baseline; gap: 12px; line-height: 1.85; }
.q legend + * { clear: both; }
.qn { flex: none; min-width: 1.5em; color: var(--brass-d); font-weight: 800; font-size: 1.05rem; text-align: start; }
.opt { font-style: normal; font-weight: 400; font-size: .78rem; color: var(--muted); margin-inline-start: auto; white-space: nowrap; border: 1px solid var(--line); padding: 0 8px; border-radius: var(--r); }
.help { margin: 2px 0 0; color: var(--muted); font-size: .88rem; padding-inline-start: 40px; }
.q > :not(legend):not(.help):not(.q-err) { margin-top: 16px; margin-inline-start: 40px; }
.q-err { color: var(--bad); font-size: .88rem; padding-inline-start: 40px; margin-top: 8px; }
.q-err:empty { display: none; }
.q.has-err legend { color: var(--bad); }

/* ستاره */
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; width: max-content; max-width: 100%; direction: rtl; }
.stars input, .nps input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { cursor: pointer; display: grid; place-items: center; width: 48px; height: 48px; }
.stars svg { width: 34px; height: 34px; fill: transparent; stroke: #a9b8b5; stroke-width: 1.5; stroke-linejoin: round; transition: fill .12s, stroke .12s; }
.stars input:checked ~ label svg, .stars label:hover ~ label svg, .stars label:hover svg { fill: var(--brass); stroke: var(--brass-d); }
.stars input:focus-visible + label { outline: 2px solid var(--green); }
.star-cap { min-height: 1.6em; font-size: .9rem; color: var(--brass-d); font-weight: 700; margin-top: 4px !important; }

/* مقیاس ۰ تا ۱۰ */
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 0; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.nps label { display: grid; place-items: center; height: 48px; cursor: pointer; font-weight: 700; color: var(--ink); background: #fff; border-inline-start: 1px solid var(--line); transition: background .12s, color .12s; }
.nps input:first-of-type + label { border-inline-start: 0; }
.nps label:hover { background: var(--green-l); }
.nps input:checked + label { background: var(--ink); color: #fff; }
.nps input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: -3px; }
.nps-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px !important; }
@media (max-width: 560px) { .nps { grid-template-columns: repeat(6, 1fr); } .nps label { border-block-end: 1px solid var(--line); } }

/* گزینه‌ها */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; background: #fff; font-size: .96rem; line-height: 1.7; transition: background .12s, border-color .12s; }
.chips label:hover { border-color: var(--green); }
.chips input:checked + label { background: var(--green-l); border-color: var(--green); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--green); }
.chips input:checked + label::before { content: "✓"; color: var(--green); font-weight: 800; }
.chips input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: 2px; }

.submit-row { padding-top: 28px; border-top: 1px solid var(--line); }
.fine { text-align: center; color: var(--muted); font-size: .84rem; margin-top: 14px; }
.btn-go[disabled] { opacity: .6; cursor: progress; }

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: transparent; z-index: 20; }
.progress b { display: block; height: 100%; width: 0; background: var(--brass); transition: width .25s ease; margin-inline-start: auto; }

/* تشکر */
.thanks { text-align: center; padding-block: 52px; }
.thanks h2 { font-size: 1.35rem; font-weight: 700; color: var(--ink); margin-top: 22px; }
.seal { width: 76px; height: 76px; margin: 0 auto; border: 1.5px solid var(--brass); border-radius: 50%; display: grid; place-items: center; position: relative; }
.seal::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--brass); border-radius: 50%; opacity: .5; }
.seal svg { width: 34px; height: 34px; fill: none; stroke: var(--green); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.promo { margin: 30px auto 8px; max-width: 540px; text-align: start; border: 1px solid var(--line-2); border-top: 3px solid var(--brass); border-radius: var(--r); background: #fff; }
.promo > p { padding: 20px 24px; color: var(--text); }
.promo b { color: var(--ink); }
.promo dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.promo dl > div { padding: 14px 24px; }
.promo dl > div + div { border-inline-start: 1px solid var(--line); }
.promo dt { font-size: .8rem; color: var(--muted); }
.promo dd { margin: 2px 0 0; font-weight: 700; font-size: .95rem; color: var(--ink); }
@media (max-width: 520px) { .promo dl { grid-template-columns: 1fr; } .promo dl > div + div { border-inline-start: 0; border-top: 1px solid var(--line); } }
.err-code { font-size: 3.4rem; font-weight: 300; color: var(--brass); line-height: 1.2; letter-spacing: .05em; }

.login h2 { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.login .fld { margin-top: 18px; }
.login .btn-go { margin-top: 8px; }

.draw-note { margin-top: 14px; display: inline-block; background: var(--brass-l); color: #5e4817; border: 1px solid #e0d3b3; border-radius: var(--r); padding: 6px 14px; font-weight: 600; font-size: .92rem; }
.draw-note.center { display: block; text-align: center; margin: 20px auto 0; max-width: 540px; }
.ask-link { margin-top: 20px; color: var(--muted); font-size: .92rem; }
.ask-link.center { text-align: center; }
.ask-link a { font-weight: 700; }
.q.consult .check { margin-top: 14px; font-weight: 600; }
.q.consult .fld { margin: 12px 0 0 40px; }
.ask-box { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 28px; }
.ask-box h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.ask-box .fld { margin-top: 14px; }
.ok-box { background: var(--ok-l); border: 1px solid #bcdccb; border-inline-start: 3px solid var(--ok); color: #134d33; border-radius: var(--r); padding: 12px 16px; margin-top: 16px; font-weight: 600; }

.foot { padding: 22px 20px 30px; text-align: center; color: var(--muted); font-size: .8rem; max-width: none; border-top: 1px solid var(--line); background: #fff; }

@media (max-width: 600px) {
  .mast-in { flex-wrap: wrap; gap: 10px; }
  .mast-partner { max-width: none; text-align: start; padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--line); padding-top: 10px; width: 100%; }
  .mast-partner span { display: inline; margin-inline-end: 4px; }
  .sheet { padding: 26px 18px 32px; }
  .sheet-wrap { margin-top: 0; padding-inline: 0; }
  .sheet { border-inline: 0; border-radius: 0; }
  .q > :not(legend):not(.help):not(.q-err), .help, .q-err { margin-inline-start: 0; padding-inline-start: 0; }
  .q > :not(legend):not(.help):not(.q-err) { margin-top: 14px; }
  .q.consult .fld { margin-inline-start: 0; }
}
.band-slogan { margin: .4rem 0 0; font-size: .95rem; color: #e3d3ad; }

.mast-partner { display: flex; align-items: center; gap: 14px; max-width: none; }
.mast-partner p { max-width: 24ch; }
.mast-partner p { margin: 0; }
.cap-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cap-row img { display: block; border: 1px solid var(--line-2); max-width: 100%; height: auto; }
.cap-row input { flex: 1 1 120px; min-width: 110px; text-align: center; letter-spacing: .3em; font-size: 1.15rem; }
.cap-q { font-size: 1.2rem; padding: 10px 14px; border: 1px solid var(--line-2); background: #fff; }
.cap-new { display: inline-block; margin-top: 6px; font-size: .85rem; color: var(--green); }

/* ===== پرداخت نهایی صفحات مهمان ===== */
.q { padding-block: 18px; }
.q legend { font-weight: 600; font-size: 1rem; line-height: 1.75; }
.qn { font-weight: 600; }
.q > :not(legend):not(.help):not(.q-err) { margin-top: 10px; }
.stars label { width: 44px; height: 44px; }
.stars svg { width: 30px; height: 30px; }
.sheet h2 { font-weight: 600; }

/* ===== موتیف شبکهٔ عصبی (هوش مصنوعی) — ظریف و ثابت ===== */
.band { background: var(--ink) url("../img/neural.svg") center / cover no-repeat; }
.band.thin { background-image: none; }

/* ===== نظرسنجی گام‌به‌گام ===== */
.stepped .q, .stepped .final { border-top: 0; padding-block: 8px 4px; }
.stepped .q[hidden], .stepped .final[hidden] { display: none; }
.stepped .q legend { font-size: 1.22rem; line-height: 1.8; }
.stepped .q > :not(legend):not(.help):not(.q-err) { margin-top: 22px; }
.stephead { margin: 26px 0 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.stepcount { color: var(--brass-d); font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.nodes { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.nodes li { flex: 1; position: relative; height: 14px; display: flex; align-items: center; }
.nodes li::before { content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 100%; height: 1px; background: var(--line-2); }
.nodes li:last-child { flex: none; }
.nodes li:last-child::before { display: none; }
.nodes li::after { content: ""; position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 1.5px solid #9fb3af; flex: none; }
.nodes li.done::after { background: var(--green); border-color: var(--green); }
.nodes li.done::before { background: var(--green); }
.nodes li.on::after { width: 14px; height: 14px; background: #fff; border: 2px solid var(--brass); box-shadow: 0 0 0 3px rgba(168, 132, 66, .2); }
.stepnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.stepnav .btn { min-width: 110px; }
.stepnav [hidden] { display: none; }
.stepped .stars label { width: 56px; height: 56px; }
.stepped .stars svg { width: 38px; height: 38px; }
.stepped .nps label { height: 54px; font-size: 1.05rem; }
.stepped .chips label { padding: 12px 20px; font-size: 1rem; }
.stepped .q:not([hidden]), .stepped .final:not([hidden]) { animation: stepin .28s ease-out; }
@keyframes stepin { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .stepped .stars label { width: 48px; height: 48px; } .stepped .stars svg { width: 34px; height: 34px; } }
.stepped .stephead { margin-bottom: 20px; }
.stepped .chips { flex-direction: column; align-items: stretch; gap: 8px; max-width: 520px; }
.stepped .chips label { width: 100%; }

@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .sheet { padding: 22px 18px 26px; border-inline: 0; border-radius: 0; margin-inline: -16px; }
  .band { padding-block: 22px 24px; }
  .mast-in { gap: 12px; }
  .mast-logo { height: 44px; }
  .greet h2 { font-size: 1.15rem; }
  .stepped .q legend { font-size: 1.1rem; }
  .stepped .q > :not(legend):not(.help):not(.q-err), .help, .q-err { margin-inline-start: 0; padding-inline-start: 0; }
  /* نوار دکمه‌های گام همیشه در دسترس شست */
  .stepnav { position: sticky; bottom: 0; background: linear-gradient(to top, var(--paper) 78%, rgba(255, 255, 255, 0)); padding: 14px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 18px; z-index: 5; }
  .stepnav .btn { flex: 1; }
  .stepnav [data-prev] { flex: 0 0 38%; }
  .cap-row img { width: 100%; }
}

/* نوار گام: چسبیده به بالا هنگام اسکرول (موبایل و دسکتاپ) */
.stepped .stephead { position: sticky; top: 0; z-index: 8; background: var(--paper); margin: 0 0 14px; padding: 12px 0 12px; border-top: 0; border-bottom: 1px solid var(--line); }
.stepped .sheet, .sheet.stepped { overflow: visible; }
.stephead-in { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.stepcount { margin: 0 !important; }
.stephint { margin: 0; font-size: .8rem; color: var(--muted); }
.stepped .qn { display: none; }
.stepped .q legend { gap: 0; }
@media (max-width: 560px) {
  .stepped .stephead { margin-inline: -18px; padding-inline: 18px; box-shadow: 0 6px 10px -8px rgba(6, 50, 46, .25); }
  .stephint { display: none; }
}

/* پس از گام اول، خوش‌آمد جمع می‌شود تا سؤال بالای صفحه بماند */
.stepped.compact .greet { display: none; }
.stepnav [hidden] { display: none; }
.stepnav { gap: 10px; }
.stepnav [data-next] { margin-inline-start: auto; }
.stepped .q > :not(legend):not(.help):not(.q-err) { margin-top: 16px; }
.star-cap { min-height: 1.4em; margin-top: 0 !important; }
@media (max-width: 560px) {
  .stepnav [data-next] { flex: 1; }
  .stepnav [data-prev] { flex: 0 0 34%; }
  .stepped .q legend { font-size: 1.12rem; }
  .stepped .chips label { min-height: 52px; }
}
.steptitle { margin: 10px 0 0; font-size: .86rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.stepped.compact .steptitle { display: block; }
