/* Socious Verify demo — deliberately small, no framework.
   Primary teal matches the ShinID design tokens (#004a46 / #003b38). */

:root {
  --teal-700: #003b38;
  --teal-600: #004a46;
  --teal-100: #e2efee;

  --bg: #f7f8f8;
  --surface: #ffffff;
  --border: #e3e6e6;
  --text: #171d1c;
  --text-muted: #5c6764;

  --ok: #126b4a;
  --ok-bg: #e7f4ee;
  --no: #a92d33;
  --no-bg: #fceceb;
  --wait: #8a5a09;
  --wait-bg: #fdf3e2;

  --radius: 10px;
  --wrap: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101413;
    --surface: #171d1c;
    --border: #2b3433;
    --text: #eef1f0;
    --text-muted: #9aa5a2;
    --teal-100: #12302e;
    --ok: #6ddba4;
    --ok-bg: #12302a;
    --no: #f4a3a0;
    --no-bg: #351d1e;
    --wait: #e9c078;
    --wait-bg: #33291a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Mode banner ------------------------------------------------------ */
/* DEMO mode must be impossible to mistake for a real verification. */
.banner {
  padding: 0.6rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: repeating-linear-gradient(
    135deg,
    #8a5a09,
    #8a5a09 12px,
    #7a4f08 12px,
    #7a4f08 24px
  );
  color: #fff;
}
.banner.live {
  background: var(--teal-700);
}
.banner a { color: inherit; }

/* --- Header ----------------------------------------------------------- */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}
.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
}
@media (prefers-color-scheme: dark) {
  .eyebrow { color: #7fc6c0; }
}
h1 { margin: 0 0 0.6rem; font-size: clamp(1.75rem, 4vw, 2.4rem); line-height: 1.15; }
.lede { margin: 0; max-width: 46rem; color: var(--text-muted); }

main { padding: 2rem 0 1rem; }
section + section { margin-top: 3rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
h2 { margin: 0; font-size: 1.15rem; }

/* --- Member cards ----------------------------------------------------- */
.members { display: grid; gap: 0.85rem; }

.member {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.member-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  justify-content: space-between;
}
.member-id { margin: 0; font-weight: 650; font-size: 1.02rem; }
.member-persona { margin: 0.1rem 0 0; color: var(--text-muted); font-size: 0.875rem; }
.member-actions { display: flex; align-items: center; gap: 0.6rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.badge-ELIGIBLE { background: var(--ok-bg); color: var(--ok); }
.badge-NOT_ELIGIBLE { background: var(--no-bg); color: var(--no); }
.badge-PENDING,
.badge-NOT_STARTED { background: var(--wait-bg); color: var(--wait); }

.requirements {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.45rem;
}
.requirement {
  display: grid;
  grid-template-columns: 1.4rem minmax(9rem, auto) 1fr;
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.9375rem;
}
.requirement .mark { font-weight: 700; text-align: center; }
.state-SATISFIED .mark { color: var(--ok); }
.state-MISSING .mark,
.state-EXPIRED .mark,
.state-CONSTRAINT_FAILED .mark,
.state-UNTRUSTED_ISSUER .mark { color: var(--no); }
.requirement .reason { color: var(--text-muted); font-size: 0.875rem; }

.validation-error {
  margin: 0.8rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--no-bg);
  color: var(--no);
  font-size: 0.875rem;
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--teal-100); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible,
a:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }

/* --- How it works ----------------------------------------------------- */
.how {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.how ol { margin: 0.9rem 0 1rem; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.how li { padding-left: 0.2rem; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--teal-100);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

a { color: var(--teal-600); }
@media (prefers-color-scheme: dark) { a { color: #7fc6c0; } }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
footer { padding: 2rem 0 3rem; }

/* --- View bar --------------------------------------------------------- */
.viewbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.viewbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  flex-wrap: wrap;
}
.home {
  font-weight: 650;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--text);
}
.viewswitch { display: flex; gap: 0.35rem; font-size: 0.875rem; }
.viewswitch a,
.viewswitch span {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
}
.viewswitch a { color: var(--text-muted); }
.viewswitch a:hover { background: var(--teal-100); color: var(--text); }
.viewswitch [aria-current='page'] { background: var(--teal-600); color: #fff; font-weight: 600; }

/* --- Landing choices -------------------------------------------------- */
.choices { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.choice {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
}
.choice:hover { border-color: var(--teal-600); }
.choice h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.choice p { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.9375rem; }
.choice-cta { color: var(--teal-600); font-weight: 650; font-size: 0.9375rem; }
@media (prefers-color-scheme: dark) { .choice-cta { color: #7fc6c0; } }

/* --- Cards, fields ---------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.card .requirements { border-top: none; padding-top: 0; margin-top: 0; }

.acting-as {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}
.field { display: grid; gap: 0.3rem; font-size: 0.875rem; font-weight: 600; }
select {
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  max-width: 100%;
}
select:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }

/* --- Steps ------------------------------------------------------------ */
.steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.85rem; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.step-head { display: flex; gap: 0.9rem; align-items: flex-start; }
.step-head h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.step-head p { margin: 0; font-size: 0.9375rem; }
.step-num {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--teal-100);
  color: var(--teal-600);
}
.step-body {
  margin: 1rem 0 0 2.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.step-body > .muted.small { flex-basis: 100%; margin: 0; }

.step.is-current { border-color: var(--teal-600); }
.step.is-current .step-num { background: var(--teal-600); color: #fff; }
.step.is-done .step-num { background: var(--ok-bg); color: var(--ok); }
.step.is-done .step-num::after { content: '✓'; }
.step.is-done .step-num { font-size: 0; }
.step.is-done .step-num::after { font-size: 0.9rem; }
.step.is-waiting { opacity: 0.6; }

/* --- Ballot ----------------------------------------------------------- */
.ballot-options { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ballot-options .chosen { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.ballot-question { margin: 0 0 0.9rem; font-weight: 650; }
.vote-result { flex-basis: 100%; margin: 0.2rem 0 0; font-size: 0.9375rem; }
.vote-result.ok { color: var(--ok); font-weight: 600; }
.vote-result.error {
  color: var(--no);
  background: var(--no-bg);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
}
.vote-result.muted { color: var(--text-muted); }

.tally { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.tally-row { display: grid; grid-template-columns: 6rem 1fr 2.5rem; gap: 0.75rem; align-items: center; font-size: 0.9375rem; }
.tally-bar { background: var(--teal-100); border-radius: 999px; height: 0.6rem; overflow: hidden; }
.tally-fill { background: var(--teal-600); height: 100%; border-radius: 999px; transition: width 0.3s; }
.tally-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
