:root {
  --mcpl-blue: #284b71;
  --mcpl-blue-dark: #173653;
  --mcpl-gold: #f6c973;
  --mcpl-gold-dark: #d7a33f;
  --text: #1f2933;
  --muted: #52606d;
  --border: #cbd2d9;
  --surface: #f7f9fb;
  --error: #9b1c1c;
  --error-background: #fff2f2;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "PT Sans Caption", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  margin: 0;
  min-height: 100%;
}

a {
  color: #155da1;
}

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

header {
  align-items: center;
  display: flex;
  gap: 2rem;
  margin: 0 auto;
  max-width: 1200px;
  padding: 1.25rem 1rem 0;
}

header img {
  display: block;
  height: auto;
  width: min(268px, 34vw);
}

header h1 {
  border-bottom: 3px solid var(--mcpl-gold);
  color: var(--mcpl-blue);
  flex: 1;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.2;
  margin: 0;
  padding: 0.25rem 0 0.75rem;
}

.page-container {
  margin: 0 auto;
  max-width: 1200px;
  padding: 1.5rem 1rem 2rem;
}

.intro {
  max-width: 850px;
}

.intro h2,
.results h2 {
  color: var(--mcpl-blue-dark);
  margin: 0 0 0.35rem;
}

.intro p {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.search-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  color: var(--mcpl-blue-dark);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.field input {
  background: white;
  border: 1px solid #7b8794;
  border-radius: 0.25rem;
  color: var(--text);
  font: inherit;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.field input:focus {
  border-color: var(--mcpl-blue);
  box-shadow: 0 0 0 3px rgb(40 75 113 / 22%);
  outline: none;
}

.date-range {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
}

.date-range legend {
  color: var(--mcpl-blue-dark);
  font-weight: 700;
  padding-right: 0.75rem;
}

.checkbox-field {
  align-items: center;
  color: var(--mcpl-blue-dark);
  display: flex;
  font-weight: 700;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.checkbox-field input {
  height: 1.1rem;
  width: 1.1rem;
}

.field-help {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.field-validation,
.validation-summary {
  color: var(--error);
  font-size: 0.9rem;
}

.validation-summary:empty,
.field-validation:empty {
  display: none;
}

.validation-summary ul {
  margin-top: 0;
}

.input-validation-error {
  border-color: var(--error) !important;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.button {
  border: 1px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  min-height: 2.65rem;
  padding: 0.68rem 1.2rem;
  text-align: center;
  text-decoration: none;
}

.button:focus-visible {
  box-shadow: 0 0 0 3px rgb(40 75 113 / 28%);
  outline: 2px solid white;
}

.button-primary {
  background: var(--mcpl-blue);
  border-color: var(--mcpl-blue);
  color: white;
}

.button-primary:hover {
  background: var(--mcpl-blue-dark);
  color: white;
}

.button-secondary {
  background: white;
  border-color: #7b8794;
  color: var(--mcpl-blue-dark);
}

.button-secondary:hover {
  background: #edf1f5;
}

.button-back-to-top {
  background: white;
  border-color: #7b8794;
  color: var(--mcpl-blue-dark);
}

.button-back-to-top:hover {
  background: #edf1f5;
}

.button-results-badge {
  background: #e6f4ea;
  border-color: #137333;
  color: #137333;
}

.button-results-badge:hover {
  background: #ceead6;
  color: #0d5224;
}

.results {
  margin-top: 1.75rem;
}

.results-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.results-heading p {
  color: var(--muted);
  margin: 0;
}

.results-footer {
  margin-top: 1rem;
  text-align: right;
}

.notice {
  background: #fff9e8;
  border: 1px solid var(--mcpl-gold-dark);
  border-left-width: 5px;
  border-radius: 0.25rem;
  margin: 1rem 0;
  padding: 0.8rem 1rem;
}

.notice-error {
  background: var(--error-background);
  border-color: var(--error);
}

.notice h2 {
  margin-top: 0;
}

.empty-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 1rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 0.93rem;
  width: 100%;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--mcpl-blue);
  color: white;
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: var(--surface);
}

.index-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-list li {
  border: 1px solid var(--border);
  border-left: 5px solid var(--mcpl-gold-dark);
  border-radius: 0.25rem;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
}

.index-list a {
  font-size: 1.1rem;
  font-weight: 700;
}

.index-list span {
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  margin: 0 auto;
  max-width: 1200px;
  padding: 1rem;
}

.legacy-intro {
  display: none;
}

html.is-embedded header {
  max-width: none;
  padding: 0.75rem 1rem 0;
}

html.is-embedded header a {
  display: none;
}

html.is-embedded header h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

html.is-embedded .page-container {
  max-width: none;
  padding: 0.9rem 1rem 1.25rem;
}

html.is-embedded footer {
  display: none;
}

@media (max-width: 700px) {
  header {
    display: block;
    padding-top: 0.75rem;
  }

  header img {
    margin-bottom: 0.75rem;
    width: 210px;
  }

  .page-container {
    padding-top: 1rem;
  }

  .search-form {
    padding: 1rem;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .table-scroll {
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  tbody tr {
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0;
  }

  td {
    border: 0;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(8rem, 40%) 1fr;
    padding: 0.4rem 0.7rem;
  }

  td::before {
    color: var(--mcpl-blue-dark);
    content: attr(data-label);
    font-weight: 700;
  }
}

/*
 * Development uses the same compact shell that production uses inside the
 * CivicPlus iframe. This makes localhost a useful visual migration preview.
 */
html.is-development-preview body,
html.is-embedded body {
  background: white;
  color: #212529;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.5;
}

html.is-development-preview .site-header,
html.is-development-preview .site-footer,
html.is-embedded .site-header,
html.is-embedded .site-footer {
  display: none;
}

html.is-development-preview .page-container,
html.is-embedded .page-container {
  margin: 0 auto;
  max-width: 1140px;
  padding: 0 0.75rem 1rem;
}

html.is-development-preview .legacy-intro,
html.is-embedded .legacy-intro {
  display: block;
}

html.is-development-preview .legacy-intro h1,
html.is-embedded .legacy-intro h1 {
  color: #212529;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

html.is-development-preview .legacy-intro p,
html.is-embedded .legacy-intro p {
  color: #212529;
  margin: 0 0 1rem;
}

html.is-development-preview .intro,
html.is-embedded .intro {
  display: none;
}

html.is-development-preview .search-form,
html.is-embedded .search-form {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

html.is-development-preview .search-grid,
html.is-embedded .search-grid {
  display: grid;
  gap: 0.5rem 1.5rem;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
}

@media (max-width: 520px) {
  html.is-development-preview .search-grid,
  html.is-embedded .search-grid {
    grid-template-columns: 1fr;
  }
}

html.is-development-preview .field,
html.is-embedded .field {
  display: block;
  margin: 0 0 0.75rem;
}

html.is-development-preview .field label,
html.is-embedded .field label {
  color: #212529;
  display: inline-block;
  font-weight: 400;
  margin: 0;
}

html.is-development-preview .field input,
html.is-embedded .field input {
  background: white;
  border: 2px inset rgb(118 118 118);
  border-radius: 0;
  color: black;
  display: block;
  font: inherit;
  height: 30px;
  min-height: 0;
  padding: 1px 2px;
  width: 100%;
  max-width: 250px;
}

html.is-development-preview .date-range,
html.is-embedded .date-range {
  border: 0;
  margin: 0;
  padding: 0;
}

html.is-development-preview .form-actions,
html.is-embedded .form-actions {
  display: block;
  margin: 0 0 1rem;
}

html.is-development-preview .button,
html.is-embedded .button {
  background: ButtonFace;
  border: 2px outset ButtonBorder;
  border-radius: 0;
  color: ButtonText;
  font: inherit;
  font-weight: 400;
  line-height: normal;
  min-height: 0;
  padding: 1px 6px;
}

html.is-development-preview .button:hover,
html.is-embedded .button:hover {
  background: ButtonFace;
  color: ButtonText;
}

html.is-development-preview .button-secondary,
html.is-embedded .button-secondary {
  display: none;
}

html.is-development-preview .button-back-to-top,
html.is-embedded .button-back-to-top {
  display: inline-block;
  background: ButtonFace;
  border: 2px outset ButtonBorder;
  color: ButtonText;
  font: inherit;
  padding: 1px 6px;
  text-decoration: none;
}

html.is-development-preview .button-results-badge,
html.is-embedded .button-results-badge {
  background: #d4edda;
  border: 2px outset #c3e6cb;
  color: #155724;
  font-weight: bold;
  margin-left: 0.5rem;
  text-decoration: none;
  display: inline-block;
}
