:root {
  color-scheme: light;
  --paper: #f9f7f4;
  --white: #fffdfb;
  --ink: #26213a;
  --muted: #635e70;
  --line: #e3dde4;
  --violet: #584081;
  --dark: #35244e;
  --lilac: #ede6fa;
  --soft-lilac: #f6f1fb;
  --green: #255c4c;
  --green-bg: #e8f3ec;
  --red: #8b2d43;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
a { color: var(--violet); }
a:hover { color: var(--dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid #7650ae; outline-offset: 3px; }
.frame { max-width: 1144px; margin-inline: auto; padding-inline: 32px; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: absolute; z-index: 2; background: var(--white); padding: .7rem 1rem; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  display: inline-flex; flex: none; align-items: center;
  background: var(--white);
}
.brand img { display: block; width: 176px; height: auto; }
.topbar-aside { display: flex; align-items: center; gap: .85rem; }
.business-logo { width: auto; max-width: 105px; height: 33px; object-fit: contain; }
.business-logo[hidden] { display: none; }
.topbar-label, .eyebrow {
  font-size: .7rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase;
}
.topbar-label { color: var(--violet); background: var(--soft-lilac); padding: .5rem .8rem; border-radius: 999px; }
.eyebrow { color: var(--violet); }
.hero {
  isolation: isolate; position: relative; overflow: hidden; background: var(--lilac); border: 1px solid #e2d7f2;
  border-top: 3px solid var(--brand-accent, #d4c0ed);
  border-radius: 24px; margin: 36px 0 24px; padding: clamp(30px, 5vw, 58px);
}
.hero::after, .hero::before {
  content: ''; z-index: -1; position: absolute; pointer-events: none; border: 1px solid #d9caeb; border-radius: 50%;
  height: 430px; width: 430px; right: -108px; top: -104px;
}
.hero::after { width: 368px; height: 368px; right: -77px; top: -73px; box-shadow: 0 0 0 20px #e8dff5; }
.hero h1 { margin: 10px 0 14px; font: 400 clamp(2.6rem, 7vw, 4.5rem)/.99 var(--serif); letter-spacing: -.065em; overflow-wrap: anywhere; }
.hero p:last-child { max-width: 520px; color: #4b3d61; font-size: 1rem; }
.hero .eyebrow { max-width: 30em; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(235px, 1fr); align-items: start; gap: 20px; }
.stack { display: grid; gap: 16px; min-width: 0; }
.card, .message-card {
  min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 3vw, 28px);
  background: var(--white); box-shadow: 0 4px 20px #2b1d4210; overflow-wrap: anywhere;
}
.message-card { max-width: 680px; margin: 36px auto 0; }
.message-card h1 { font: 400 2.2rem/1.1 var(--serif); margin-bottom: .6rem; }
.card h2, .card h3 { font: 400 1.65rem/1.15 var(--serif); letter-spacing: -.03em; }
.card h2 { margin-bottom: .7rem; }
.section-title { font: 400 1.85rem/1.15 var(--serif); letter-spacing: -.035em; margin: 4px 0 -4px; }
.section-intro { font-size: .9rem; color: var(--muted); margin-top: -6px; }
.doc-top { display: flex; align-items: start; gap: .9rem; margin-bottom: 1rem; }
.doc-title { flex: 1; min-width: 0; }
.doc-title .eyebrow { margin-bottom: .2rem; }
.stamp {
  flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--soft-lilac); color: var(--violet); font: 500 1.15rem var(--serif);
}
.pill { display: inline-flex; border-radius: 999px; padding: .28rem .63rem; background: var(--soft-lilac); color: var(--dark); font-size: .74rem; font-weight: 700; }
.pill.good { background: var(--green-bg); color: var(--green); }
.details { margin: 0; }
.details div { display: grid; grid-template-columns: minmax(90px, .9fr) minmax(0, 1.3fr); gap: .8rem; align-items: baseline; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.details div:last-child { border-bottom: 0; padding-bottom: 0; }
.details dt, .dim { color: var(--muted); font-size: .88rem; }
.details dd { margin: 0; font-weight: 650; font-size: .9rem; }
.document-body {
  margin-top: 1rem; padding: 16px; background: #fbf9fb; border: 1px solid var(--line); border-radius: 10px;
  white-space: pre-wrap; font-size: .91rem; overflow-wrap: anywhere;
}
.doc-actions, .action-row { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.doc-actions form { width: 100%; }
.doc-actions > .action-row { margin-top: 0; }
.btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: .6rem .9rem;
  border: 1px solid transparent; border-radius: 8px; color: white; background: var(--dark); font-size: .9rem; font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: #483267; color: white; }
.btn.secondary { color: var(--dark); border-color: #d9cbe6; background: var(--white); }
.btn.secondary:hover { background: var(--soft-lilac); }
.support { background: #f6f0fa; }
.support p + p { margin-top: .65rem; }
.disclaimer { color: var(--muted); font-size: .83rem; margin-top: .75rem; }
.error { color: var(--red); font-size: .88rem; font-weight: 650; margin-top: .7rem; }
.notice { border-left: 3px solid #96b4a2; padding-left: .75rem; color: var(--green); font-size: .88rem; margin-top: .85rem; }
.field { display: grid; gap: .33rem; min-width: 0; }
.field > span:first-child { font-size: .86rem; font-weight: 700; }
.field small, .field .optional { color: var(--muted); font-size: .78rem; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; min-height: 43px; border: 1px solid #d8d0dd; border-radius: 8px;
  background: #fff; color: var(--ink); padding: .64rem .7rem;
}
.field textarea { min-height: 100px; resize: vertical; }
.field:focus-within input, .field:focus-within select, .field:focus-within textarea { border-color: #9270b5; }
.consent { display: flex; align-items: start; gap: .5rem; font-size: .88rem; margin-top: .8rem; }
.consent input { width: 17px; height: 17px; flex: 0 0 auto; margin: .2rem 0 0; accent-color: var(--violet); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 1.2rem; }
.full { grid-column: 1 / -1; }
.package-list { display: grid; gap: .7rem; margin-top: .9rem; }
.package { padding: .8rem; border: 1px solid #e3d8ed; border-radius: 10px; background: #fcf9fd; }
.package strong { display: block; font-size: .9rem; }
.package span { color: var(--muted); font-size: .83rem; }
.footer { display: flex; justify-content: space-between; gap: .8rem; padding-block: 30px; color: var(--muted); font-size: .82rem; }
.footer strong { color: var(--ink); }
.print-meta { display: none; }

.agreement-layout { max-width: 940px; margin: clamp(20px, 4vw, 48px) auto 0; display: grid; gap: 24px; }
.agreement {
  --agreement-gutter: clamp(20px, 5vw, 54px);
  padding: var(--agreement-gutter);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-accent, #71558d);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 12px 42px #2b1d4210;
  overflow-wrap: anywhere;
}
.agreement-letterhead {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start; gap: clamp(.75rem, 4vw, 3rem);
  padding-bottom: clamp(22px, 4vw, 36px); border-bottom: 1px solid var(--line);
}
.agreement-label {
  color: var(--muted); font-size: .79rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .09em;
}
.recipient-name { margin-top: .25rem; font-size: 1.12rem; font-weight: 750; }
.agreement address { margin-top: .2rem; font-style: normal; color: var(--muted); font-size: .94rem; }
.agreement address span { display: block; }
.agreement-supplier { display: grid; justify-items: end; gap: .5rem; text-align: right; font-size: .9rem; font-weight: 700; }
.agreement-logo { display: block; width: auto; height: auto; max-width: min(100%, 205px); max-height: 102.5px; object-fit: contain; }
.agreement-logo[hidden] { display: none; }
.agreement-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.4rem; margin: 26px 0 28px; }
.agreement-heading > div { min-width: 0; }
.agreement-heading h1, .agreement-heading h2 {
  margin: .18em 0; color: var(--dark); font: 400 clamp(2rem, 5vw, 3.5rem)/1.04 var(--serif); letter-spacing: -.048em;
}
.agreement-heading .pill { margin-top: .45rem; padding: .36rem .75rem; }
.agreement section h2, .agreement section h3 { font: 400 1.55rem/1.15 var(--serif); letter-spacing: -.03em; }
.agreement-rows { margin: 0 0 24px; border-top: 1px solid var(--line); }
.agreement-rows > div {
  display: grid; grid-template-columns: clamp(110px, 18vw, 176px) minmax(0, 1fr);
  align-items: baseline; gap: clamp(.65rem, 2vw, 1.4rem); padding: .64rem 0; border-bottom: 1px solid var(--line);
}
.agreement-rows dt { color: var(--dark); font-size: clamp(1.02rem, 2vw, 1.18rem); font-weight: 750; }
.agreement-rows dd { margin: 0; font-size: .98rem; font-variant-numeric: tabular-nums; }
.agreement-review { margin-bottom: 20px; }
.agreement-disclosure { border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
.agreement-disclosure summary {
  display: list-item; cursor: pointer; padding: .85rem 1rem; list-style-position: inside;
  background: var(--soft-lilac); color: var(--dark); font-weight: 700;
}
.agreement-disclosure summary:focus-visible { outline-offset: -3px; }
.agreement-disclosure summary:hover { background: var(--lilac); }
.agreement-disclosure .agreement-prose { padding: 1rem; border-top: 1px solid var(--line); }
.agreement-prose { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: .95rem; line-height: 1.65; }
.agreement-print-copy { display: none; }
.agreement-sign, .agreement-signed { padding: 20px clamp(14px, 3vw, 26px); border: 1px solid var(--line); border-radius: 12px; }
.agreement-sign form { max-width: 500px; margin-top: .95rem; }
.agreement-signed { background: var(--green-bg); border-color: #cee1d4; color: var(--green); }
.agreement-signed p { margin-top: .4rem; }
.agreement-tools { display: flex; justify-content: flex-end; margin-top: 18px; }
.agreement-documents { margin-top: .4rem; }

@media (max-width: 720px) {
  .frame { padding-inline: 18px; }
  .topbar-inner { min-height: 64px; }
  .brand img { width: clamp(114px, 35vw, 154px); }
  .topbar-aside { gap: .5rem; }
  .business-logo { max-width: min(105px, 13vw); }
  .hero { margin-top: 20px; }
  .grid { grid-template-columns: 1fr; }
  .event-sidebar { grid-row: 1; }
  .hero::before, .hero::after { opacity: .6; }
}

@media (max-width: 500px) {
  .agreement-letterhead:has(.agreement-logo:not([hidden])) { grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); }
}

@media (max-width: 400px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar-label { letter-spacing: .08em; padding-inline: .6rem; }
  .business-logo { display: none; }
  .doc-top { flex-wrap: wrap; }
  .footer { flex-direction: column; }
  .agreement-logo { max-height: 75px; }
  .agreement-tools { justify-content: flex-start; }
}

@media print {
  @page dashabl-agreement { size: A4 portrait; margin: 17mm 18mm 20mm; }

  body { background: white; color: black; }
  .topbar, .footer, .skip, .hero, .section-title, .section-intro, .event-sidebar,
  .doc-actions, .stamp, .pill, .disclaimer { display: none !important; }
  .grid, .stack { display: block; }
  .card { box-shadow: none; border: 0; padding: 0; margin-bottom: 1.5rem; }
  .print-meta { display: block; margin: 0 0 .7rem; }
  .document-body { background: white; padding: .8rem 0; border: 0; }
  .agreement-layout { display: block; margin: 0; }
  #content:has(.agreement.print-target), body:not(.printing) #content:has(.agreement) { max-width: none; padding-inline: 0; }
  .agreement { page: dashabl-agreement; background: white; box-shadow: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
  body:not(.printing) .agreement + .agreement { break-before: page; }
  .agreement-letterhead, .agreement-heading, .agreement-rows > div, .agreement-signed { break-inside: avoid; }
  .agreement-letterhead { padding-bottom: 6mm; }
  .agreement-heading { margin: 7mm 0 6mm; }
  .agreement-heading :is(h1, h2) { font-size: 26pt; line-height: 1.12; }
  .agreement-rows { margin-bottom: 6mm; }
  .agreement-rows > div { grid-template-columns: 42mm minmax(0, 1fr); padding-block: 2.8mm; }
  .agreement-rows dt { font-size: 12pt; }
  .agreement-rows dd { font-size: 11pt; }
  .agreement-signed { background: white; padding: 4mm 5mm; }
  .agreement-review, .agreement-sign, .agreement-tools { display: none !important; }
  .agreement-print-copy { display: block; page-break-before: always; break-before: page; }
  .agreement-print-copy header { border-bottom: 1px solid var(--line); padding-bottom: 5mm; margin-bottom: 6mm; break-after: avoid; }
  .agreement-print-copy header p { color: var(--muted); font-size: 10pt; margin-bottom: 2mm; }
  .agreement-print-copy header :is(h2, h3) { font-size: 24pt; }
  .agreement-print-copy .agreement-prose { font-size: 11pt; line-height: 1.55; orphans: 3; widows: 3; }
  body.printing .agreement-documents:not(:has(.print-target)) { display: none; }
  body.printing .document:not(.print-target) { display: none; }
}
