@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&family=Zilla+Slab:wght@500;600;700&display=swap");

:root {
  --ink: #211a24;
  --ink-soft: #5d5462;
  --berry: #5a2150;
  --berry-deep: #3f1438;
  --leaf: #43603c;
  --leaf-tint: #e3ebdf;
  --blossom: #f1e4ea;
  --field: #f7f7f2;
  --paper: #ffffff;
  --line: #d9d6d2;
  --warn-bg: #fff4d6;
  --warn-ink: #7a5300;
  --danger: #a4262c;
  --danger-tint: #f8e1e1;
  --radius-sm: 4px;
  --radius-md: 10px;
  --focus: 0 0 0 3px #f7f7f2, 0 0 0 5px #5a2150;
  --display: "Zilla Slab", Georgia, serif;
  --body: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--berry); text-underline-offset: 3px; }
a:hover { color: var(--berry-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

/* ---------- signer pages ---------- */
.sign-shell { max-width: 640px; margin: 0 auto; padding: 0 16px 4rem; }
.brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.5rem 0 1.25rem; border-bottom: 2px solid var(--ink); margin-bottom: 2rem;
}
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.brand-place { font-size: .875rem; color: var(--ink-soft); }

.lede { font-size: 1.125rem; color: var(--ink-soft); max-width: 34em; margin-top: .75rem; }

.form-list { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.form-list li { border-bottom: 1px solid var(--line); }
.form-list a {
  display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: center;
  padding: 1.15rem .25rem; text-decoration: none; color: var(--ink);
}
.form-list a:hover { background: var(--blossom); }
.form-list .t { font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.form-list .d { grid-column: 1; color: var(--ink-soft); font-size: .9375rem; }
.form-list .chev { grid-row: 1 / span 2; grid-column: 2; color: var(--berry); font-size: 1.5rem; line-height: 1; }

.help { margin-top: 2.5rem; font-size: .9375rem; color: var(--ink-soft); }

/* form */
.section { margin: 2.5rem 0 0; }
.section > h2 { margin-bottom: .35rem; }
.section > .hint { color: var(--ink-soft); font-size: .9375rem; margin-bottom: 1.25rem; }
.field { margin-bottom: 1.1rem; }
.field label, .field .label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.field .opt { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid #b9b4b0; border-radius: var(--radius-sm); padding: .7rem .8rem; min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--berry); box-shadow: 0 0 0 3px rgba(90,33,80,.18); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.check { display: flex; gap: .75rem; align-items: flex-start; padding: .25rem 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: .15rem 0 0; accent-color: var(--berry); flex: none; }

.minor {
  border-left: 3px solid var(--leaf); background: var(--leaf-tint);
  padding: 1rem 1rem .25rem; margin-bottom: 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.minor-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .75rem; }
.minor-head h3 { font-size: 1.05rem; }

/* waiver text */
.waiver-text {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.25rem 1.25rem .5rem; font-size: .9375rem; line-height: 1.65;
}
.waiver-text h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
.waiver-text h3:first-child { margin-top: 0; }
.clause { border-top: 1px dashed var(--line); padding-top: .75rem; margin-top: .75rem; }
.initial {
  display: flex; align-items: center; gap: .75rem; margin: .5rem 0 1rem;
  font-size: .875rem; color: var(--ink-soft);
}
.initial input { width: 5.5rem; min-height: 44px; text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

/* the statutory warning: the one loud element */
.ga-warning {
  background: #fff; border: 6px solid #000; color: #000;
  padding: 1.25rem 1.25rem 1.1rem; margin: 1.5rem 0; position: relative;
}
.ga-warning::before {
  content: ""; position: absolute; inset: 5px; border: 1.5px solid #000; pointer-events: none;
}
.ga-warning .w-head {
  font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1; letter-spacing: .04em; margin-bottom: .6rem;
}
.ga-warning p { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.4; margin: 0; }
.ga-warning .cite { display: block; font-family: var(--body); font-weight: 400; font-size: .75rem; margin-top: .75rem; color: #333; }

/* signature */
.sig-wrap { position: relative; background: var(--paper); border: 1.5px solid #b9b4b0; border-radius: var(--radius-sm); }
.sig-wrap.signed { border-color: var(--leaf); }
.sig-canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sig-line {
  position: absolute; left: 1.25rem; right: 1.25rem; bottom: 42px; border-bottom: 1.5px solid var(--ink-soft);
  pointer-events: none;
}
.sig-x { position: absolute; left: 1.25rem; bottom: 46px; font-family: var(--display); font-size: 1.5rem; color: var(--ink-soft); pointer-events: none; }
.sig-placeholder { position: absolute; left: 0; right: 0; top: 40%; text-align: center; color: #a19aa4; pointer-events: none; }
.sig-wrap.signed .sig-placeholder { display: none; }
.sig-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; font-size: .875rem; color: var(--ink-soft); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1 var(--body); padding: .95rem 1.4rem; min-height: 48px;
  border-radius: var(--radius-sm); border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-deep); color: #fff; }
.btn-primary[disabled] { background: #b8a9b5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--berry); border-color: currentColor; }
.btn-ghost:hover { background: var(--blossom); }
.btn-text { background: none; border: none; color: var(--berry); font: 600 .9375rem var(--body); cursor: pointer; padding: .25rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-block { width: 100%; }
.submit-area { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.submit-area .legal { font-size: .8125rem; color: var(--ink-soft); margin-top: .75rem; }
.errors { background: var(--danger-tint); color: var(--danger); border-left: 3px solid var(--danger); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9375rem; display: none; }
.errors.show { display: block; }

/* confirmation */
.done-mark { width: 72px; height: 72px; margin: 1rem 0 1.25rem; }
.receipt { margin: 2rem 0; border-top: 1px solid var(--line); }
.receipt div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.receipt dt { color: var(--ink-soft); }
.receipt dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- admin ---------- */
.admin-top {
  background: var(--berry-deep); color: #fff;
}
.admin-top-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 2rem; min-height: 60px; flex-wrap: wrap; }
.admin-top .brand-name { color: #fff; font-size: 1.1rem; }
.admin-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.admin-nav a { color: #e8d6e3; text-decoration: none; padding: .45rem .75rem; border-radius: var(--radius-sm); font-weight: 500; font-size: .9375rem; }
.admin-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-nav a[aria-current=page] { background: rgba(255,255,255,.16); color: #fff; }
.admin-who { margin-left: auto; font-size: .875rem; color: #e8d6e3; }

.admin-shell { max-width: 1180px; margin: 0 auto; padding: 2rem 16px 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: .35rem 0 0; color: var(--ink-soft); }

.attention {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  background: var(--warn-bg); border: 1px solid #ecd796; border-radius: var(--radius-md);
  padding: 1rem 1.25rem; margin-bottom: 1.75rem;
}
.attention .count { font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--warn-ink); line-height: 1; }
.attention p { margin: 0; }
@media (max-width: 640px) { .attention { grid-template-columns: auto 1fr; } .attention .btn { grid-column: 1 / -1; } }

.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search] { max-width: 320px; flex: 1 1 220px; }
.toolbar select { width: auto; flex: 0 1 220px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1.5px solid #b9b4b0; background: var(--paper); color: var(--ink); border-radius: 999px;
  padding: .4rem .9rem; font: 500 .875rem var(--body); cursor: pointer; min-height: 36px;
}
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: .8125rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfbf8; }
td { padding: .8rem 1rem; border-bottom: 1px solid #ecebe7; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbf7f9; }
td .who { font-weight: 600; }
td .sub { color: var(--ink-soft); font-size: .8125rem; }
td a.row-link { color: var(--ink); text-decoration: none; }
td a.row-link:hover .who { color: var(--berry); text-decoration: underline; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-soft); }

.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-current { background: var(--leaf-tint); color: var(--leaf); }
.s-soon { background: var(--warn-bg); color: var(--warn-ink); }
.s-expired { background: var(--danger-tint); color: var(--danger); }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.facts { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.25rem; }
.facts h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.facts dl { margin: 1rem 0 0; }
.facts dl div { padding: .6rem 0; border-top: 1px solid #ecebe7; }
.facts dt { font-size: .8125rem; color: var(--ink-soft); }
.facts dd { margin: .1rem 0 0; font-weight: 500; }
.facts .actions { display: grid; gap: .6rem; margin-top: 1.25rem; }
.audit { font-size: .8125rem; color: var(--ink-soft); margin-top: 1.25rem; }
.audit li { margin-bottom: .35rem; }
.doc-frame { background: #e9e7e3; border-radius: var(--radius-md); padding: 1.5rem; }
.doc-frame iframe { width: 100%; height: 1100px; border: none; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 24px rgba(33,26,36,.1); }
.back { display: inline-block; margin-bottom: 1rem; font-weight: 500; }

/* forms settings */
.form-rows { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.form-row { display: grid; grid-template-columns: 1fr 180px 160px auto; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; border-bottom: 1px solid #ecebe7; }
.form-row:last-child { border-bottom: none; }
.form-row .t { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.form-row .d { color: var(--ink-soft); font-size: .875rem; }
.form-row .link { font-size: .8125rem; color: var(--ink-soft); word-break: break-all; }
.form-row label { font-size: .8125rem; color: var(--ink-soft); display: block; margin-bottom: .2rem; }
.form-row select { min-height: 40px; padding: .45rem .6rem; }
@media (max-width: 820px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row > :first-child { grid-column: 1 / -1; } }
.toggle { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; }
.toggle input { width: 20px; height: 20px; accent-color: var(--leaf); }

.qr-card { display: flex; gap: 1.25rem; align-items: center; margin-top: 2rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.25rem; flex-wrap: wrap; }
.qr { width: 120px; height: 120px; flex: none; }

/* hub */
.hub { max-width: 760px; margin: 0 auto; padding: 3rem 16px; }
.hub ol { padding-left: 1.25rem; }
.hub li { margin-bottom: .9rem; }
.hub li span { display: block; color: var(--ink-soft); font-size: .9375rem; }
.hub h2 { margin: 2.25rem 0 .75rem; }

@media (prefers-reduced-motion: no-preference) {
  .done-mark path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .7s .15s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* admin additions */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a.chip { text-decoration: none; display: inline-flex; align-items: center; }
a.chip[aria-current=page] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag { display: inline-block; margin-left: .5rem; font-size: .75rem; font-weight: 600; padding: .1rem .45rem; border-radius: var(--radius-sm); background: var(--blossom); color: var(--berry-deep); }
tr.superseded td { color: var(--ink-soft); }
.notice { padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1.25rem; }
.notice-ok { background: var(--leaf-tint); color: var(--leaf); border-left: 3px solid var(--leaf); }
.notice-error { background: var(--danger-tint); color: var(--danger); border-left: 3px solid var(--danger); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .875rem; margin-top: .25rem; }
