/* Roof Scans: styles for the roof measurement pages.
   .rr-  public Roof Measurement request form (roof-measurement)
   .rs-  staff Roof Scan tool (internal/roof-scan) and its report overlay
   .rp-  printed roof report pages
   Everything is prefixed so the site theme (Bootstrap .row, .btn, .card ...) cannot collide.
   The calculator has its own file: roof-calculator.css. */

:root {
  --rs-navy: #0f1b2d;
  --rs-navy2: #1a2b45;
  --rs-blue: #1d5fa8;
  --rs-blue2: #3d8bff;
  --rs-red: #c8202f;
  --rs-bg: #eef2f7;
  --rs-ink: #0f1b2d;
  --rs-muted: #5b6b82;
  --rs-line: #dbe3ee;
}

/* =====================================================================
   PUBLIC REQUEST FORM  (.rr-)
   ===================================================================== */

.rr-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 980px;
  margin: 0 auto 36px;
  padding: 0;
  list-style: none;
}

.rr-steps li {
  background: #fff;
  border: 1px solid #E3E8F0;
  border-radius: 14px;
  padding: 18px 18px 16px;
  text-align: left;
}

.rr-steps .rr-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--theme-color, #EA1826);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

.rr-steps strong {
  display: block;
  color: var(--theme-color-1, #102039);
  font-size: 16px;
  margin-bottom: 4px;
}

.rr-steps span.rr-d {
  display: block;
  color: #6a7385;
  font-size: 13.5px;
  line-height: 1.5;
}

.rr-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(16, 32, 57, 0.12);
  padding: 44px 50px;
  max-width: 880px;
  margin: 0 auto;
}

.rr-card h4 {
  color: var(--theme-color-1, #102039);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
}

.rr-lead {
  color: #6a7385;
  font-size: 15px;
  margin: 0 0 26px;
}

.rr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 18px;
}

.rr-field.rr-full {
  grid-column: 1 / -1;
}

.rr-field label {
  display: block;
  color: var(--theme-color-1, #102039);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.rr-field label em {
  color: #6a7385;
  font-weight: 400;
  font-style: normal;
}

.rr-field input[type="text"],
.rr-field input[type="email"],
.rr-field input[type="tel"],
.rr-field select,
.rr-field textarea,
.rr-code {
  width: 100%;
  height: 48px;
  border: 2px solid #ECECEC;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  color: var(--theme-color-1, #102039);
  background: #fff;
}

.rr-field textarea {
  height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.rr-field input:focus,
.rr-field select:focus,
.rr-field textarea:focus,
.rr-code:focus {
  outline: none;
  border-color: var(--theme-color, #EA1826);
}

.rr-field.rr-invalid input,
.rr-field.rr-invalid select,
.rr-field.rr-invalid textarea {
  border-color: var(--theme-color, #EA1826);
}

.rr-msg {
  display: none;
  color: var(--theme-color, #EA1826);
  font-size: 12.5px;
  margin-top: 5px;
}

.rr-field.rr-invalid .rr-msg {
  display: block;
}

.rr-consent {
  margin: 20px 0 6px;
  font-size: 13px;
  color: #6a7385;
  line-height: 1.55;
}

.rr-consent label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.rr-consent input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.rr-consent a {
  color: var(--theme-color, #EA1826);
  text-decoration: underline;
}

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

.rr-error {
  display: none;
  background: rgba(234, 24, 38, 0.07);
  border-radius: 10px;
  color: #b3121e;
  padding: 11px 14px;
  font-size: 14px;
  margin: 16px 0 0;
}

.rr-error.rr-show {
  display: block;
}

.rr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 30px;
  background: var(--theme-color, #EA1826);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.rr-btn:hover {
  opacity: 0.9;
  color: #fff;
}

.rr-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.rr-btn.rr-ghost {
  background: transparent;
  border: 2px solid #ECECEC;
  color: var(--theme-color-1, #102039);
}

.rr-btn.rr-ghost:hover {
  border-color: var(--theme-color, #EA1826);
  color: var(--theme-color, #EA1826);
}

.rr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

.rr-note {
  color: #6a7385;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 14px 0 0;
}

.rr-code {
  max-width: 260px;
  height: 60px;
  text-align: center;
  font-size: 30px;
  letter-spacing: 0.35em;
  font-weight: 700;
  padding: 0 0 0 0.35em;
}

.rr-panel[hidden] {
  display: none;
}

.rr-done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(26, 138, 74, 0.12);
  color: #1a8a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.rr-next {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.rr-next li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--theme-color-1, #102039);
  font-size: 15px;
}

.rr-next li:before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #1a8a4a;
  font-weight: 700;
}

.rr-fineprint {
  max-width: 880px;
  margin: 24px auto 0;
  color: #6a7385;
  font-size: 12.5px;
  line-height: 1.65;
}

@media (max-width: 767px) {
  .rr-steps { grid-template-columns: 1fr; }
  .rr-card { padding: 28px 20px; }
  .rr-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   STAFF TOOL  (.rs-)
   ===================================================================== */

.rs-bar {
  background: var(--rs-navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

.rs-bar h1 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: capitalize;
}

.rs-bar .rs-note {
  font-size: 12.5px;
  opacity: 0.75;
}

.rs-sp { flex: 1; }

.rs-chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.4;
}

.rs-chip.rs-red { background: var(--rs-red); }

.rs-app {
  display: grid;
  grid-template-columns: 420px 1fr;
  height: max(680px, calc(100vh - 190px));
  background: var(--rs-bg);
  color: var(--rs-ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.rs-app *,
.rs-report * { box-sizing: border-box; }

/* theme resets for the controls inside the tool */
.rs-app h2,
.rs-app p,
.rs-app label { font-family: inherit; letter-spacing: normal; text-transform: none; }

.rs-app input[type="text"],
.rs-app input[type="number"],
.rs-app select,
.rs-app textarea {
  display: block;
  width: 100%;
  height: 36px;
  margin: 0;
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  background: #fff;
  color: var(--rs-ink);
  box-shadow: none;
}

.rs-app textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }

.rs-app input:focus,
.rs-app select:focus,
.rs-app textarea:focus { outline: 2px solid var(--rs-blue2); outline-offset: -1px; }

.rs-side {
  overflow: auto;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: #9fb2cc transparent;
}

.rs-side::-webkit-scrollbar { width: 8px; }
.rs-side::-webkit-scrollbar-thumb { background: #9fb2cc; border-radius: 8px; }

.rs-card {
  background: #fff;
  border: 1px solid var(--rs-line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.rs-card h2 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--rs-ink);
  text-transform: capitalize;
}

.rs-row { display: flex; gap: 8px; align-items: center; }
.rs-row.rs-wrap { flex-wrap: wrap; }
.rs-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }

.rs-lbl {
  display: block;
  font-size: 12px;
  color: var(--rs-muted);
  margin: 0 0 4px;
  font-weight: 400;
}

.rs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 0;
  border: 1px solid var(--rs-navy);
  background: #fff;
  color: var(--rs-navy);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
}

.rs-btn:hover { background: #f3f6fb; color: var(--rs-navy); }
.rs-btn.rs-primary { background: var(--rs-red); border-color: var(--rs-red); color: #fff; }
.rs-btn.rs-primary:hover { background: #a81a27; color: #fff; }
.rs-btn.rs-blue { background: var(--rs-blue); border-color: var(--rs-blue); color: #fff; }
.rs-btn.rs-blue:hover { background: #174d89; color: #fff; }
.rs-btn.rs-small { height: 30px; padding: 0 10px; font-size: 12px; }
.rs-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.rs-hint { font-size: 12px; color: var(--rs-muted); margin: 8px 0 0; line-height: 1.5; }
.rs-legal { font-size: 11.5px; color: var(--rs-muted); line-height: 1.5; margin: 10px 0 0; }
.rs-empty { color: var(--rs-muted); font-size: 13px; margin: 0; }

.rs-results { margin-top: 10px; display: grid; gap: 6px; }

.rs-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--rs-line);
  background: #fff;
  color: var(--rs-ink);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: none;
}

.rs-results button:hover { background: #f3f6fb; border-color: var(--rs-blue2); }

.rs-sec {
  border: 1px solid var(--rs-line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fbfcfe;
}

.rs-sec .rs-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

.rs-letter {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rs-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.rs-sec .rs-nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--rs-muted);
}

.rs-sec .rs-nums b { display: block; color: var(--rs-ink); font-size: 15px; }

.rs-tot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-tot > div { background: #f3f6fb; border-radius: 8px; padding: 10px; }
.rs-tot span { display: block; font-size: 12px; color: var(--rs-muted); }
.rs-tot b { font-size: 20px; }
.rs-tot .rs-big { background: var(--rs-navy); color: #fff; }
.rs-tot .rs-big span { color: #b9c6db; }

.rs-mapwrap { position: relative; min-height: 0; isolation: isolate; }
.rs-mapwrap #rs-map { position: absolute; inset: 0; background: #cfd8e6; }

.rs-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--rs-navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 2147483100;
  max-width: 90vw;
}

.rs-toast.rs-show { opacity: 1; }

.rs-vh { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--rs-navy); cursor: move; }
.rs-vh.rs-first { border-color: var(--rs-red); width: 16px; height: 16px; margin: -2px 0 0 -2px; cursor: pointer; }

.leaflet-tooltip.rs-seclabel {
  background: rgba(15, 27, 45, 0.88);
  color: #fff;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
}

.leaflet-tooltip.rs-seclabel:before { display: none; }
.leaflet-container.rs-tracing { cursor: crosshair; }

.rs-fp-pop b { display: block; margin-bottom: 2px; }
.rs-fp-pop div { margin-bottom: 8px; color: #444; }

@media (max-width: 980px) {
  .rs-app { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .rs-mapwrap { order: -1; }
  .rs-side { overflow: visible; }
}

/* =====================================================================
   REPORT OVERLAY + PAGES  (.rs-report, .rs-page, .rp-)
   ===================================================================== */

.rs-report {
  position: fixed;
  inset: 0;
  background: #4b5563;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #111;
}

.rs-report[hidden] { display: none; }

.rs-report h1,
.rs-report h2,
.rs-report h3,
.rs-report h4,
.rs-report p {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.25;
  margin: 0;
  color: inherit;
}

.rs-report table { width: 100%; border-collapse: collapse; margin: 0; background: none; }
.rs-report td,
.rs-report th { border: 0; vertical-align: top; }
.rs-report img { max-width: none; }

.rs-bar2 {
  flex: 0 0 52px;
  background: var(--rs-navy);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: #fff;
}

.rs-bar2 .rs-status { font-size: 13px; opacity: 0.8; }

.rs-report .rs-btn { height: 36px; }

.rs-pages { flex: 1; overflow: auto; padding: 22px 0; scrollbar-width: thin; }
.rs-loading { color: #fff; text-align: center; padding: 60px 0; font-size: 16px; }

.rs-page {
  position: relative;
  width: 11in;
  height: 8.5in;
  margin: 0 auto 22px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  padding: 0.32in 0.42in 0.62in;
  overflow: hidden;
  color: #111;
}

.rp-top { height: 8px; border-top: 6px solid var(--rs-red); border-bottom: 3px solid #444; margin-bottom: 12px; }
.rp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.rp-head img { height: 50px; width: auto; display: block; }
.rp-ttl { text-align: right; }
.rp-ttl h1 { font-size: 26px; font-weight: 700; color: var(--rs-navy); }
.rp-ttl p { margin-top: 2px; font-size: 12px; color: #555; }

.rp-addr {
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-cols { display: grid; grid-template-columns: 3.05in 1fr; gap: 0.28in; }

.rp-tbl { font-size: 13px; }
.rp-tbl td { padding: 3px 8px; }
.rp-tbl tr:nth-child(even) td { background: #f1f3f6; }
.rp-tbl td.rp-v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-tbl td small { color: #666; font-size: 10.5px; }
.rp-tbl .rp-big td { background: #444 !important; color: #fff; font-weight: 700; font-size: 16px; padding: 7px 8px; }
.rp-tbl .rp-gap td { background: none !important; height: 9px; padding: 0; }

.rp-h { font-size: 17px; font-weight: 700; margin: 0 0 5px; }

.rp-img { width: 100%; height: 4.45in; object-fit: cover; display: block; background: #dfe5ee; }
.rp-img-missing { width: 100%; height: 4.45in; background: #dfe5ee; display: flex; align-items: center; justify-content: center; text-align: center; color: #556; font-size: 13px; padding: 20px; }

.rp-waste { margin-top: 8px; font-size: 12px; }
.rp-waste h3 { font-size: 13px; font-weight: 700; margin: 0 0 3px; }
.rp-waste .rp-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.rp-waste .rp-g > div { padding: 0 12px; border-left: 1px solid #ccc; }
.rp-waste .rp-g > div:first-child { border-left: 0; padding-left: 0; }
.rp-waste .rp-g p { display: flex; justify-content: space-between; line-height: 1.55; }
.rp-waste .rp-g p.rp-on { font-weight: 700; color: var(--rs-red); }

.rp-foot { position: absolute; left: 0.42in; right: 0.42in; bottom: 0.16in; }
.rp-foot .rp-disc { font-size: 9.5px; color: #555; line-height: 1.35; margin-bottom: 5px; }
.rp-foot .rp-bar { display: flex; justify-content: space-between; gap: 10px; background: #444; color: #fff; padding: 6px 10px; font-size: 10.5px; }
.rp-foot .rp-bar b { font-size: 12.5px; border-left: 6px solid var(--rs-red); padding-left: 10px; margin-left: -4px; }

.rp-draw { display: grid; grid-template-columns: 1fr 3.1in; gap: 0.22in; height: 5.85in; }
.rp-draw svg { width: 100%; height: 100%; display: block; }

.rp-small { font-size: 11.5px; }
.rp-small th { text-align: left; font-weight: 700; border-bottom: 2px solid #444; padding: 2px 5px; }
.rp-small td { padding: 2px 5px; }
.rp-small tr:nth-child(even) td { background: #f1f3f6; }

.rp-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11px; margin-top: 6px; border-top: 1px solid #444; padding-top: 5px; }
.rp-key span { display: inline-flex; align-items: center; gap: 6px; }
.rp-key i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; }

.rp-mat { font-size: 12.5px; margin-top: 8px; }
.rp-mat th { background: var(--rs-navy); color: #fff; text-align: left; padding: 6px 8px; font-weight: 600; }
.rp-mat td { padding: 5px 8px; border-bottom: 1px solid #dde3ec; }
.rp-mat td.rp-r,
.rp-mat th.rp-r { text-align: right; }
.rp-mat td small { display: block; color: #666; font-size: 10.5px; }

.rp-note { font-size: 11.5px; color: #444; line-height: 1.55; margin: 8px 0 0; }
.rp-box { background: #f3f6fb; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: 12px; line-height: 1.55; }
.rp-box h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.rp-box .rp-clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.rp-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 4px; }
.rp-sum > div { background: #f3f6fb; border-radius: 8px; padding: 8px 10px; }
.rp-sum span { display: block; font-size: 10.5px; color: #556; }
.rp-sum b { font-size: 18px; }

@media print {
  @page { size: 11in 8.5in; margin: 0; }
  html, body { height: auto; background: #fff; }
  body.rs-report-open > *:not(#rs-report) { display: none !important; }
  body.rs-report-open .rs-report { position: static; background: #fff; display: block; }
  body.rs-report-open .rs-bar2 { display: none; }
  body.rs-report-open .rs-pages { overflow: visible; padding: 0; }
  body.rs-report-open .rs-page { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  body.rs-report-open .rs-page:last-child { break-after: auto; page-break-after: auto; }
  body.rs-report-open * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
