/* Wasatch County conflict of interest statement tool. County colors: blue #007197, green #369040. */

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --blue: #007197;
  --blue-dark: #005873;
  --green: #369040;
  --ink: #1d252c;
  --muted: #56636d;
  --line: #c9d3db;
  --soft: #f3f6f8;
  --card: #ffffff;
  --error: #b42318;
  --error-bg: #fdf0ef;
  --warn-bg: #fff6e0;
  --warn-line: #e3b341;
  --draft: #9b2c2c;
  --radius: 8px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--blue-dark); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: #fff;
  padding: 8px 12px;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.masthead {
  background: #fff;
  border-bottom: 4px solid var(--green);
  text-align: center;
  padding: 28px 16px 22px;
}
.masthead .logo {
  width: 190px;
  max-width: 60%;
  height: auto;
}
.masthead h1 {
  margin: 14px 0 4px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.masthead .sub {
  margin: 0 auto;
  max-width: 40em;
  color: var(--muted);
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.notice {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.notice.draft {
  border-color: #e6b8b8;
  background: #fbefef;
  color: var(--draft);
}
.notice.warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}
.notice.error {
  border-color: var(--error);
  background: var(--error-bg);
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.instructions {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 18px;
}
.instructions summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--blue-dark);
}
.instructions > div {
  padding: 0 16px 8px;
}
.instructions h3 {
  font-size: 1rem;
  margin: 14px 0 4px;
}
.instructions p,
.instructions ul {
  margin: 0 0 8px;
}

.error-summary {
  border: 2px solid var(--error);
  background: var(--error-bg);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin: 0 0 18px;
}
.error-summary h2 {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--error);
}
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); font-weight: 600; }

.part {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin: 0 0 18px;
}
.part > h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--blue-dark);
}
.part .lead {
  color: var(--muted);
  margin: 0 0 14px;
}
.part-skip {
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}
.item h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.item .text { margin: 0 0 10px; }
.note {
  font-size: 0.94rem;
  color: var(--muted);
  margin: 8px 0 0;
}
.note strong { color: var(--ink); }

.field { margin: 0 0 14px; }
.field label,
.field .label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.92rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 8px 10px;
  border: 1px solid #9fb0bd;
  border-radius: 6px;
  background: #fff;
}
textarea { resize: vertical; min-height: 2.6em; }
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
summary:focus-visible,
.file-btn:focus-within {
  outline: 3px solid rgba(0, 113, 151, 0.35);
  outline-offset: 1px;
  border-color: var(--blue);
}
[aria-invalid="true"] {
  border-color: var(--error) !important;
  background: var(--error-bg);
}
fieldset[aria-invalid="true"] {
  border-radius: 6px;
  outline: 2px solid var(--error);
  outline-offset: 4px;
}

fieldset.group {
  border: 0;
  margin: 0 0 14px;
  padding: 0;
  min-width: 0;
}
fieldset.group legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 4px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}
.choices-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.check-with-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 4px 0;
}
.check-with-input .check { margin: 0; }
.check-with-input .inline-input {
  width: auto;
  min-width: 9em;
  max-width: 12em;
  padding: 4px 8px;
}

.rows { margin: 8px 0 0; }
.row-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 10px 12px 2px;
  margin: 0 0 10px;
  background: #fbfcfd;
}
.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}
.row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 14px;
}
.row-grid .field { margin-bottom: 10px; }
.row-grid label { font-size: 0.95rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid var(--blue);
  text-decoration: none;
  min-height: 44px;
}
.btn.primary {
  background: var(--blue);
  color: #fff;
  font-size: 1.1rem;
  padding: 12px 24px;
}
.btn.primary:hover { background: var(--blue-dark); }
.btn.primary:disabled { opacity: 0.6; cursor: progress; }
.btn.secondary {
  background: #fff;
  color: var(--blue-dark);
}
.btn.secondary:hover { background: #eef6f9; }
.btn.small {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 0.95rem;
}
.btn.link {
  border: 0;
  background: none;
  color: var(--error);
  min-height: 32px;
  padding: 2px 4px;
  text-decoration: underline;
  font-weight: 400;
}

.sig-pane { margin-top: 8px; }
.sig-wrap {
  position: relative;
  border: 1px dashed #8fa3b5;
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}
.sig-wrap canvas {
  display: block;
  width: 100%;
  height: 160px;
  cursor: crosshair;
  touch-action: none;
}
.sig-wrap .sig-line {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 36px;
  border-bottom: 1px solid #b7c4ce;
  pointer-events: none;
}
.sig-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.note-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 10px 14px;
  margin: 0 0 4px;
}
.note-box .note { margin: 0 0 6px; }

.ack-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.ack-row .ack-text {
  flex: 1 1 auto;
  margin: 0;
}
.ack-initials {
  flex: 0 0 6.5em;
  text-align: center;
}
.ack-initials label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}
.ack-initials input {
  text-align: center;
  padding: 6px 4px;
}

.finish {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.finish h2 { margin: 0 0 10px; font-size: 1.3rem; }
.status { margin: 10px 0 0; min-height: 1.5em; }
.status.bad { color: var(--error); font-weight: 600; }
.pdf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.next-steps { color: var(--muted); margin: 12px 0 0; }

.page-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 16px 32px;
}
.page-foot p { margin: 4px 0; }
.page-foot .credits { font-size: 0.82rem; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .part { padding: 14px 14px 16px; }
  .finish { padding: 14px; }
  .btn.primary { width: 100%; }
  .ack-row { gap: 10px; }
  .ack-initials { flex-basis: 5em; }
}
