/* Red Anchor Scuba Waivers — styles
   Layout: one reading column (max 760px) under a navy brand band; a step rail across the top of the
   signing flow; the agreement sits in a bordered reading box; signature lines look like paper ones.
   Light mode only (same decision as Dive Ops: iPadOS 26 dark mode broke fields). Every color is set. */
:root {
  --navy: #1C3B63;
  --navy-deep: #142C4B;
  --red: #B71C1C;
  --teal: #0D8A6A;
  --ink: #1C2B40;
  --ink-muted: #7A8499;
  --paper: #FFFFFF;
  --paper-alt: #F1F4F9;
  --paper-page: #F6F8FB;
  --rule: #D6DBE5;
  --focus: #2F6BBF;
  --serif: Georgia, "Times New Roman", Times, serif;
  --radius: 8px;
  --col: 760px;
  color-scheme: light;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper-page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--navy); }
* { box-sizing: border-box; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; color: var(--navy); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0; }
a { color: var(--focus); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Brand band */
.band { background: var(--navy); color: #fff; }
.band-inner, .wrap {
  max-width: var(--col); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.band-inner { padding-block: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 60px; height: 60px; flex: none; border-radius: 10px; background: #fff; display: grid; place-items: center; padding: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.brand-mark img { width: 56px; height: 56px; display: block; border-radius: 8px; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.85rem; opacity: 0.8; }
.band-right { font-size: 0.85rem; opacity: 0.85; text-align: right; }

.wrap { padding-block: 24px 48px; display: grid; gap: 22px; }
.wrap > * { min-width: 0; }

/* Landing */
.lede { font-size: 1.05rem; max-width: 60ch; }
.lede strong { color: var(--navy); }
.forms { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.form-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px; display: grid; gap: 10px; align-content: start; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(28,43,64,0.06);
}
.form-card:hover:not([disabled]) { border-color: var(--navy); }
.form-card[disabled] { cursor: default; opacity: 0.72; }
.form-card .card-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.form-card p { font-size: 0.95rem; color: var(--ink); }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-red { background: var(--red); color: #fff; }
.pill-teal { background: var(--teal); color: #fff; }
.pill-grey { background: var(--paper-alt); color: var(--ink-muted); border: 1px solid var(--rule); }
.pill-navy { background: var(--navy); color: #fff; }
.card-foot { font-size: 0.85rem; color: var(--ink-muted); }

.note { border-left: 4px solid var(--navy); background: var(--paper); padding: 12px 16px; font-size: 0.95rem; border-radius: 0 var(--radius) var(--radius) 0; }
.note.red { border-left-color: var(--red); }
.note.teal { border-left-color: var(--teal); }
.note h3 { margin-bottom: 4px; }

/* Step rail */
.rail { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-muted); }
.rail .step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); white-space: nowrap; }
.rail .step .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--paper-alt); color: var(--ink-muted); }
.rail .step.on { border-color: var(--navy); color: var(--navy); font-weight: 700; }
.rail .step.on .n { background: var(--navy); color: #fff; }
.rail .step.done .n { background: var(--teal); color: #fff; }

/* Panels / fields */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; display: grid; gap: 16px; }
.panel-head { display: grid; gap: 4px; }
.panel-head .sub { color: var(--ink-muted); font-size: 0.95rem; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .lbl { font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.field .hint { font-size: 0.82rem; color: var(--ink-muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
  font-size: 1rem; min-height: 46px;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--navy); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field .err { font-size: 0.82rem; color: var(--red); }
.span2 { grid-column: 1 / -1; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); cursor: pointer; min-height: 46px; font-size: 0.98rem; }
.choices label:has(input:checked) { border-color: var(--navy); background: var(--paper-alt); font-weight: 700; color: var(--navy); }
.choices input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.field.invalid .choices label { border-color: var(--red); }
/* Medical questionnaire rows */
.mq { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--rule); }
.mq:first-child { border-top: 0; }
.mq .num { font-weight: 700; color: var(--navy); text-align: right; }
.mq .txt { font-size: 0.98rem; min-width: 0; }
.mq .txt .star { color: var(--red); font-weight: 700; }
.yesno { display: flex; gap: 6px; }
.yesno button { width: 56px; height: 36px; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); font-weight: 700; cursor: pointer; }
.yesno button.yes.on { background: var(--red); border-color: var(--red); color: #fff; }
.yesno button.no.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.mbox { background: var(--paper-alt); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; margin-left: 0; }
.mbox h4 { margin: 0 0 4px; color: var(--navy); font-size: 1rem; }
.mbox .mq { grid-template-columns: 1fr auto; padding: 8px 0; }
.mbox .mq .txt { font-size: 0.93rem; }
@media (max-width: 480px) { .mq { grid-template-columns: 24px 1fr; } .mq .yesno { grid-column: 2; } .mbox .mq { grid-template-columns: 1fr; } .mbox .mq .yesno { grid-column: 1; } }
.check { display: flex; gap: 12px; align-items: start; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; margin: 2px 0 0; accent-color: var(--navy); }
.check span { font-size: 0.98rem; }
.check.big span { font-weight: 700; color: var(--navy); }

/* Agreement reading box */
.reader {
  position: relative; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper);
}
.reader-scroll { max-height: 420px; overflow-y: auto; padding: 18px 20px; display: grid; gap: 12px; font-size: 0.98rem; line-height: 1.55; -webkit-overflow-scrolling: touch; }
.reader-scroll h3 { font-size: 1.05rem; margin-top: 6px; }
.reader-scroll h2 { font-size: 1.15rem; text-align: center; }
.reader-scroll .caps { font-weight: 700; }
.reader-scroll .florida { font-weight: 700; font-size: 1.15rem; line-height: 1.45; text-transform: uppercase; }
.reader-scroll .readnote { color: var(--red); font-size: 0.9rem; }
.reader-scroll .parties { display: grid; gap: 4px; font-size: 0.92rem; background: var(--paper-alt); padding: 10px 12px; border-radius: 6px; }
.reader-scroll .parties b { color: var(--navy); }
.reader-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--ink-muted); background: var(--paper-alt); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.reader-foot .ok { color: var(--teal); font-weight: 700; }

/* Signature */
.sig { display: grid; gap: 8px; }
.sig .sig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sig .sig-head .lbl { font-weight: 700; color: var(--navy); }
.sig-pad { position: relative; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); height: 170px; touch-action: none; overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sig-pad .baseline { position: absolute; left: 24px; right: 24px; bottom: 34px; border-top: 1px solid var(--ink-muted); pointer-events: none; }
.sig-pad .x { position: absolute; left: 10px; bottom: 36px; color: var(--ink-muted); font-size: 1rem; pointer-events: none; }
.sig-pad .ghost { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-muted); font-size: 0.95rem; pointer-events: none; }
.sig-pad.inked .ghost { display: none; }
.sig-pad.invalid { border-color: var(--red); }
.sig-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; color: var(--ink-muted); flex-wrap: wrap; }

/* Buttons */
.actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.actions .right { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.btn { font-weight: 700; padding: 12px 20px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.btn:hover { background: var(--navy-deep); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn.secondary { background: var(--paper); color: var(--navy); }
.btn.secondary:hover { background: var(--paper-alt); }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.teal { background: var(--teal); border-color: var(--teal); }
.link { background: none; border: 0; padding: 4px 0; color: var(--focus); cursor: pointer; font-weight: 700; }
.link.red { color: var(--red); }

/* Done */
.done-head { display: flex; align-items: center; gap: 14px; }
.done-head .seal { width: 44px; height: 44px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 0.95rem; }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.status { display: inline-block; font-size: 0.9rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; line-height: 1.35; }
.status-teal { background: var(--teal); color: #fff; }
.status-red { background: var(--red); color: #fff; }
.status-grey { background: var(--paper-alt); color: var(--ink); border: 1px solid var(--rule); }
.status-navy { background: var(--navy); color: #fff; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 0.95rem; z-index: 20; max-width: calc(100vw - 32px); }

.foot { font-size: 0.82rem; color: var(--ink-muted); text-align: center; padding-block: 8px; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .panel { padding: 16px; }
  .reader-scroll { max-height: 360px; padding: 14px 14px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .form-card { transition: background-color 0.15s, border-color 0.15s; }
}
