:root {
  color-scheme: light;
  --text: #111113;
  --muted: #6b6b73;
  --border: #d6d6dc;
  --border-strong: #111113;
  --surface: #f6f6f8;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem;
}

.brand {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover { color: var(--text); }

main {
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

main.narrow {
  max-width: 30rem;
  padding-top: 10vh;
}

main.wide {
  max-width: 44rem;
  padding-top: 2.5rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.625rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

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

.note,
.meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.note { margin-top: 0.75rem; }

.error {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--danger);
}

/* forms */

label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
}

input[type="email"] {
  width: 100%;
  padding: 0.8125rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[type="email"]:hover { border-color: #b4b4bd; }

input[type="email"]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

input[aria-invalid="true"] { border-color: var(--danger); }

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button,
.primary {
  display: inline-block;
  padding: 0.5625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.12s, opacity 0.12s;
}

.button:hover { border-color: var(--border-strong); }

.primary {
  padding: 0.875rem 1rem;
  border-color: var(--text);
  background: var(--text);
  color: #fff;
  font-size: 1rem;
}

.primary:hover:not(:disabled) { opacity: 0.85; }

.primary:disabled {
  border-color: #e6e6ea;
  background: #e6e6ea;
  color: #9c9ca6;
  cursor: default;
}

.button[aria-disabled="true"] {
  border-color: transparent;
  background: var(--surface);
  color: var(--muted);
}

main.narrow form .primary {
  width: 100%;
  margin-top: 1rem;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* the signature pad */

.pad {
  position: relative;
  height: 14rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.12s;
}

.pad:hover,
.pad:focus-within { border-color: var(--border-strong); }

/* the line to sign on. it is on the page, not in the saved image */
.pad::after {
  content: "";
  position: absolute;
  inset: auto 1.5rem 3.25rem;
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}

.pad canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  touch-action: none;
  cursor: crosshair;
}

.clear {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.375rem 0.625rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.clear:hover {
  background: #f1f1f4;
  color: var(--text);
}

/* the home page */

section + section { margin-top: 4.5rem; }

.hero { padding-top: 3rem; }

.hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero > p:not(.note) {
  max-width: 34rem;
  font-size: 1.125rem;
}

.start {
  display: flex;
  gap: 0.5rem;
  max-width: 28rem;
  margin-top: 2rem;
}

.start input { flex: 1; }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 1rem 0 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.steps strong {
  display: block;
  color: var(--text);
  font-weight: 650;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.price {
  margin: 0.5rem 0 1rem;
  color: var(--text);
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.price span {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0;
}

.plan ul {
  flex: 1;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.plan li { padding: 0.25rem 0; }

/* the account */

.documents {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--border);
}

.document img {
  flex: none;
  width: 60px;
  height: 78px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  object-fit: cover;
  object-position: top;
}

.about {
  flex: 1;
  min-width: 0;
}

.name {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more { height: 1px; }

.settings { margin: 0 0 2rem; }

.settings > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1.125rem 0;
  border-top: 1px solid var(--border);
}

.settings dt { color: var(--muted); }

.settings dd { margin: 0; }

.settings .meta { display: block; }

.signature {
  display: block;
  max-width: 14rem;
  max-height: 5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 34rem) {
  main.narrow { padding-top: 2rem; }
  .pad { height: 12rem; }
  .hero { padding-top: 1rem; }
  .start { flex-direction: column; }
  .plans { grid-template-columns: 1fr; }
  .settings > div { grid-template-columns: 1fr; gap: 0.25rem; }
  .document img { width: 45px; height: 58px; }
}
