:root {
  /* Palette mapped to the locked ITCOP / 0PN brand tokens (0pn-brand/tokens/itcop.tokens.css):
     navy #0C293C, green #468D32, teal accent #2FA9B5 (text-safe #177E8A). */
  --charter-ink: #0c293c;      /* brand navy — primary ink */
  --living-green: #468d32;     /* brand green — labels, accents */
  --green-deep: #35762a;       /* deep green — form success text (AA on light) */
  --parchment: #f5f7f8;        /* neutral-50 — page base */
  --seal-gold: #177e8a;        /* teal accent (text-safe) — focus ring */
  --teal-signal: #2fa9b5;      /* teal accent (display) — glows on dark */
  --blue-ink: #0c293c;         /* brand navy — Blue Register surface */
  --blue-signal: #2fa9b5;      /* teal accent — Blue Register glow */
  --paper-white: #ffffff;      /* neutral-0 — cards, surfaces */
  --line-soft: rgba(12, 41, 60, 0.16);
  --shadow-soft: 0 20px 50px rgba(12, 41, 60, 0.10);
  --radius-card: 1.5rem;
  --radius-button: 999px;
  --shell-width: 72rem;
  --font-display: Fraunces, "Iowan Old Style", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charter-ink);
  background:
    radial-gradient(circle at top left, rgba(70, 141, 50, 0.10), transparent 26%),
    linear-gradient(180deg, #f7f9fa 0%, var(--parchment) 45%, #f2f5f6 100%);
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

p,
ul,
h1,
h2,
h3 {
  margin: 0;
}

.shell {
  width: min(calc(100% - 2rem), var(--shell-width));
  margin: 0 auto;
}

.site-header,
.site-footer,
.story-section,
.petition-section {
  position: relative;
}

.site-header {
  padding: 1rem 0 0;
}

.header-row,
.footer-row,
.hero-layout,
.section-grid,
.badge-layout {
  display: grid;
  gap: 1.5rem;
}

.header-row,
.footer-row {
  align-items: center;
}

.brand {
  display: inline-flex;
  max-width: 22rem;
}

.language-nav {
  justify-self: start;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-button);
  background: rgba(252, 250, 244, 0.86);
  backdrop-filter: blur(8px);
}

.lang-button {
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--charter-ink);
  font: inherit;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.lang-button.is-active {
  background: var(--charter-ink);
  color: var(--paper-white);
}

.hero {
  padding: 2rem 0 4rem;
}

.hero-copy,
.badge-copy,
.badge-panel,
.notice-card,
.support-form {
  position: relative;
}

.hero-copy {
  display: grid;
  gap: 1.25rem;
  padding: 2rem 0 0.5rem;
}

.eyebrow,
.section-label {
  color: var(--living-green);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  max-width: 15ch;
}

h3 {
  font-size: 1.35rem;
}

.hero-subhead,
.section-copy p,
.section-heading p,
.badge-copy p,
.notice-list,
.field label,
.form-status,
.footer-copy {
  font-size: 1rem;
}

.hero-subhead {
  max-width: 42rem;
}

.hero-actions,
.button-row,
.form-stack {
  display: grid;
  gap: 0.85rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 3.25rem;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible,
.lang-button:hover,
.lang-button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--charter-ink);
  color: var(--paper-white);
}

.button-secondary {
  background: transparent;
  color: var(--charter-ink);
  border-color: rgba(20, 53, 42, 0.3);
}

.button-light {
  width: 100%;
  background: var(--paper-white);
  color: var(--blue-ink);
}

.story-section,
.petition-section,
.badge-section,
.site-footer {
  padding: 4rem 0;
}

.story-section::before,
.petition-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(47, 169, 181, 0.06), transparent 28%),
    transparent;
  pointer-events: none;
}

.section-grid {
  align-items: start;
}

.section-heading,
.section-copy,
.badge-copy {
  display: grid;
  gap: 1rem;
}

.section-copy p + p,
.badge-copy p + p {
  margin-top: 0.35rem;
}

.form-grid {
  gap: 2rem;
}

.support-form,
.notice-card,
.badge-panel {
  padding: 1.35rem;
  border-radius: var(--radius-card);
}

.support-form,
.notice-card {
  background: rgba(252, 250, 244, 0.9);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field label {
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(20, 53, 42, 0.22);
  border-radius: 0.95rem;
  background: #fffef9;
  color: var(--charter-ink);
  font: inherit;
}

.field input:focus-visible,
.button:focus-visible,
.lang-button:focus-visible {
  outline: 2px solid var(--seal-gold);
  outline-offset: 2px;
}

.notice-card {
  display: grid;
  gap: 0.9rem;
}

.notice-list {
  padding-left: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.form-status {
  min-height: 1.5rem;
  color: var(--green-deep);
  font-weight: 600;
}

.badge-section {
  color: var(--paper-white);
  background:
    radial-gradient(circle at top right, rgba(47, 169, 181, 0.22), transparent 28%),
    linear-gradient(180deg, var(--blue-ink) 0%, #123a4d 100%);
}

.badge-layout {
  align-items: center;
}

.badge-panel {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  background: rgba(11, 42, 74, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 60px rgba(4, 15, 27, 0.28);
}

.badge-section .section-label {
  color: #7fd3db;
}

.badge-panel img {
  filter: drop-shadow(0 0 24px rgba(47, 169, 181, 0.34));
}

.badge-provenance {
  color: #7fd3db;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: -0.35rem;
}

.badge-notice {
  width: 100%;
  display: grid;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1.1rem;
  background: rgba(4, 15, 27, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.badge-step-icon {
  display: block;
  width: 60px;
  height: 60px;
  margin: 0 auto 0.6rem;
  padding: 5px;
  background: #ffffff;
  border-radius: 50%;
  box-sizing: border-box;
}

.badge-hero-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 0.9rem;
}

.badge-gateway-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--paper-white);
  margin: 0 0 0.5rem;
}

#badge-continue {
  margin-top: 0.75rem;
}

.badge-notice-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--paper-white);
}

.badge-notice-intro {
  font-size: 0.9rem;
  color: #cdeef2;
}

.badge-notice-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.badge-form {
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.badge-receipt {
  width: 100%;
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(127, 211, 219, 0.35);
}

.badge-receipt-heading {
  color: var(--paper-white);
  font-size: 1.15rem;
}

.badge-receipt-fields {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.badge-receipt-row {
  display: grid;
  gap: 0.2rem;
}

.badge-receipt-row dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7fd3db;
}

.badge-receipt-row dd {
  margin: 0;
  font-family: "SFMono-Regular", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--paper-white);
  word-break: break-all;
}

.badge-receipt-disclaimer {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cdeef2;
}

.badge-form .field input {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--blue-ink);
}

.form-status-light {
  color: #cdeef2;
}

/* --- Newsletter opt-in toggle (Step 2) -------------------------------- */
.badge-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.4;
}

.badge-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.badge-toggle-track {
  flex: 0 0 auto;
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.32);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.badge-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper-white);
  transition: transform 0.15s ease;
}

.badge-toggle-input:checked + .badge-toggle-track {
  background: #468d32;
  border-color: #468d32;
}

.badge-toggle-input:checked + .badge-toggle-track .badge-toggle-thumb {
  transform: translateX(20px);
}

.badge-toggle-input:focus-visible + .badge-toggle-track {
  outline: 2px solid var(--seal-gold);
  outline-offset: 2px;
}

.badge-toggle-label {
  flex: 1 1 auto;
}

/* --- Receipt actions: download + copy embed (Step 3) ----------------- */
.badge-receipt-actions {
  display: grid;
  gap: 0.6rem;
}

.badge-embed-button {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(127, 211, 219, 0.5);
  border-radius: 999px;
  color: #cdeef2;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.badge-embed-button:hover {
  background: rgba(127, 211, 219, 0.12);
  border-color: #7fd3db;
}

.badge-embed-button:focus-visible {
  outline: 2px solid var(--seal-gold);
  outline-offset: 2px;
}

.badge-embed-status {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cdeef2;
}

/* --- Register toggle: inline Level 1 org fields (Step 2) -------------- */
.badge-register-inline-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cdeef2;
}

.badge-org-fields {
  width: 100%;
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: 1.1rem;
  background: rgba(4, 15, 27, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.badge-org-fields-intro {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cdeef2;
}

/* --- Directory + Level 1 queued confirmation (in receipt) ------------- */
.badge-register-confirm {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  border-radius: 1.1rem;
  background: rgba(70, 141, 50, 0.16);
  border: 1px solid rgba(70, 141, 50, 0.5);
}

.badge-register-pending {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper-white);
}

.badge-register-note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cdeef2;
}

.badge-org-level {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7fd3db;
}

.site-footer {
  padding-top: 2rem;
  border-top: 1px solid rgba(20, 53, 42, 0.1);
}

.footer-copy {
  display: grid;
  gap: 0.45rem;
}

.footer-copy a {
  text-decoration-thickness: 0.08em;
}

@media (min-width: 48rem) {
  .site-header {
    padding-top: 1.5rem;
  }

  .header-row,
  .footer-row {
    grid-template-columns: 1fr auto;
  }

  .language-nav {
    justify-self: end;
  }

  .hero {
    padding: 3rem 0 5rem;
  }

  .hero-actions,
  .button-row {
    grid-auto-flow: column;
    justify-content: start;
  }

  .section-grid,
  .badge-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 3rem;
  }

  .form-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .form-stack {
    gap: 1rem;
  }

  .support-form,
  .notice-card,
  .badge-panel {
    padding: 1.6rem;
  }
}
