.panel h2 {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-md);
}

.panel > .form-help {
  margin-bottom: var(--spacing-lg);
}

.form-help.form-help--dark {
  color: var(--text-color);
}

.name-lookup {
  margin-top: var(--spacing-lg);
}

.name-lookup h3 {
  color: var(--primary-color);
  font-size: 1.05rem;
  margin-bottom: var(--spacing-sm);
}

.name-lookup .note,
#notFoundNote {
  margin-top: var(--spacing-md);
}

.lookup-match {
  margin: var(--spacing-xs) 0;
}

.form-section h3 {
  color: var(--primary-color);
  font-size: 1.125rem;
  margin-bottom: var(--spacing-md);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

.panel-heading h2 {
  margin-bottom: 0;
}

.type-badge {
  display: inline-block;
  padding: 0.125rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: white;
  background: var(--primary-color);
}

.type-badge.rookie {
  background: var(--success-color);
}

.profile-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--spacing-sm) var(--spacing-lg);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.profile-grid dt {
  font-weight: 600;
  color: var(--text-muted);
}

.profile-grid dd {
  overflow-wrap: anywhere;
}

.profile-grid .muted {
  color: var(--text-muted);
  font-style: italic;
}

.phone-list {
  list-style: none;
}

.form-group input.input-medium {
  max-width: 16rem;
}

/* Sized to their content: ###-###-####, two-letter states, sizes, dates */
.form-group input.input-phone {
  max-width: 9.5rem;
}

.form-group select.select-state {
  width: 5.5rem;
}

.form-group select.select-size,
.form-group input.input-size {
  max-width: 10rem;
}

.form-group input.input-date {
  width: 100%;
  max-width: 12rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  min-height: 2.5rem;
}

.form-group input.input-code {
  max-width: 8rem;
  font-size: 1.25rem;
  letter-spacing: 0.2em;
}

.checkbox-group--stacked {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--spacing-sm);
}

/* Buttons line up with the first line of a long label, and are big enough to tap */
.checkbox-group label,
.radio-group label {
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.checkbox-group label input,
.radio-group label input {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--primary-color);
}

.sub-question {
  margin-left: var(--spacing-lg);
  padding-left: var(--spacing-md);
  border-left: 3px solid var(--border-color);
}

.note {
  background: #fff8e1;
  border: 1px solid var(--warning-color);
  border-radius: var(--border-radius);
  color: #6d5200;
  padding: var(--spacing-md);
}

.youth-note {
  margin-bottom: var(--spacing-lg);
}

.form-actions--start {
  justify-content: flex-start;
}

@media (max-width: 768px) {
  /* Registration form: Submit stays on top when the buttons stack (the shared
     stylesheet reverses stacked buttons) */
  #registerForm > .form-actions {
    flex-direction: column;
  }

  .radio-group label,
  .checkbox-group label {
    padding: 0.25rem 0;
  }

  main {
    padding: var(--spacing-md);
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-grid dd {
    margin-bottom: var(--spacing-sm);
  }

  .sub-question {
    margin-left: 0;
  }
}

/* Admin summary */
.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.summary-tile {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-xs) var(--spacing-sm);
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

.summary-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.status-flag {
  color: var(--danger-color);
  font-weight: 600;
}

#registrationsTableBody tr:hover {
  cursor: default;
}

/* Admin: Registrations / Roster tabs, and the All / Adult / Youth switch */
.view-tabs {
  display: flex;
  gap: var(--spacing-xs);
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--spacing-lg);
}

.view-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: var(--spacing-sm) var(--spacing-md);
  font: inherit;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.view-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.segment {
  background: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  font: inherit;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
}

.segment + .segment {
  border-left: 1px solid var(--primary-color);
}

.segment.active {
  background: var(--primary-color);
  color: white;
}

.muted-text {
  color: var(--text-muted);
}

/* Admin page: a little wider than the public form, and tighter spacing, so each tab's
   table fits on one screen */
.admin-page {
  --max-width: 1400px;
}

.admin-page .view-tabs,
.admin-page .segmented,
.admin-page .summary-row,
.admin-page .filters {
  margin-bottom: var(--spacing-md);
}

.admin-page .segment {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.875rem;
}

.admin-page .summary-value {
  font-size: 1.1rem;
}

.admin-page .filter-group label {
  font-size: 0.75rem;
}

.admin-page .filter-group select,
.admin-page .filter-group input,
.admin-page .filters .btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.875rem;
}

/* "Reminder email last sent on …" beside the Send Reminder Email button */
.admin-page .reminder-last-sent {
  align-self: center;
  margin: 0;
  font-size: 0.875rem;
}

/* Admin tables: compact so every column fits without scrolling sideways. Smaller text,
   centered columns; the first column (the name) stays left-aligned. */
.compact-table {
  font-size: 0.875rem;
  line-height: 1.3;
}

.compact-table th,
.compact-table td {
  padding: 0.35rem var(--spacing-xs);
  text-align: center;
}

.compact-table th {
  font-size: 0.8125rem;
  line-height: 1.2;
  vertical-align: bottom;
}

.compact-table th:first-child,
.compact-table td:first-child {
  text-align: left;
  padding-left: var(--spacing-sm);
}

.compact-table .cell-sub {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.compact-table td.cell-wrap {
  white-space: normal;
  min-width: 7rem;
}

/* Wraps to its content's longest word, for narrow columns like Membership */
.compact-table td.cell-narrow {
  white-space: normal;
}

/* Small second line in a cell: "(youth games only)", "Update" */
.compact-table .cell-note {
  font-size: 0.75rem;
  line-height: 1.2;
}

/* Registrations: the four "Needs" columns, kept narrow under one group header */
th.need-group {
  text-align: center;
  padding-bottom: 0;
}

th.need-col,
td.need-col,
.compact-table th.need-col {
  text-align: center;
  padding-left: var(--spacing-xs);
  padding-right: var(--spacing-xs);
}

th.need-col.th-wrap {
  min-width: 0;
  max-width: 4.5rem;
}

/* A header that wraps onto two lines instead of widening its column */
th.th-wrap {
  white-space: normal;
  min-width: 4.5rem;
  max-width: 6.5rem;
}

/* Photo confirmation inside the profile list */
.profile-grid .photo-confirm,
.profile-grid .photo-missing {
  margin-bottom: 0;
}

.contact-notice {
  margin-top: var(--spacing-md);
}

/* Thank-you page: welcome for new adult officials, Dragonfly reminder */
.done-welcome {
  font-size: 1.1em;
  font-weight: 600;
}

.done-dragonfly {
  margin-bottom: var(--spacing-md);
}

/* USA Lacrosse membership notices sit between questions */
#youthGamesUsaLacrosseNote,
#usaLacrosseRequiredNote {
  margin-bottom: var(--spacing-md);
}
