/* =============================================================
   nd-styles.css — shared styles for the ND registry
   ============================================================= */
:root {
  --nd-navy: #1a3d63;
  --nd-heading: #14395e;
  --nd-link: #1a6fc4;
  --nd-text: #222;
  --nd-border: #d7dde3;
  --nd-panel: #f5f7f9;
  --nd-page: #f4f6f8;
  --nd-white: #fff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--nd-page);
  color: var(--nd-text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--nd-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top brand bar ---------- */
.top-bar { background: var(--nd-white); border-bottom: 1px solid #e2e6ea; }

.top-bar-inner {
  max-width: 1375px;
  margin: 0 auto;
  padding: 13px 30px;
  display: flex;
  align-items: center;
  gap: 23px;
}

.state-wordmark {
  font-family: "Segoe UI Light", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 34px;
  font-weight: 300;
  color: #6d6d6d;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.portal-lockup { display: flex; align-items: center; gap: 10px; }
.portal-lockup .ndgov { font-size: 19px; font-weight: 600; color: var(--nd-link); line-height: 1; }
.portal-lockup .divider { width: 1px; align-self: stretch; min-height: 33px; background: #b9b9b9; }
.portal-lockup .portal-text { font-size: 13px; line-height: 1.3; color: #333; white-space: nowrap; }

/* ---------- Registry banner ---------- */
.registry-banner {
  background: linear-gradient(180deg, #1a456f 0%, #123552 100%);
  color: #fff;
  text-align: center;
  padding: 23px 25px 20px;
}
.registry-banner h1 { font-size: 35px; font-weight: 600; line-height: 1.2; }
.registry-banner p { margin-top: 4px; font-size: 20px; opacity: 0.95; }

/* ---------- Sub navigation ---------- */
.subnav { background: var(--nd-white); border-bottom: 1px solid #e5e9ed; }
.subnav-inner {
  max-width: 1375px; margin: 0 auto; padding: 0 30px;
  display: flex; flex-wrap: wrap; gap: 4px 35px; align-items: center; min-height: 60px;
}
.subnav a { color: #2b3640; font-size: 19px; padding: 18px 0; }
.subnav a:hover { color: var(--nd-link); text-decoration: none; }
.subnav a.active { color: #111; font-weight: 700; }

/* ---------- Page ---------- */
.page { max-width: 1375px; margin: 0 auto; padding: 43px 30px 75px; }
.page h2 { font-size: 43px; font-weight: 600; color: #1c2430; margin-bottom: 18px; letter-spacing: -0.02em; }
.intro { max-width: 1150px; font-size: 19px; color: #3a4450; margin-bottom: 35px; line-height: 1.55; }

.search-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; align-items: start; }

/* ---------- Panels ---------- */
.panel {
  background: var(--nd-white);
  border: 1px solid var(--nd-border);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.panel-header {
  background: var(--nd-panel);
  border-bottom: 1px solid var(--nd-border);
  padding: 15px 23px;
  font-size: 20px;
  font-weight: 500;
  color: #24303a;
}
.panel-body { padding: 25px 23px 28px; flex: 1; }

/* ---------- Fields ---------- */
.field { margin-bottom: 23px; }
.field label {
  display: block; font-size: 18px; font-weight: 700;
  color: var(--nd-heading); margin-bottom: 9px;
}
.field input[type="text"], .field select {
  width: 100%; height: 50px;
  border: 1px solid #c3ccd4; border-radius: 3px;
  padding: 0 13px; font-size: 19px; color: #222;
  background: #fff; font-family: inherit;
}
.field input[type="text"]:focus, .field select:focus {
  outline: 2px solid rgba(26,111,196,.30);
  outline-offset: 1px;
  border-color: #7aa0c4;
}

/* ---------- Boxed tabs ---------- */
.tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  border-bottom: 1px solid #dfe4e9;
  margin-bottom: 23px;
}
.tab {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 11px 20px;
  font-size: 19px;
  font-family: inherit;
  color: var(--nd-link);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
  line-height: 1.3;
}
.tab:hover { text-decoration: underline; }
.tab.active {
  background: #fff;
  color: #3f4a55;
  border-color: #dfe4e9;
  border-bottom: 1px solid #fff;
  cursor: default;
  text-decoration: none;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- Status ---------- */
.status-title {
  font-size: 23px; font-weight: 700;
  color: var(--nd-heading); margin-bottom: 13px;
}
.status-options { display: flex; flex-wrap: wrap; gap: 18px 33px; margin-bottom: 23px; }
.radio {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 19px; color: #2b3640; cursor: pointer; user-select: none;
}
.radio input { width: 20px; height: 20px; accent-color: var(--nd-navy); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 2px;
  min-height: 48px; padding: 11px 23px;
  font-size: 18px; font-weight: 500; font-family: inherit;
  cursor: pointer; line-height: 1;
}
.btn-primary { background: var(--nd-navy); color: #fff; border-color: #163453; }
.btn-primary:hover { background: #14324f; }
.btn-secondary { background: var(--nd-navy); color: #fff; border-color: #163453; }
.btn-secondary:hover { background: #14324f; }
.btn-sm { min-height: 40px; padding: 9px 18px; font-size: 16px; }

.actions { display: flex; gap: 13px; flex-wrap: wrap; }

/* =============================================================
   Search Results page
   ============================================================= */
.results-page h2 {
  font-size: 40px;
  font-weight: 600;
  color: var(--nd-heading);
  margin-bottom: 25px;
}

.summary-box {
  background: #fff;
  border: 1px solid var(--nd-border);
  border-radius: 2px;
  padding: 20px 23px;
  margin-bottom: 28px;
  font-size: 18px;
  color: #2b3640;
}
.summary-box .summary-actions { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; }
.summary-box .summary-actions[hidden] { display: none; }

.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 13px;
  font-size: 18px;
  color: #2b3640;
}
.table-controls label { display: inline-flex; align-items: center; gap: 10px; }
.table-controls select,
.table-controls input[type="search"] {
  height: 40px;
  border: 1px solid #c3ccd4;
  border-radius: 3px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 18px;
  background: #fff;
}
.table-controls input[type="search"] { width: 263px; }

.results-table-wrap {
  background: #fff;
  border: 1px solid var(--nd-border);
  border-radius: 2px;
  overflow-x: auto;
}

table.offender-table { width: 100%; border-collapse: collapse; font-size: 18px; }

table.offender-table th {
  text-align: left;
  color: var(--nd-heading);
  font-size: 18px;
  font-weight: 700;
  padding: 15px 18px;
  border-bottom: 2px solid #9aa7b3;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.offender-table th .sort-icon { color: #97a2ad; font-size: 14px; margin-left: 8px; }
table.offender-table th.sorted-asc .sort-icon,
table.offender-table th.sorted-desc .sort-icon { color: var(--nd-heading); }

table.offender-table td {
  padding: 18px;
  vertical-align: top;
  border-bottom: 1px solid #e8ecf0;
  color: #2b3640;
}
table.offender-table tbody tr:nth-child(odd) td { background: #f1f3f5; }
table.offender-table tbody tr:nth-child(even) td { background: #fff; }

.offender-photo {
  width: 78px;
  height: 93px;
  object-fit: cover;
  border: 1px solid #b9c1c9;
  background: #e6e9ec;
  display: block;
}

.offender-name { color: #2b3640; font-weight: 400; margin-bottom: 4px; }
.row-link { display: block; font-size: 17px; }
.aliases-title { margin-top: 10px; font-weight: 700; font-size: 17px; color: #2b3640; }
.aliases-list { margin: 2px 0 0 23px; font-size: 17px; color: #2b3640; }

.residence-line { line-height: 1.45; }
.special-directions { margin-top: 8px; font-weight: 700; font-size: 17px; }

.no-results-row td {
  text-align: center;
  padding: 28px 18px;
  color: #3a4450;
  background: #f1f3f5 !important;
  font-size: 18px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 18px;
  font-size: 18px;
  color: #3a4450;
}

.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination button {
  min-width: 43px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: var(--nd-link);
  font-family: inherit;
  font-size: 17px;
  border-radius: 3px;
  cursor: pointer;
}
.pagination button:hover:not(:disabled):not(.current) { background: #eef2f6; }
.pagination button.current {
  background: var(--nd-navy);
  border-color: var(--nd-navy);
  color: #fff;
  cursor: default;
}
.pagination button:disabled { color: #a6afb8; cursor: default; background: #fff; }
.pagination button.ellipsis { border-color: transparent; cursor: default; color: #6a737c; }

.back-link { display: inline-block; margin-top: 28px; font-size: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1075px) {
  .top-bar-inner { flex-direction: column; align-items: flex-start; gap: 13px; }
  .state-wordmark { font-size: 29px; }
  .registry-banner h1 { font-size: 28px; }
  .registry-banner p { font-size: 18px; }
  .page h2, .results-page h2 { font-size: 33px; }
  .search-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .table-controls { flex-direction: column; align-items: flex-start; }
  .table-controls input[type="search"] { width: 100%; }
}

/* =============================================================
   Offender Profile page
   ============================================================= */
.profile-page h2 {
  font-size: 40px;
  font-weight: 600;
  color: var(--nd-heading);
  margin-bottom: 20px;
}

.track-btn-row { margin-bottom: 25px; }

.card {
  background: #fff;
  border: 1px solid var(--nd-border);
  border-radius: 3px;
  margin-bottom: 23px;
  overflow: hidden;
}
.card-header {
  background: var(--nd-panel);
  border-bottom: 1px solid var(--nd-border);
  padding: 14px 20px;
  font-size: 18px;
  color: #2b3640;
}
.card-body { padding: 20px; }

/* ---------- Offender + Primary Information row ---------- */
.profile-top {
  display: grid;
  grid-template-columns: 375px 1fr;
  gap: 23px;
  align-items: stretch;
  margin-bottom: 23px;
}
.profile-top .card { margin-bottom: 0; height: 100%; }

.main-photo {
  width: 168px;
  height: 205px;
  object-fit: cover;
  border: 1px solid #c8ced4;
  background: #e6e9ec;
  display: block;
}
.photo-thumbs { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.photo-thumbs img {
  width: 43px;
  height: 43px;
  object-fit: cover;
  border: 1px solid #c8ced4;
  background: #e6e9ec;
  cursor: pointer;
}
.photo-thumbs img.selected { outline: 2px solid var(--nd-navy); outline-offset: 1px; }

/* ---------- Label / value rows ---------- */
.info-row {
  display: grid;
  grid-template-columns: 238px 1fr;
  gap: 13px;
  padding: 3px 0;
  font-size: 18px;
  align-items: start;
}
.info-row .info-label { font-weight: 700; color: #1f3b57; }
.info-row .info-value { color: #2f5f8f; }

/* ---------- Data tables inside cards ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 17px; }
table.data-table th {
  text-align: left;
  font-weight: 700;
  color: #1f3b57;
  padding: 13px 15px;
  border-bottom: 2px solid #9aa7b3;
  white-space: nowrap;
}
table.data-table td {
  padding: 14px 15px;
  color: #2f5f8f;
  border-bottom: 1px solid #e8ecf0;
  vertical-align: top;
}
table.data-table tbody tr:nth-child(odd) td { background: #f1f3f5; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table td.empty-cell,
.empty-note { color: #6a737c; font-style: italic; }

/* ---------- Nested sub-card (Residence Addresses) ---------- */
.subcard {
  border: 1px solid var(--nd-border);
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
}
.subcard-header {
  background: var(--nd-panel);
  border-bottom: 1px solid var(--nd-border);
  padding: 13px 18px;
  font-size: 18px;
  color: #2b3640;
}
.subcard-body { padding: 18px; }

.address-block { font-size: 18px; color: #2f5f8f; line-height: 1.6; }
.address-block + .address-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eceff2; }
.address-block .address-lines { display: block; }
.address-block .show-map { display: block; margin-top: 13px; font-size: 17px; }

/* ---------- Collapsible sections ---------- */
.collapsible {
  border: 1px solid var(--nd-border);
  border-radius: 3px;
  background: #fff;
  margin-bottom: 23px;
  overflow: hidden;
}
.collapsible-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 20px;
  background: #fff;
  border: none;
  font-family: inherit;
  font-size: 18px;
  color: #2b3640;
  text-align: left;
  cursor: pointer;
}
.collapsible-toggle:hover { background: #f7f9fb; }
.collapsible-toggle .chevron {
  flex: none;
  transition: transform .18s ease;
  color: #5a646e;
  font-size: 16px;
}
.collapsible.open .collapsible-toggle {
  background: var(--nd-navy);
  color: #fff;
}
.collapsible.open .collapsible-toggle:hover { background: #17375a; }
.collapsible.open .collapsible-toggle .chevron { transform: rotate(180deg); color: #fff; }

.collapsible-content { display: none; padding: 20px; border-top: 1px solid var(--nd-border); }
.collapsible.open .collapsible-content { display: block; }

.address-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.address-tab-box {
  border: 1px solid var(--nd-border);
  border-radius: 3px;
  background: var(--nd-panel);
  overflow: hidden;
}
.address-tab-box .box-title {
  padding: 14px 18px;
  font-size: 18px;
  color: #2b3640;
  background: var(--nd-panel);
}
.address-tab-box .box-body {
  padding: 15px 18px;
  background: #fff;
  border-top: 1px solid var(--nd-border);
  font-size: 17px;
  color: #2f5f8f;
}

.vehicles-note { font-size: 17px; color: #2f5f8f; margin-bottom: 15px; }

/* ---------- Qualifying Offense Information ---------- */
.offense-block { padding: 4px 0 20px; }
.offense-block + .offense-block { border-top: 1px solid #e3e8ec; padding-top: 20px; }

/* ---------- Other State Offenses ---------- */
.notes-card p { font-size: 17px; color: #2f5f8f; line-height: 1.65; }
.notes-card p + p { margin-top: 15px; }

@media (max-width: 1075px) {
  .profile-top { grid-template-columns: 1fr; }
  .info-row { grid-template-columns: 1fr; gap: 0; }
  .info-row .info-label { margin-top: 10px; }
  .address-tabs { grid-template-columns: 1fr; }
  .profile-page h2 { font-size: 33px; }
}

/* =============================================================
   Admin page
   ============================================================= */
.admin-page { max-width: 1475px; }
.admin-page h2 { font-size: 38px; color: var(--nd-heading); margin-bottom: 8px; }
.admin-sub { font-size: 18px; color: #5a646e; margin-bottom: 25px; }

.login-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(180deg, #1a456f 0%, #102c47 100%);
  display: flex; align-items: center; justify-content: center; padding: 25px;
}
.login-card {
  background: #fff; border-radius: 4px; padding: 35px 38px;
  width: 425px; max-width: 100%; box-shadow: 0 13px 50px rgba(0,0,0,.35);
}
.login-card h3 { font-size: 24px; color: var(--nd-heading); margin-bottom: 4px; }
.login-card p { font-size: 16px; color: #5a646e; margin-bottom: 20px; }
.login-card input {
  width: 100%; height: 50px; border: 1px solid #c3ccd4; border-radius: 3px;
  padding: 0 13px; font-size: 19px; font-family: inherit; margin-bottom: 15px;
}
.login-err { display: none; color: #b3261e; font-size: 16px; margin-bottom: 13px; }

.admin-msg { display: none; padding: 14px 18px; border-radius: 3px; font-size: 18px; margin-bottom: 20px; }
.admin-msg.ok  { display: block; background: #e9f4ec; color: #1c6b3a; border: 1px solid #bfe0ca; }
.admin-msg.err { display: block; background: #fdecea; color: #b3261e; border: 1px solid #f3c4bf; }

.form-section { margin-bottom: 30px; }
.form-section > h3 {
  font-size: 19px; color: var(--nd-heading); font-weight: 700;
  padding-bottom: 10px; margin-bottom: 18px; border-bottom: 1px solid var(--nd-border);
}
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.form-grid .field { margin-bottom: 0; }
.form-grid .field.full { grid-column: 1 / -1; }
.field textarea {
  width: 100%; min-height: 88px; border: 1px solid #c3ccd4; border-radius: 3px;
  padding: 10px 13px; font-size: 18px; font-family: inherit; resize: vertical;
}
.field .hint { font-size: 15px; color: #6a737c; margin-top: 4px; font-weight: 400; }
.req { color: #b3261e; }

.repeat-row {
  display: grid; gap: 13px; align-items: end;
  padding: 15px; border: 1px solid var(--nd-border);
  border-radius: 3px; background: #fbfcfd; margin-bottom: 13px;
}
.repeat-row .field label { font-size: 16px; }
.repeat-row .remove-x {
  background: #fdecea; color: #b3261e; border: 1px solid #f3c4bf;
  border-radius: 3px; height: 43px; padding: 0 15px; cursor: pointer;
  font-family: inherit; font-size: 16px;
}
.repeat-row.cols-5 { grid-template-columns: repeat(5, 1fr) auto; }
.repeat-row.cols-4 { grid-template-columns: repeat(4, 1fr) auto; }
.repeat-row.cols-2 { grid-template-columns: 2fr 1fr auto; }
.repeat-row.offense-row { grid-template-columns: 1fr 1fr auto; }
.repeat-row.offense-row .field.full { grid-column: 1 / -1; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 17px; background: #fff; }
.admin-table th {
  text-align: left; padding: 13px 15px; border-bottom: 2px solid #9aa7b3;
  color: var(--nd-heading); font-size: 16px;
}
.admin-table td { padding: 13px 15px; border-bottom: 1px solid #e8ecf0; vertical-align: middle; }
.admin-table tbody tr:nth-child(odd) td { background: #f7f9fb; }
.admin-table img { width: 48px; height: 58px; object-fit: cover; border: 1px solid #c8ced4; display: block; }

.btn-danger { background: #b3261e; color: #fff; border-color: #93201a; }
.btn-danger:hover { background: #93201a; }
.btn-ghost { background: #fff; color: var(--nd-navy); border-color: #c3ccd4; }
.btn-ghost:hover { background: #eef2f6; }

.photo-preview {
  width: 138px; height: 168px; object-fit: cover;
  border: 1px solid #c8ced4; background: #eef1f4; display: block;
}

@media (max-width: 1075px) {
  .form-grid { grid-template-columns: 1fr; }
  .repeat-row.cols-5, .repeat-row.cols-4,
  .repeat-row.cols-2, .repeat-row.offense-row { grid-template-columns: 1fr; }
}

/* =============================================================
   Site logo (top-left of the header)
   ============================================================= */
.site-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.site-logo {
  height: 34px;
  width: auto;
  display: block;
}
@media (max-width: 860px) {
  .site-logo { height: 27px; }
}
