/* Built phone-first: nearly every signer opens this from a text message
   standing next to a piece of equipment. Wide screens get a centered column. */

:root {
  --ink: #17181a;
  --muted: #62666d;
  --line: #e2e4e8;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #1f5c3d;
  --accent-ink: #ffffff;
  --warn: #8a5a00;
  --warn-bg: #fff7e6;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }

header.bar {
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  margin-bottom: 16px;
}
header.bar .inner { max-width: 720px; margin: 0 auto; }
header.bar h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .01em; }
header.bar p { margin: 2px 0 0; font-size: 13px; color: #b8bcc4; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

/* The agreement itself scrolls in its own box so that reaching the bottom is a
   deliberate act we can actually observe, rather than a guess about page
   scroll position on an unknown device. */
.doc {
  max-height: 58vh;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
.doc h1 { font-size: 19px; margin: 0 0 8px; }
.doc h2 { font-size: 15px; margin: 20px 0 6px; }
.doc p, .doc li { font-size: 14.5px; margin: 6px 0; }
.doc ul, .doc ol { margin: 6px 0 6px 20px; padding: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.scroll-hint {
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #f0dcae;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin: 10px 0 0;
}
.scroll-hint[hidden] { display: none; }

.disclosure {
  font-size: 13.5px;
  color: var(--muted);
  white-space: pre-line;
  border-left: 3px solid var(--line);
  padding-left: 12px;
  margin: 0;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.check:first-of-type { border-top: 0; }
.check input {
  width: 22px; height: 22px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
.check label { cursor: pointer; }

label.field { display: block; font-size: 14px; color: var(--muted); margin: 4px 0 6px; }

input[type="text"] {
  width: 100%;
  font-size: 17px;
  padding: 13px 14px;
  border: 1px solid #c9ccd2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

button.primary {
  width: 100%;
  font-size: 17px;
  font-weight: 600;
  padding: 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button.primary:disabled { background: #b9bfc4; cursor: not-allowed; }

.hash {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

.msg { font-size: 14px; padding: 12px 14px; border-radius: var(--radius); margin-top: 12px; }
.msg.err { background: #fdecec; border: 1px solid #f3c4c4; color: #8a1f1f; }
.msg[hidden] { display: none; }

.done h2 { margin: 0 0 6px; font-size: 20px; }
.done .tick {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 24px; margin-bottom: 12px;
}

.foot { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 20px; }

@media (min-width: 720px) {
  .doc { max-height: 60vh; }
}

select {
  width: 100%;
  font-size: 17px;
  padding: 13px 14px;
  border: 1px solid #c9ccd2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2362666d' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* iOS renders a date input at its own intrinsic size unless told otherwise,
   which leaves it visibly narrower than every field above it. */
input[type="date"] {
  width: 100%;
  min-height: 50px;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid #c9ccd2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  appearance: none;
}
input[type="date"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* Jeff's page: the send action is a link, not a button, because only a real
   anchor will hand an sms: URL to the phone's Messages app. */
.primary-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
}

button.secondary {
  width: 100%;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 500;
  padding: 13px;
  border: 1px solid #c9ccd2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
button.secondary:disabled { color: #9aa0a6; cursor: not-allowed; }

.msg.ok {
  background: #eaf6ee;
  border: 1px solid #bfe0cb;
  color: #1f5c3d;
}

input[type="password"] {
  width: 100%;
  font-size: 20px;
  letter-spacing: .3em;
  padding: 13px 14px;
  border: 1px solid #c9ccd2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
input[type="password"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
