:root {
  /* Omega Tecks brand colors.  Every color on the page is one of these,
     white, or brand navy at partial opacity for text shades and lines. */
  --navy: #283C63;
  --orange: #EF6910;
  --cream: #FBE8D3;
  --white: #FFFFFF;

  --ink: var(--navy);
  --muted: rgba(40, 60, 99, 0.78);        /* navy at 78% */
  --line-strong: rgba(40, 60, 99, 0.55);  /* navy at 55%, input borders */
  --line-soft: rgba(40, 60, 99, 0.14);    /* navy at 14%, dividers */
  --wash: rgba(40, 60, 99, 0.05);         /* navy at 5%, page background */

  --font-body: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo", "Arial Black", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

html { background: var(--white); }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.5;
}

/* ---------- Masthead ---------- */
.masthead {
  background: var(--navy);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}
.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { display: inline-flex; align-items: center; line-height: 0; }
.wordmark img { height: 44px; width: auto; display: block; }
.wordmark:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; border-radius: 6px; }
.masthead-title {
  margin: 0;
  font-size: 1rem;
  color: var(--cream);
  opacity: 0.85;
}
.progress { height: 4px; background: rgba(251, 232, 211, 0.18); }
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--orange);
  transition: width 0.35s ease;
}

/* ---------- Layout ---------- */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ---------- Stepper ---------- */
.rail { position: sticky; top: 96px; }
.stepper { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { counter-increment: step; }
.step-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.step-btn::before {
  content: counter(step);
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
}
.step-btn:disabled { cursor: default; opacity: 0.6; }
.step-btn.is-done::before {
  content: "\2713";
  background: var(--cream);
  border-color: var(--navy);
  color: var(--navy);
}
.step-btn.is-current { color: var(--ink); font-weight: 700; }
.step-btn.is-current::before {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--cream);
  box-shadow: 0 0 0 3px var(--orange);
}
.step-btn:not(:disabled):hover { background: var(--line-soft); }

/* ---------- Page ---------- */
#page-container:focus { outline: none; }
.page-head { margin-bottom: 28px; max-width: 68ch; }
.page-count { margin: 0 0 6px; color: var(--navy); font-weight: 700; font-size: 1rem; }
.page-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.05;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.page-intro { margin: 0; color: var(--muted); }

.section {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--navy);
}
.section-intro { margin: 0 0 8px; color: var(--muted); }

/* ---------- Fields ---------- */
.field { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.section-head + .field,
.section-intro + .field,
.section > .field:first-child { border-top: 0; }

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  max-width: 72ch;
}
.field-label .req { color: var(--orange); }
.field-hint { margin: -4px 0 10px; color: var(--muted); font-size: 1rem; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--cream);
}
.field.has-error input,
.field.has-error textarea { border: 2px solid var(--orange); }
.field-error { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--orange); color: var(--navy); font-weight: 700; font-size: 1rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}
.contact-grid .field { border-top: 0; padding: 10px 0; }

/* Composite rows */
.parts { display: grid; gap: 12px; }
.parts.row { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); align-items: end; }
.parts.row .part.wide { grid-column: span 2; }
.parts.stack .part { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; }
.part-label { display: block; font-size: 0.95rem; color: var(--muted); margin-bottom: 4px; }
.parts.stack .part-label { margin: 0; font-weight: 700; color: var(--navy); text-align: right; }

/* Choice pills (yes/no and 0-3 ratings) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
}
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.choice input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.choice span:hover { border-color: var(--navy); }

.rating-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rating-meaning { color: var(--muted); font-size: 1rem; min-height: 1.5em; }

/* Scoring key on the checklist page */
.scale {
  background: var(--navy);
  color: var(--cream);
  border-radius: 14px;
  padding: 20px 24px 22px;
  margin-bottom: 24px;
}
.scale-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--cream);
}
.scale-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.scale-grid div { display: flex; gap: 10px; align-items: flex-start; line-height: 1.3; }
.scale-grid dt {
  flex: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--orange);
}
.scale-grid dd { margin: 0; font-size: 1rem; }

/* Estimate block on deep dive */
.field.estimate { background: var(--cream); border-radius: 10px; padding: 16px 18px; margin-top: 8px; border-top: 0; }

/* Unanswered questions (highlighted after the prompt) */
.field.is-blank { box-shadow: inset 4px 0 0 var(--orange); padding-left: 14px; }
.part.is-blank textarea, .part.is-blank input, .field.is-blank > textarea, .field.is-blank > input { border-color: var(--orange); }
.blank-note {
  margin: 6px 0 0;
  padding-left: 10px;
  border-left: 3px solid var(--orange);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
}
.part .blank-note { font-size: 0.875rem; }

/* ---------- Nav bar ---------- */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}
.save-note { flex: 1; text-align: center; color: var(--muted); font-size: 0.95rem; }
.btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  border-radius: 10px;
  padding: 12px 26px;
  cursor: pointer;
  border: 2px solid transparent;
}
/* White on orange meets contrast only as large bold text, so this stays 19px+ bold */
.btn-primary { background: var(--orange); color: var(--white); font-size: 1.1875rem; }
.btn-primary:hover { background: var(--navy); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--navy); }
.btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.btn[hidden] { display: none; }

.form-status { min-height: 1.5em; margin: 14px 0 0; text-align: right; font-weight: 700; }
.form-status.is-error { color: var(--navy); border-right: 4px solid var(--orange); padding-right: 10px; }
.form-status.is-ok { color: var(--navy); }

/* ---------- Scheduling pop-up ---------- */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(40, 60, 99, 0.72);  /* navy at 72% */
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--white);
  border-radius: 16px;
  border-top: 6px solid var(--orange);
  padding: 32px 30px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(40, 60, 99, 0.35);
}
.modal-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--navy);
}
.modal-message { margin: 0 0 22px; white-space: pre-wrap; text-align: left; }
.countdown { position: relative; width: 84px; height: 84px; margin: 0 auto 10px; }
.countdown-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--cream); stroke-width: 6; }
.ring-fill {
  fill: none;
  stroke: var(--orange);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 175.93;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.countdown-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--navy);
}
.modal-note { margin: 0 0 18px; color: var(--muted); font-size: 1rem; }
.modal-card .btn { width: 100%; }
.dialog-card { text-align: left; }
.dialog-card .modal-title { font-size: 1.5rem; }
.dialog-list { margin: -8px 0 20px; padding-left: 20px; font-weight: 700; }
.dialog-list li { margin: 4px 0; }
.dialog-actions { display: grid; gap: 10px; }
.modal-fallback { margin: 14px 0 0; font-size: 0.95rem; color: var(--muted); }
.modal-fallback a { color: var(--navy); font-weight: 700; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.footer { text-align: center; color: var(--muted); font-size: 0.95rem; padding: 0 24px 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 16px 40px; }
  .rail { position: static; }
  .stepper { display: flex; gap: 4px; overflow-x: auto; }
  .scale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-btn { flex-direction: column; gap: 4px; font-size: 0.8rem; text-align: center; padding: 6px; min-width: 76px; }
  .scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .masthead-title { display: none; }
  .wordmark img { height: 38px; }
  .section { padding: 20px 16px; }
  .contact-grid { grid-template-columns: 1fr; }
  .scale-grid { grid-template-columns: 1fr; }
  .parts.row .part.wide { grid-column: auto; }
  .scale { grid-template-columns: 1fr; }
  .save-note { display: none; }
  .nav-bar { justify-content: space-between; }
  .modal-card { padding: 26px 20px 22px; }
  .modal-title { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
  .ring-fill { transition: none; }
}
