@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Karla:wght@400;500;600;700&display=swap');
@font-face { font-family: 'Allura'; src: url('/Allura-Regular.ttf') format('truetype'); font-style: normal; font-weight: 400; font-display: block; }

:root {
  --night: #20211f;
  --paper: #f0eee7;
  --muted: #c2c0b7;
  --brass: #c3ad82;
  --line: #4b4b42;
  --subtle-line: #383a35;
  font-family: 'Karla', Arial, sans-serif;
  color: var(--paper);
  background: var(--night);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--night); border-top: 4px solid var(--brass); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
}
a { color: var(--paper); text-underline-offset: 5px; }

.top {
  position: relative;
  width: min(1160px, calc(100% - 96px));
  margin: 0 auto;
  padding: 28px 0 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand-logo { display: block; width: 224px; height: auto; }
.tag, .eyebrow {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .20em;
  text-transform: uppercase;
}
.tag { position: absolute; right: 0; color: var(--muted); }
.eyebrow { color: var(--brass); }
.shell { width: min(980px, 100%); margin: 0 auto; padding: 72px 48px 112px; }
.intro { margin: 0 0 65px; text-align: center; }
.intro h1, .sign-intro h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.025em;
}
.intro h1 { font-size: clamp(44px, 5vw, 64px); margin: 17px 0 22px; }
.intro p, .sign-intro p { max-width: 630px; color: var(--muted); font-size: 17px; line-height: 1.75; }

.card {
  margin: 0;
  padding: 37px 0 42px;
  background: transparent;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.section-head > div { display: flex; align-items: baseline; gap: 20px; }
.step { color: var(--brass); font-size: 12px; font-weight: 600; letter-spacing: .16em; }
h2 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 35px; font-weight: 500; line-height: 1.1; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 34px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--paper); font-size: 13px; font-weight: 500; letter-spacing: .025em; }
.field.wide { grid-column: 1 / -1; }
.field.narrow { max-width: 320px; }
.field input, .field textarea {
  width: 100%; min-width: 0; min-height: 49px;
  padding: 10px 2px;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #88877b;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.5;
}
.field input::placeholder, .field textarea::placeholder { color: #8d8d84; }
.field input:focus, .field textarea:focus { border-bottom-color: var(--brass); }
.field textarea { min-height: 110px; resize: vertical; }
.writer, .track { padding: 26px 0; border-top: 1px solid var(--subtle-line); }
.writer:first-child, .track:first-child { padding-top: 0; border-top: 0; }
.writer:last-child, .track:last-child { padding-bottom: 0; }
.row-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 23px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.split-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 12px; }
.split-head strong { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 116px; align-items: center; gap: 20px; min-height: 55px; border-bottom: 1px solid var(--subtle-line); font-size: 15px; }
.split-row input { width: 100%; min-height: 48px; padding: 6px 2px; color: var(--paper); background: transparent; border: 0; border-bottom: 1px solid #88877b; border-radius: 0; text-align: right; font-size: 16px; }
.total { margin-top: 10px; text-align: right; color: var(--brass); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.total.bad { color: #e8a99e; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--paper); font-size: 14px; line-height: 1.5; }
.check input { width: 19px; height: 19px; flex: none; accent-color: var(--brass); }

.primary, .secondary {
  min-height: 50px;
  padding: 12px 23px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1.45;
  text-transform: uppercase;
  transition: background .2s, color .2s, border-color .2s;
}
.primary { color: var(--night); background: var(--paper); border: 1px solid var(--paper); }
.primary:hover { background: var(--brass); border-color: var(--brass); }
.secondary { color: var(--paper); background: transparent; border: 1px solid #88877b; }
.secondary:hover { color: var(--night); background: var(--paper); border-color: var(--paper); }
.text-button { min-height: 40px; padding: 4px 0; color: var(--brass); background: none; border: 0; font-size: 12px; letter-spacing: .08em; text-decoration: underline; text-underline-offset: 4px; }
.actions { display: flex; align-items: center; gap: 25px; margin: 37px 0 65px; }
.actions p { max-width: 390px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.notice { margin: 22px 0; padding: 15px 18px; white-space: pre-line; font-size: 14px; line-height: 1.6; }
.error { color: #f0c7c0; background: #3b2927; border-left: 2px solid #e8a99e; }

.result { margin-top: 20px; border-top-color: var(--brass); }
.result h2 { margin: 12px 0 15px; }
.result p { max-width: 650px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.result-preview { margin-top: 23px; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid var(--subtle-line); }
.link-row:first-child { margin-top: 27px; }
.link-row strong, .link-row small { display: block; }
.link-row strong { font-size: 15px; font-weight: 600; }
.link-row small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.result-footer { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
pre { padding: 20px; overflow: auto; color: var(--paper); background: #292b27; border: 1px solid var(--line); font-size: 12px; line-height: 1.6; }

.sign-shell { width: min(1040px, 100%); margin: 0 auto; padding: 66px 48px 110px; }
.sign-intro { max-width: 720px; margin-bottom: 30px; }
.sign-intro h1 { margin: 16px 0; font-size: clamp(46px, 6vw, 76px); }
.subtle { color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.pdf-frame { display: block; width: 100%; height: min(72vh, 850px); background: #fff; border: 1px solid var(--paper); border-radius: 0; }
.sign-control { max-width: 660px; margin-top: 40px; }
.sign-control h2 { margin-bottom: 12px; }
.tabs { display: flex; gap: 10px; margin: 26px 0 17px; }
.tabs button[aria-selected="true"] { color: var(--night); background: var(--brass); border-color: var(--brass); }
.signature-canvas { display: block; width: 100%; height: 190px; background: #f8f7f4; border: 1px solid var(--paper); border-radius: 0; touch-action: none; }
.typed-signature-preview { display: flex; align-items: center; min-height: 100px; margin-top: 18px; padding: 14px 20px; overflow: hidden; color: #141414; background: #f8f7f4; border: 1px solid var(--paper); font-family: 'Allura', cursive; font-size: 32px; line-height: 1.15; white-space: nowrap; }
.sign-action { margin-top: 25px; }
#done { max-width: 680px; margin-top: 42px; border-top-color: var(--brass); }
#done h2 { margin-bottom: 18px; }
#done p { color: var(--muted); line-height: 1.7; }
#finalLink { display: inline-flex; align-items: center; text-decoration: none; margin-top: 15px; }

@media (max-width: 650px) {
  .top { width: calc(100% - 40px); padding: 18px 0; }
  .brand-logo { width: 175px; }
  .tag { display: none; }
  .shell { padding: 50px 24px 75px; }
  .intro { margin-bottom: 43px; }
  .intro h1 { font-size: clamp(40px, 10vw, 50px); }
  .intro p { font-size: 16px; }
  .card { padding: 30px 0 36px; }
  .section-head { align-items: flex-start; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; }
  .section-head > div { gap: 14px; }
  h2 { font-size: 32px; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .field.wide { grid-column: auto; }
  .field input, .field textarea { min-height: 54px; font-size: 16px; }
  .split-row { grid-template-columns: minmax(0, 1fr) 100px; min-height: 62px; gap: 12px; }
  .split-row input { min-height: 53px; }
  .check { min-height: 56px; }
  .primary, .secondary { min-height: 54px; padding: 14px 18px; }
  .actions { display: block; margin: 30px 0 50px; }
  .actions .primary { width: 100%; }
  .actions p { margin-top: 14px; }
  .link-row { display: block; }
  .link-row button { width: 100%; margin-top: 15px; }
  .result-footer { display: grid; grid-template-columns: 1fr; }
  .sign-shell { padding: 48px 20px 72px; }
  .sign-intro h1 { font-size: clamp(44px, 11vw, 62px); }
  .pdf-frame { height: 62vh; min-height: 440px; }
  .sign-control { margin-top: 30px; }
  .tabs button { flex: 1; }
  .signature-canvas { height: 250px; }
  .sign-control .primary { width: 100%; }
  #finalLink { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .primary, .secondary { transition: none; }
}

/* Clear boxes for agreement entry and the typed-signature entry field. */
#typed,
.create-agreement .field input,
.create-agreement .field textarea,
.create-agreement .field select,
.create-agreement .split-row input {
  border: 1px solid #88877b;
  background: #262824;
  border-radius: 3px;
  padding: 11px 14px;
  transition: border-color .15s, box-shadow .15s;
}
#typed:focus,
.create-agreement .field input:focus,
.create-agreement .field textarea:focus,
.create-agreement .field select:focus,
.create-agreement .split-row input:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 2px var(--brass);
  outline: none;
}
.create-agreement .percentage-field { position: relative; }
.create-agreement .percentage-field input { padding-right: 32px; appearance: textfield; -moz-appearance: textfield; }
.create-agreement .percentage-field input::-webkit-inner-spin-button,
.create-agreement .percentage-field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.create-agreement .percentage-field > span {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
