@font-face {
  font-family: "Founders Grotesk";
  src: url("./fonts/FoundersGroteskText-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Founders Grotesk";
  src: url("./fonts/FoundersGroteskText-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Founders Grotesk";
  src: url("./fonts/FoundersGroteskText-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/BricolageGrotesque-Variable.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --line: #e2e3e8;
  --line-strong: #cfd3dd;
  --text: #191b22;
  --muted: #5b6170;
  --danger: #c03636;
  --ok-bg: #edf9f1;
  --ok-line: #c6ecd2;
  --ok-text: #216744;
  --danger-bg: #fff3f3;
  --danger-line: #efcaca;
  --danger-text: #8e2525;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 56px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Founders Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.42px;
  background: linear-gradient(180deg, #f7f7f9 0%, #f2f2f4 100%);
  color: var(--text);
  line-height: 1.45;
}

.container {
  width: min(880px, 100% - 2rem);
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legal-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.legal-footer-inner {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) 0;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.page {
  padding: var(--space-7) 0 var(--space-8);
}

.intro {
  margin-bottom: var(--space-6);
}

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: 0.95rem;
}

h1 {
  font-family: "Bricolage Grotesque", "Founders Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 0 0 var(--space-4);
}

h2 {
  font-family: "Bricolage Grotesque", "Founders Grotesk", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

p {
  margin: 0;
  color: var(--muted);
}

.intro-copy {
  max-width: 62ch;
  margin-bottom: var(--space-4);
}

.intro-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.form-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-6);
  box-shadow: 0 1px 2px rgba(15, 16, 20, 0.04), 0 10px 26px rgba(15, 16, 20, 0.05);
}

form {
  display: grid;
  gap: var(--space-6);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

legend {
  font-weight: 600;
  color: var(--text);
  padding: 0 var(--space-2);
}

.field {
  display: grid;
  gap: var(--space-2);
}

label {
  color: var(--text);
  font-weight: 600;
  font-size: 0.98rem;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0.72rem 0.86rem;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input[type="file"] {
  padding: 0.55rem;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: 0;
  width: auto;
  accent-color: #2d384f;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #b9c0ce;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(63, 103, 255, 0.45);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: #96a6ca;
  box-shadow: 0 0 0 3px rgba(63, 103, 255, 0.12);
}

.field-hint {
  font-size: 0.9rem;
  color: #656b7b;
}

.field-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
}

.ai-trigger {
  border: 1px solid #4d49fc;
  border-radius: var(--radius-md);
  background: #4d49fcff;
  color: #ffffff;
  min-height: 34px;
  padding: 0.38rem 0.68rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ai-trigger:hover,
.ai-trigger:focus-visible {
  background: #4340e4;
  border-color: #4340e4;
}

.field-tool-note {
  font-size: 0.83rem;
  color: #737a8a;
}

.inline-link {
  font-size: 0.92rem;
  color: #414866;
}

.consent-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #414866;
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

code {
  background: #f3f5f9;
  border: 1px solid #dde2ec;
  border-radius: var(--radius-sm);
  padding: 0.13rem 0.32rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  word-break: break-word;
}

.radio-group .choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.choice-row label,
.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
}

.checkbox-field {
  padding-top: var(--space-1);
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

.optional-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  background: #fafbfc;
}

.optional-group[open] {
  padding-bottom: var(--space-5);
}

.optional-group summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-4);
}

.optional-group .field + .field {
  margin-top: var(--space-4);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.btn-primary {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: #ececf0;
  background:
    linear-gradient(180deg, #201e25 0%, #323137 100%) padding-box,
    linear-gradient(180deg, #4b4951 0%, #313036 100%) border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px #0d0d0d;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 6px 14px rgba(17, 17, 19, 0.2), 0 0 0 1px #0d0d0d;
}

.actions-note {
  font-size: 0.9rem;
}

.legal-doc .form-shell {
  max-width: 920px;
  margin-inline: auto;
  padding: var(--space-7);
}

.legal-doc h1 {
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin-bottom: var(--space-5);
}

.legal-doc h2 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -0.2px;
  font-weight: 600;
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid #e8ebf2;
}

.legal-doc .form-shell > h2:first-of-type {
  margin-top: var(--space-6);
}

.legal-doc p,
.legal-doc li {
  max-width: 72ch;
  font-weight: 400;
  line-height: 1.6;
  color: #4b5263;
}

.legal-doc ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.52rem;
}

.legal-doc p + p,
.legal-doc p + ul,
.legal-doc ul + p {
  margin-top: var(--space-4);
}

.legal-doc .inline-link {
  color: #2f3f75;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.legal-doc .inline-link:hover,
.legal-doc .inline-link:focus-visible {
  color: #1f2f5f;
}

.legal-doc .actions-note {
  margin-top: var(--space-7);
}

.field-error {
  margin: 0;
  font-size: 0.9rem;
  color: var(--danger);
  min-height: 1.1em;
}

.error-state {
  border-color: #d86969 !important;
  background: #fff8f8;
}

.error-summary {
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.error-title {
  color: var(--danger-text);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.error-summary ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--danger-text);
}

.success-banner {
  border: 1px solid var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok-text);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  min-height: 40px;
  padding: 0.58rem 0.98rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary {
  color: #1d1f25;
  background: #f0f2f7;
  border-color: #d2d8e6;
}

.btn-sm {
  min-height: 34px;
  padding: 0.4rem 0.72rem;
}

.consent-banner {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: min(430px, calc(100% - 1rem));
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: 0 8px 20px rgba(12, 16, 24, 0.12);
  display: grid;
  gap: 10px;
  z-index: 80;
}

.consent-banner__text {
  margin: 0;
  color: #2f3749;
  font-size: 0.86rem;
  line-height: 1.45;
}

.consent-banner__link {
  color: #3c4a78;
}

.consent-banner__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.consent-banner__btn {
  border: 1px solid #ccd2df;
  border-radius: var(--radius-md);
  min-height: 36px;
  padding: 0.45rem 0.62rem;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.consent-banner__btn-secondary {
  background: #f4f6fa;
  color: #1f2633;
}

.consent-banner__btn-secondary:hover,
.consent-banner__btn-secondary:focus-visible {
  background: #ebeff7;
  border-color: #bfc7d9;
}

.consent-banner__btn-primary {
  background: #232434;
  border-color: #232434;
  color: #f4f6fb;
}

.consent-banner__btn-primary:hover,
.consent-banner__btn-primary:focus-visible {
  background: #1c1d2b;
  border-color: #1c1d2b;
}

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

@media (max-width: 760px) {
  .container {
    width: min(880px, 100% - 1rem);
  }

  .topbar-inner {
    min-height: 58px;
  }

  .form-shell {
    padding: var(--space-5);
  }

  .legal-doc .form-shell {
    padding: var(--space-5);
  }

  .legal-doc h1 {
    margin-bottom: var(--space-4);
  }

  .legal-doc h2 {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
  }

  fieldset {
    padding: var(--space-4);
  }

  .actions {
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
  }

  .consent-banner {
    right: 8px;
    left: 8px;
    width: auto;
  }

  .consent-banner__actions {
    grid-template-columns: 1fr;
  }
}
