/* participant pages — IGS look: white surfaces, navy bar with the logo, amber for "where you are" */
body.home, body.app { background: var(--bg); }

/* navy bar (same as igs-iran.com header) */
.bar-top { background: var(--brand); color: #fff; }
.bar-top-in { max-width: 920px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; }
.bar-top .logo { height: 34px; width: auto; display: block; }
.bar-top .tag { font-size: 13px; color: rgba(255, 255, 255, .7); border-inline-start: 1px solid rgba(255, 255, 255, .25);
  padding-inline-start: 16px; line-height: 1.5; }
.bar-top .tag b { display: block; color: #fff; font-weight: 600; font-size: 14px; }
.bar-top .spacer { flex: 1; }
.bar-top .btn.ghost { color: rgba(255, 255, 255, .8); }
.bar-top .btn.ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (max-width: 560px) { .bar-top .tag { display: none; } .bar-top .logo { height: 28px; } }

/* home */
.hero { background: var(--brand); color: #fff; padding: 34px 20px 92px; }
.hero-in { max-width: 680px; margin: 0 auto; }
.hero .eyebrow { color: var(--amber); font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.hero h1 { font-size: 26px; line-height: 1.6; margin: 6px 0 10px; font-weight: 800; }
.hero p { color: rgba(255, 255, 255, .78); margin: 0; max-width: 560px; }
.home-wrap { max-width: 680px; margin: -64px auto 0; padding: 0 20px 60px; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.steps li { background: var(--surface); padding: 16px 18px; }
.steps .n { font-size: 12px; color: var(--amber); font-weight: 700; display: block; }
.steps b { font-size: 15px; display: block; }
.steps span { display: block; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .hero h1 { font-size: 21px; } }
.form-card { padding: 26px 28px; }
.form-card h2 { margin: 0 0 18px; font-size: 18px; }
.consent { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px; font-size: 13px; color: var(--ink-2); }
.consent input { margin-top: 6px; flex: none; accent-color: var(--brand); }
.wide { width: 100%; padding: 12px; }
.switch { margin: 14px 0 0; text-align: center; }
.form-card .err { margin-bottom: 12px; }
.foot { text-align: center; color: var(--ink-3); font-size: 12.5px; margin-top: 22px; }

/* app shell */
/* only the content area scrolls; the header and the composer stay put */
body.app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.top { flex: none; z-index: 5; }
.stepper-wrap { background: var(--surface); border-bottom: 1px solid var(--line); }
.stepper { list-style: none; display: flex; gap: 0; margin: 0 auto; padding: 0 20px; max-width: 920px; }
.stepper li { flex: 1; font-size: 13px; padding: 11px 0 9px; color: var(--ink-3); border-bottom: 2px solid transparent;
  text-align: center; }
.stepper li .n { font-feature-settings: 'tnum'; margin-inline-end: 6px; }
.stepper li.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--amber); }
.stepper li.past { color: var(--brand); }
.stepper li.past .n::before { content: '✓ '; }
#main { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
#chat.stage { overflow: hidden; }

/* chat */
#chat { max-width: 820px; width: 100%; margin: 0 auto; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 20px 10px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 80%; padding: 11px 16px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.9; }
.msg.assistant { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-start-start-radius: 4px; }
.msg.user { background: var(--brand); color: #fff; align-self: flex-end; border-start-end-radius: 4px; }
.msg[data-wait]::before { content: attr(data-wait); color: var(--ink-3); font-size: 13px; }
.msg.typing::after { content: '▍'; animation: blink 1s steps(2) infinite; margin-inline-start: 2px; color: var(--amber); }
@keyframes blink { 50% { opacity: 0; } }
.msg .vtag { display: block; font-size: 11px; opacity: .75; margin-bottom: 2px; }
.chat-next { flex: none; margin: 0 20px 8px; padding: 12px 16px; background: var(--amber-soft); border: 1px solid #f6dcaa; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #2a1a00; font-weight: 700; }
.btn.amber:hover { filter: brightness(1.04); }
.composer { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 10px 20px 18px; background: var(--bg); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); background: var(--surface); border-radius: 16px;
  padding: 12px 16px; max-height: 180px; outline: none; line-height: 1.7; box-shadow: var(--shadow); }
.composer textarea:focus { border-color: var(--brand); }
.btn.icon { width: 48px; height: 48px; padding: 0; border-radius: 16px; flex: none; }
#mic.rec { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
#mic.busy { opacity: .6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }

/* test */
.test-wrap { max-width: 720px; width: 100%; margin: 0 auto; padding: 26px 20px 40px; }
.test-bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.test-bar-fill { height: 100%; background: var(--amber); width: 0; transition: width .3s; }
.test-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); margin: 10px 2px 14px; }
.q-card { padding: 26px 28px; }
.q-text { font-size: 17px; font-weight: 600; line-height: 1.95; margin: 0 0 18px; }
.q-hint { font-size: 13px; color: var(--ink-3); margin: -10px 0 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: #9fb3c8; }
.opt.sel { border-color: var(--brand); background: #f2f6fa; box-shadow: inset 3px 0 0 var(--brand); }
.opt input { margin-top: 7px; flex: none; accent-color: var(--brand); }
.opt.dk { color: var(--ink-3); border-style: dashed; }
.q-open textarea { width: 100%; min-height: 170px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: var(--surface); resize: vertical; outline: none; line-height: 1.85; }
.q-open textarea:focus { border-color: var(--brand); }
.q-open .tools { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.q-nav { display: flex; justify-content: space-between; margin-top: 18px; }

/* review */
.review-wrap { max-width: 880px; width: 100%; margin: 0 auto; padding: 26px 20px 60px; }
.review-head { padding: 20px 24px; margin-bottom: 14px; border-top: 3px solid var(--amber); }
.review-head h2 { margin: 0 0 6px; font-size: 18px; }
.review-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.busy { padding: 18px 22px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin-bottom: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.act { padding: 14px 18px; margin-bottom: 10px; }
.act-top { display: flex; gap: 8px; align-items: center; }
.act-top input { flex: 1; font-weight: 600; border: 1px solid transparent; background: transparent; padding: 6px 8px;
  border-radius: 8px; outline: none; }
.act-top input:hover, .act-top input:focus { border-color: var(--line); background: var(--surface); }
.act-desc { color: var(--ink-2); font-size: 13.5px; margin: 2px 8px 10px; }
.act-grid { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 10px; align-items: end; }
.act-grid .field { margin: 0; }
.act-grid .field input, .act-grid .field select { padding: 7px 10px; }
.wish { display: flex; gap: 4px; }
.wish button { flex: 1; padding: 7px 4px; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; cursor: pointer; }
.wish button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 640px) { .act-grid { grid-template-columns: 1fr 1fr; } .act-grid .wishf { grid-column: 1 / -1; } }
.review-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }

/* done */
.done-card { max-width: 560px; margin: 50px auto; padding: 36px 30px; text-align: center; border-top: 3px solid var(--amber); }
.done-mark { width: 60px; height: 60px; border-radius: 50%; background: var(--brand); color: var(--amber);
  display: grid; place-items: center; font-size: 28px; margin: 0 auto 12px; }
.done-card h2 { margin: 0 0 8px; }
.done-card p { color: var(--ink-2); }
