@font-face {
  font-family: "Vouchr Sans";
  src: url("/assets/fonts/archivo-variable.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vouchr Serif";
  src: url("/assets/fonts/newsreader-variable.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --private: #063f30;
  --private-deep: #031f19;
  --vouchr-green: #169565;
  --vouchr-mint: #3ab982;
  --gold: #d8a321;
  --gold-soft: #f1d37b;
  --copper: #b77a2b;
  --ink: #101615;
  --muted: #65706a;
  --paper: #f8f4ea;
  --panel: #fffaf0;
  --mist: #e9efe5;
  --line: #d6dccf;
  --danger: #a12828;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--private-deep);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Vouchr Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border-radius: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.agreement-page {
  min-height: 100vh;
}

.agreement-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.agreement-hero {
  position: relative;
  overflow: hidden;
  min-height: auto;
  padding: 22px 0;
  background:
    linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 3px no-repeat,
    linear-gradient(180deg, #fffdf8, #f8f4ea);
  border-bottom: 1px solid rgba(6, 63, 48, 0.14);
  color: var(--private);
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.hero-copy {
  display: flex;
  width: 100%;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
}

.portal-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 16px;
  padding-right: clamp(18px, 3vw, 30px);
  border-right: 1px solid rgba(6, 63, 48, 0.22);
}

.brand-mark {
  display: block;
  width: clamp(44px, 6vw, 64px);
  height: auto;
}

.brand-wordmark {
  display: block;
  width: clamp(104px, 15vw, 150px);
  height: auto;
}

.eyebrow,
.term-label,
.document-meta span,
.field span,
.signature-capture-head span {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  color: var(--private);
  font-size: clamp(1.35rem, 2.7vw, 2.2rem);
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.agreement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 52px;
  align-items: start;
  padding: 36px 0 78px;
}

.agreement-copy,
.signature-panel {
  min-width: 0;
}

.document-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 38px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -3px 0 rgba(216, 163, 33, 0.22);
}

.document-meta div {
  min-width: 0;
}

.document-meta strong {
  display: block;
  color: var(--private);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.agreement-copy h2,
.signature-panel h2 {
  margin-bottom: 14px;
  color: var(--private);
  font-size: clamp(2rem, 3.8vw, 4rem);
  font-weight: 780;
  line-height: 0.95;
}

.agreement-kicker {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 850;
  text-transform: uppercase;
}

.agreement-intro,
.terms-section p,
.term-footnote,
.panel-heading p,
.signature-success p {
  color: #27322d;
  font-family: "Vouchr Serif", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.72;
}

.agreement-intro {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.agreement-scroll {
  max-height: min(62vh, 680px);
  overflow: auto;
  padding: 0 22px 4px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-color: var(--private) #e4e8df;
}

.agreement-scroll:focus {
  outline: 2px solid rgba(216, 163, 33, 0.46);
  outline-offset: 4px;
}

.terms-section {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.terms-section h3 {
  margin-bottom: 8px;
  color: var(--private-deep);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 740;
  line-height: 1.08;
}

.terms-section .term-label {
  margin-top: 5px;
}

.terms-section p:last-child {
  margin-bottom: 0;
}

.term-footnote {
  margin: 10px 0 0;
  padding: 18px 0 18px 24px;
  border-top: 1px solid var(--line);
  border-left: 4px solid var(--gold);
}

.signature-panel {
  position: sticky;
  top: 22px;
}

.signature-form,
.signature-success {
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.96);
  box-shadow:
    inset 0 4px 0 rgba(216, 163, 33, 0.76),
    0 22px 58px rgba(7, 25, 22, 0.13);
}

.panel-heading {
  margin-bottom: 24px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span,
.signature-capture-head span {
  display: block;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #c9d1c4;
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 163, 33, 0.2);
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-option-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #b9c5b3;
  background: #fffdf8;
  color: var(--private);
  cursor: pointer;
  font-weight: 800;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-option-button:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(7, 25, 22, 0.08);
  transform: translateY(-1px);
}

.auth-option-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.google-glyph {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: #244a3c;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
}

.field small,
.signature-capture small,
.consent-stack small,
.form-error {
  display: block;
  min-height: 1.2em;
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.signature-capture {
  margin: 18px 0;
}

.signature-capture-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.signature-capture-head strong {
  color: var(--private);
}

.clear-signature-button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #c9d1c4;
  background: #fffdf8;
  color: var(--private);
  cursor: pointer;
  font-weight: 760;
  transition: border-color 160ms ease, transform 160ms ease;
}

.clear-signature-button:hover,
.print-button:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.signature-pad {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  border: 1px solid #c9d1c4;
  background:
    linear-gradient(90deg, transparent 24px, rgba(16, 44, 34, 0.62) 24px, rgba(16, 44, 34, 0.62) calc(100% - 24px), transparent calc(100% - 24px)) 0 72% / 100% 1px no-repeat,
    linear-gradient(180deg, #fffdf8, #f5efe4);
  cursor: crosshair;
  touch-action: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.signature-pad:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(7, 25, 22, 0.08);
}

.signature-capture.is-invalid .signature-pad {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(154, 49, 44, 0.14);
}

.signature-capture.is-typed .signature-pad {
  cursor: default;
}

.consent-stack {
  display: grid;
  gap: 0;
  margin: 22px 0;
  padding: 0;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.consent-stack legend {
  padding: 0 0 10px;
  color: var(--private);
  font-size: 0.9rem;
  font-weight: 850;
}

.consent-row {
  padding: 13px 14px 12px;
  border-top: 1px solid var(--line);
}

.consent-row:first-of-type {
  border-top: 0;
}

.consent-row label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  color: #25342f;
  line-height: 1.45;
}

.consent-stack input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--private);
}

.consent-stack small {
  margin: 6px 0 0 31px;
}

.sign-button,
.access-button,
.print-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border: 1px solid var(--private);
  background: var(--private);
  color: #fffaf1;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.sign-button:hover {
  border-color: var(--vouchr-green);
  background: linear-gradient(135deg, var(--private-deep), var(--private));
  transform: translateY(-1px);
}

.print-button {
  margin-top: 12px;
  background: transparent;
  color: var(--private);
}

.sign-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.honey-field {
  position: absolute;
  left: -9999px;
}

.signature-success dl {
  display: grid;
  gap: 1px;
  margin: 22px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.signature-success dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 12px;
  background: var(--mist);
}

.signature-success dt {
  color: var(--muted);
  font-weight: 800;
}

.signature-success dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.document-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.document-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.document-item h3 {
  margin-bottom: 6px;
  color: var(--private-deep);
}

.document-item p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.document-item a {
  color: var(--private);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .agreement-layout {
    animation: reveal 520ms ease both;
  }

  .agreement-layout {
    animation-delay: 120ms;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .agreement-layout,
  .document-meta,
  .terms-section {
    grid-template-columns: 1fr;
  }

  .agreement-shell {
    width: min(100% - 28px, 720px);
  }

  .agreement-hero {
    min-height: auto;
    padding: 18px 0;
  }

  .hero-copy {
    gap: 12px;
  }

  .brand-mark {
    width: 40px;
  }

  .brand-wordmark {
    width: 98px;
  }

  .portal-brand {
    gap: 12px;
    padding-right: 12px;
  }

  h1 {
    font-size: clamp(1rem, 4.7vw, 1.35rem);
  }

  .agreement-layout {
    padding-top: 34px;
  }

  .signature-panel {
    position: static;
  }

  .terms-section {
    gap: 8px;
  }

  .agreement-scroll {
    max-height: 48vh;
    padding-right: 14px;
  }
}
