:root {
  --accent: #1e3a5f;
  --accent-dark: color-mix(in srgb, var(--accent) 80%, black);
  --accent-tint: color-mix(in srgb, var(--accent) 7%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, white);
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #182029;
  --muted: #5d6673;
  --line: #e2e6eb;
  --line-strong: #cbd2da;
  --danger: #c0352b;
  --radius: 14px;
  --pad: 26px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
  --font: "Inter", "Noto Sans Gurmukhi", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.en { color: var(--muted); }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; }
.progress span { display: block; height: 100%; width: 0; background: color-mix(in srgb, var(--accent) 55%, #f5b301); transition: width .4s ease; }

.wrap { max-width: 720px; margin: 0 auto; padding: 32px 16px 24px; }

/* ---------- title band ---------- */
.title-block {
  position: relative; overflow: hidden;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 30px var(--pad) 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.title-block::after {
  /* quiet decorative circle */
  content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255, 255, 255, .06);
}
.title-block > * { position: relative; z-index: 1; }
.title-pa { margin: 0; font-size: 1.8rem; font-weight: 700; line-height: 1.3; }
.org {
  display: inline-block; margin: 10px 0 0; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font-size: .9rem; font-weight: 600; letter-spacing: .02em;
}
.title-en { margin: 8px 0 0; font-size: .95rem; color: rgba(255, 255, 255, .78); }
.title-en:empty, .org:empty { display: none; }
.intro { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: .95rem; }
.intro .en { display: block; font-size: .85rem; color: rgba(255, 255, 255, .72); }
.req-note { margin: 12px 0 0; font-size: .82rem; color: rgba(255, 255, 255, .8); }
.req-note .req { color: #ffd3cf; }
.req-note .en { color: rgba(255, 255, 255, .65); margin-left: 4px; }
.req { color: var(--danger); }

/* ---------- sections ---------- */
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  animation: rise .45s ease both;
}
.section:nth-child(2) { animation-delay: .05s; }
.section:nth-child(3) { animation-delay: .1s; }
.section:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.section-head { display: flex; align-items: center; gap: 12px; padding: 18px var(--pad) 4px; }
.section-num {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .95rem;
}
.section-head h2 { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.section-head .en { display: block; font-size: .8rem; font-weight: 500; }
.section-body { padding: 4px var(--pad) 16px; }

/* ---------- fields ---------- */
.field { padding: 14px 0; }
.field + .field, .field + .cond, .cond + .field, .cond + .cond { border-top: 1px dashed var(--line); }
.q-label { display: block; }
.q-label .pa { font-size: .97rem; font-weight: 600; }
.q-label .en, .bi .en { display: block; font-size: .8rem; font-weight: 400; margin-top: 1px; }

.input {
  display: block; width: 100%; height: 46px; margin-top: 8px; padding: 0 14px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: #fbfcfd;
  border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #9aa2ad; }
.input:hover { border-color: #b3bbc5; }
.input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent); }
.input:disabled { background: #f1f3f5; color: #9aa2ad; cursor: not-allowed; }
textarea.input { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6673' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- choices ---------- */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.opt {
  position: relative; display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; cursor: pointer; user-select: none;
  background: #fbfcfd; border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.opt:hover { border-color: #b3bbc5; background: #fff; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .box {
  flex: none; width: 19px; height: 19px; margin-top: 2px;
  display: grid; place-items: center;
  border: 1.5px solid #8d96a1; border-radius: 5px; background: #fff;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.opt .box svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.opt.checkbox input:checked + .box { background: var(--accent); border-color: var(--accent); }
.opt.checkbox input:checked + .box svg { opacity: 1; transform: none; }
.opt.radio .box { border-radius: 50%; }
.opt.radio .box svg { display: none; }
.opt.radio input:checked + .box { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3.5px #fff; }
.opt input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt .t .pa { font-size: .95rem; font-weight: 500; }
.opt .t .en { font-size: .78rem; }

/* ---------- conditional ---------- */
.cond { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .3s ease, opacity .25s ease; }
.cond > .cond-inner { overflow: hidden; min-height: 0; }
.cond.is-hidden { grid-template-rows: 0fr; opacity: 0; border-top-color: transparent !important; }

/* ---------- team table ---------- */
.team { margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fbfcfd; }
.team-head, .team-row {
  display: grid; grid-template-columns: 30px repeat(var(--cols), minmax(0, 1fr)) 32px;
  gap: 8px; align-items: center; padding: 8px 12px;
}
.team-head { background: #f1f4f7; border-bottom: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
.team-head .en { font-weight: 400; font-size: .74rem; }
.team-row { position: relative; }
.team-row + .team-row { border-top: 1px solid var(--line); }
.team-row.added { animation: rise .3s ease both; }
.team-row .n { font-size: .85rem; font-weight: 700; color: var(--accent); }
.tcell { display: block; min-width: 0; }
.tcell .tl { display: none; }
.tcell .input { margin-top: 0; height: 40px; background: #fff; }
.rm {
  width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #8d96a1;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.rm:hover { background: #fdecea; color: var(--danger); }
.rm[hidden] { display: grid; visibility: hidden; }
.hint { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }
.hint .en { margin-left: 4px; }

.note { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff8e6; font-size: .88rem; color: #8a5300; }
.note .en { color: #8a5300; opacity: .8; }

/* ---------- errors ---------- */
.err { display: none; margin-top: 6px; font-size: .85rem; color: var(--danger); }
.err .en { color: var(--danger); opacity: .8; }
.has-error .err { display: block; animation: fadeIn .2s ease; }
.has-error .input:not(:disabled), .has-error .opt, .has-error .team { border-color: var(--danger); }

/* ---------- submit ---------- */
.submit-wrap { margin-top: 6px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 0 22px;
  font: inherit; font-size: 1.02rem; font-weight: 600; color: #fff;
  background: var(--accent); border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.btn:disabled { opacity: .7; cursor: wait; transform: none; }
.btn small { font-weight: 400; opacity: .8; }
.btn.ghost { width: auto; display: inline-flex; color: var(--accent); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-tint); }
.spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.loading .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status { margin: 10px 0 0; text-align: center; font-size: .9rem; }
.form-status:empty { display: none; }
.form-status.err-text { color: var(--danger); }
.form-status .en { display: block; font-size: .8rem; color: inherit; opacity: .8; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- result screens ---------- */
.state { text-align: center; padding: 44px var(--pad); }
.state h2 { margin: 0; font-size: 1.45rem; font-weight: 700; }
.state h2 .en { display: block; font-size: .9rem; font-weight: 400; margin-top: 2px; }
.state p { margin: 14px auto 0; max-width: 460px; }
.state p .en { display: block; font-size: .88rem; margin-top: 4px; }
.state .btn { margin: 24px auto 0; }
.check { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; animation: pop .4s ease both; }
.check svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

.loader { width: 28px; height: 28px; margin: 60px auto; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

.demo { margin: 12px 0 0; text-align: center; font-size: .8rem; color: #8a5300; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 22px 0 8px; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  :root { --pad: 16px; --radius: 14px; }
  .wrap { padding: 12px 10px 16px; }
  .title-block { padding: 24px 18px 20px; margin-bottom: 12px; }
  .section { margin-bottom: 12px; }
  .title-pa { font-size: 1.5rem; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .grid2 > div + div { margin-top: 16px; }
  .opts { grid-template-columns: 1fr; gap: 8px; }
  .opts.opts-row { grid-template-columns: 1fr 1fr; }

  .team { border: 0; background: transparent; display: flex; flex-direction: column; gap: 10px; }
  .team-head { display: none; }
  .team-row {
    grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px;
    background: #fbfcfd; border: 1px solid var(--line-strong) !important; border-radius: 10px;
  }
  .team-row .n { grid-column: 1 / -1; font-size: 0; padding-right: 36px; }
  .team-row .n::before { content: "ਮੈਂਬਰ " attr(data-n) "  ·  Member " attr(data-n); font-size: .82rem; }
  .tcell:first-of-type { grid-column: 1 / -1; }
  .tcell .tl { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
  .rm { position: absolute; top: 6px; right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
