/* Global paper texture overlay (topmost layer) */
body { position: relative; }

body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: url('../assets/images/PaperBackground.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.22; /* adjust texture strength */
  pointer-events: none;
  z-index: 999999; /* above all site content */
}

/* Hook title styling */
#hook .hook-title {
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1.25;
  text-align: left;
  margin: 0;                 /* flush left */
}

/* Section title styling (for all sections except hook) */
.section-title {
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(2.07rem, 2.99vw, 2.99rem); /* 15% larger */
  line-height: 1.25;
  text-align: left;
  margin: 0 0 1rem 0;
  font-weight: 700;
  color: #222;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.section-description {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.1rem;
  line-height: 1.6;
  text-align: left;
  margin: 0 0 0.5rem 0;
  color: #444;
}

.section-description:last-child {
  margin-bottom: 0;
}

/* Section title card styling - positioned above graphics */
.section-title-card {
  grid-column: 1 / -1; /* Span full width of grid */
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #ddd;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

/* Reset graphic containers to default layout since titles are outside */
/* These selectors are kept for potential future styling overrides */

/* Hook-only layout: title above text, no red box */
#hook.scrolly {
  display: grid;
  grid-template-columns: 1fr; /* stack */
  gap: 1rem;
  justify-items: start;       /* left align content */
  padding: 0;                  /* Remove any padding */
  margin: 0;                   /* Remove any margin */
}

#hook .graphic {
  position: static;           /* no sticky */
  top: auto;
  height: auto;
  border: none;               /* remove red box */
  background: transparent;
  margin: 0 0 0.5rem 0;
}

/* MainViz2 - full width layout like hook */
#mainviz2.scrolly {
  display: grid;
  grid-template-columns: 1fr; /* stack */
  gap: 0; /* Remove gap between title and graphic */
  justify-items: start;
  min-height: 2000vh; /* Make section tall for scroll locking - increased for longer scroll */
  position: relative;
  margin-bottom: 0;
}

/* Position title card absolutely over the graphic */
#mainviz2 .section-title-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  margin: 0;
  padding: 2rem;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

/* Graphic starts at top, title overlays it */
#mainviz2 .graphic {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0; /* Start at top of section */
  border: none;
  background: #fafafa;
  z-index: 1;
}

#mainviz2 #mainviz2-container {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: visible;
}

/* Right-side info column for mainviz2 */
#mainviz2 #mainviz2-info-column {
  position: absolute;
  top: 0;
  right: 0;
  width: 25%;
  min-width: 250px;
  max-width: 350px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #ddd;
  z-index: 10;
  display: flex;
  flex-direction: column;
  opacity: 1;
  overflow: hidden;
}

/* Top section - Counter */
#mainviz2 #mainviz2-info-column .info-column-top {
  flex-shrink: 0;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

#mainviz2 #mainviz2-info-column .counter-section {
  text-align: center;
}

#mainviz2 #mainviz2-info-column .counter-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

#mainviz2 #mainviz2-info-column .counter-value {
  font-size: 32px;
  font-weight: 700;
  color: #222;
  line-height: 1;
}

/* Middle section - Filters */
#mainviz2 #mainviz2-info-column .info-column-middle {
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  overflow-y: auto;
  max-height: 50vh;
}

#mainviz2 #mainviz2-info-column .filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#mainviz2 #mainviz2-info-column .filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#mainviz2 #mainviz2-info-column .filter-select {
  width: 100%;
  padding: 0.5rem;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #222;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  transition: border-color 0.2s ease;
}

#mainviz2 #mainviz2-info-column .filter-select:hover {
  border-color: #999;
}

#mainviz2 #mainviz2-info-column .filter-select:focus {
  outline: none;
  border-color: #8b1e3f;
}

#mainviz2 #mainviz2-info-column .reset-filter-btn {
  width: 100%;
  padding: 0.5rem;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #8b1e3f;
  border: none;
  border-radius: 4px;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  transition: background-color 0.2s ease;
  margin-top: 0.5rem;
}

#mainviz2 #mainviz2-info-column .reset-filter-btn:hover {
  background: #6d1630;
}

#mainviz2 #mainviz2-info-column .reset-filter-btn:active {
  background: #5a1228;
}

/* Bottom section - Person Info */
#mainviz2 #mainviz2-info-column .info-column-bottom {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

#mainviz2 #mainviz2-info-column .info-column-content {
  padding: 1.5rem;
  font-size: 13px;
  line-height: 1.5;
  color: #222;
}

#mainviz2 #mainviz2-info-column .info-column-placeholder {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 1.5rem;
}

#mainviz2 #mainviz2-info-column .info-item {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

#mainviz2 #mainviz2-info-column .info-item:last-child {
  border-bottom: none;
}

#mainviz2 #mainviz2-info-column .info-item strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #333;
  font-size: 12px;
}


#hook .article {
  position: static;
  z-index: auto;
  background: transparent;
  align-items: flex-start;
  text-align: left;
  padding: 0 !important;       /* Force remove all padding */
  margin: 0 !important;         /* Force remove all margin */
  max-width: 100% !important;  /* Force full width */
  width: 100% !important;       /* Force full width */
}

#hook .step {
  margin: 0;                   /* remove top margin */
  padding: 0;
  background: transparent;
  border-left: none;
}

/* First hook step should have minimal top spacing */
#hook #hook-result-step {
  margin-top: 0;
}

/* Hook form aesthetic */
#hook #hook-form {
  display: grid;
  gap: 0.75rem;
  max-width: 520px;
}
#hook .hook-instructions {
  margin: 0 0 0.5rem 0;
}
#hook #hook-form label {
  display: grid;
  gap: 0.25rem;
}
#hook #hook-form input,
#hook #hook-form select {
  padding: 0.5rem 0.6rem;
  border: 1px solid #222;
  background: rgba(255,255,255,0.9);
}
#hook #hook-form button {
  width: fit-content;
  padding: 0.5rem 0.9rem;
  border: 1px solid #222;
  background: #fff;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
}
#hook .hook-certify {
  margin-top: 0.25rem;
}
#hook .hook-signature {
  display: inline-block;
  margin-left: 0.5rem;
}

/* Hook visuals - person images with tinting */
/* For white images: Use CSS filter to tint them */
/* Since images are white, we use brightness(0) to make black, then adjust */

/* Main person visual container */
#hook #hook-person-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 220px;
  margin: 0 auto;
  text-align: center;
}

/* Assigned person in hook - blue tint */
#hook #hook-person-visual img.person-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.5rem auto;
  /* Tint assigned person to blue #5456A0 */
  filter: brightness(0) saturate(100%) invert(33%) sepia(47%) saturate(1234%) hue-rotate(210deg) brightness(0.85) contrast(0.9);
  transition: filter 0.2s ease;
}

#hook #hook-person-visual img.person-img:hover {
  /* Light blue #C3C0D8 on hover */
  filter: brightness(0) saturate(100%) invert(77%) sepia(8%) saturate(1234%) hue-rotate(210deg) brightness(1.1) contrast(0.9);
}

/* Person image wrapper for grid items */
#hook .person-img-wrapper {
  display: inline-block;
  position: relative;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
}

#hook .person-img-wrapper img.person-img {
  display: block;
  width: 100%;
  height: 100%;
  /* Tint white image to dark color (#171A21) */
  filter: brightness(0.08) contrast(1.2);
  transition: filter 0.2s ease;
}

/* Hover state - change to gray (#8B8989) */
#hook .person-img-wrapper:hover img.person-img {
  filter: brightness(0.55) contrast(1);
}

/* Tooltip styling */
#hook .person-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.95);
  color: white;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
  min-width: 200px;
  max-width: 300px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#hook .person-tooltip div {
  margin: 2px 0;
}

#hook .person-tooltip strong {
  display: inline-block;
  min-width: 120px;
}

#hook .person-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
}

/* Show tooltip on hover */
#hook .person-img-wrapper:hover .person-tooltip,
#hook #hook-person-visual:hover .person-tooltip {
  opacity: 1;
}

/* For items in first rows, show tooltip below instead of above to prevent going out of bounds */
/* Calculate based on typical grid width - assuming ~20-30 items per row, show first 2 rows below */
#hook .unit-grid .person-img-wrapper:nth-child(-n+68) .person-tooltip {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
  margin-bottom: 0;
}

#hook .unit-grid .person-img-wrapper:nth-child(-n+30) .person-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(0, 0, 0, 0.95);
}

/* Ensure tooltip container allows overflow - update existing rule */
#hook .unit-viewport {
  overflow-x: hidden;      /* prevent horizontal overflow */
  overflow-y: visible;     /* allow vertical scrolling for rows */
  height: auto;            /* allow all rows to show */
  position: relative;      /* for tooltip positioning */
  padding-bottom: 150px;   /* Add padding at bottom so tooltips below can be seen */
  margin-bottom: 20px;     /* Extra margin for tooltip visibility */
}

/* Make sure tooltips don't get clipped */
#hook .person-img-wrapper {
  position: relative;
  z-index: 1;
}

#hook .person-img-wrapper:hover {
  z-index: 10;
}

/* Tooltip for main person visual - appears below */
#hook #hook-person-visual .person-tooltip {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
  margin-bottom: 0;
  left: 0;
  transform: translateX(0);
}

#hook #hook-person-visual .person-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(0, 0, 0, 0.95);
}

#hook .unit-section { 
  margin: 0.75rem auto;
  width: 100%;
  max-width: 90%;
  text-align: center;
}

/* Filter buttons for gender section */
.hook-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin: 1rem 0;
  padding-left: 4rem; /* Match the grid's left padding */
}

.hook-filter-btn {
  padding: 0.5rem 1rem;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  transition: all 0.2s ease;
}

.hook-filter-btn:hover {
  background: #e0e0e0;
  border-color: #bbb;
}

.hook-filter-btn.active {
  color: #fff;
  background: #8b1e3f;
  border-color: #8b1e3f;
}

.hook-filter-btn.active:hover {
  background: #6d1630;
  border-color: #6d1630;
}

/* View toggle button */
.hook-view-toggle-btn {
  padding: 0.75rem 1.5rem;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #8b1e3f;
  border: 2px solid #8b1e3f;
  border-radius: 6px;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  transition: all 0.2s ease;
}

.hook-view-toggle-btn:hover {
  background: #6d1630;
  border-color: #6d1630;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(139, 30, 63, 0.3);
}

/* Multi-view container */
#hook-multiview-container {
  width: 100%;
  max-height: calc(100vh - 4rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#hook-pyramid-container,
#hook-timeline-container {
  background: #fafafa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

#hook-pyramid-container svg,
#hook-timeline-container svg {
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

#hook-visualization-container {
  width: 100%;
  max-width: 100%;
}

/* Person selection highlight */
.hook-person-selected {
  outline: 3px solid #8b1e3f !important;
  outline-offset: 2px;
}

/* Apply red tint to selected person images (but not assigned persons) */
.hook-person-selected:not(.assigned-person) .person-img {
  /* Red tint filter matching color palette #8b1e3f */
  filter: brightness(0) saturate(100%) invert(12%) sepia(78%) saturate(2455%) hue-rotate(315deg) brightness(0.6) contrast(1.2) !important;
}

/* Left align the age and gender text sections */
#hook #hook-age-text,
#hook #hook-gender-text {
  text-align: left;
  margin: 0;
  max-width: 100%;
  padding-left: 4rem; /* Match the grid's left padding */
}
#hook #hook-compare-step { padding-bottom: 0; }
#hook .unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 36px));
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto;
  padding: 1rem 1rem 150px 1rem;  /* Extra bottom padding for tooltips */
  width: 100%;
  max-width: 90%;
}
#hook .unit-grid img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  max-width: 100%;
}

/* MainViz counter display */
#mainviz-counter-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 600px;
  text-align: center;
}

#mainviz .mainviz-rate-message {
  font-size: 1.5rem;
  line-height: 1.6;
  font-weight: 600;
  color: #222;
  margin: 0;
}

#mainviz .mainviz-dynamic-message {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #444;
  margin: 0;
}

#mainviz #mainviz-arrest-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #d32f2f;
  display: inline-block;
  min-width: 60px;
  text-align: center;
}

#mainviz .graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
}

/* Solution section styling */
#solution-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

#solution-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #222;
  margin: 0;
  line-height: 1.3;
}

.solution-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  background-color: #8B1E3F;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.solution-button:hover {
  background-color: #b71c1c;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.4);
}

.solution-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
}


.sidebar-counter {
  text-align: center;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 6px;
}

.sidebar-counter h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.5rem 0;
}

.sidebar-counter .counter-value {
  font-size: 2rem;
  font-weight: 800;
  color: #c62828;
  margin: 0.5rem 0;
}

.sidebar-counter .counter-label {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
}

.person-details-panel {
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.person-details-img {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 4px;
}

.person-details-info {
  font-size: 0.875rem;
  color: #333;
}

.detail-row {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.detail-row strong {
  display: inline-block;
  min-width: 120px;
  color: #555;
}

/* Person nodes in visualization */
.person-node {
  transition: transform 0.2s ease;
}

.person-node:hover {
  transform: scale(1.2);
  z-index: 10;
}

.person-image {
  pointer-events: all;
  transition: filter 0.2s ease;
}



/* MainViz counter display */

/* ============================================
   Government Form Styling (I-9 Style)
   ============================================ */

/* Form container with zoom capability */
.legal-form-zoom {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: #fff;
  transform: scale(var(--zoom, 1.5));
  transform-origin: center center;
}

/* Reduce height for mainviz section to minimize gap */
#mainviz .legal-form-zoom {
  min-height: auto;
  padding: 1rem;
  margin-bottom: 0;
}

/* Reduce height and spacing for solution section */
#solution .legal-form-zoom {
  min-height: auto;
  padding: 0rem 0rem;
  margin-top: 9rem;
  margin-bottom: 9rem;
}

#solution.scrolly {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  min-height: auto;
}

/* Reduce spacing between article and form in solution */
#solution .article {
  margin-bottom: 1rem;
}

#solution .step {
  margin-bottom: 0;
}

#mainviz.scrolly {
  margin-top: 11rem;
  margin-bottom: 11rem;
  padding-bottom: 11rem;
}

/* Deportation status section - reduce spacing */
#deportation-status .article {
  display: none; /* Hide empty article to remove spacing */
}

#deportation-status.scrolly {
  margin-bottom: 0;
  padding-bottom: 0;
}

#mainviz .article {
  display: none; /* Hide empty article */
}

.legal-form {
  width: 100%;
  max-width: 850px;
  background: #fff;
  border: 1px solid #ccc;
  padding: 0;
  margin: 2rem auto;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.4;
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header section */
.legal-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 8px solid #000;
  background: #fff;
  position: relative;
}

.legal-header::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 1px;
  background: #000;
  border-bottom: 1px solid #000;
}

.legal-header-left {
  display: flex;
  align-items: center;
}

.legal-logo {
  height: 75px;
  width: auto;
  object-fit: contain;
}

.legal-header-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.legal-form-title {
  font-size: 14pt;
  font-weight: bold;
  color: #000;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legal-form-subtitle {
  font-size: 12pt;
  font-weight: normal;
  color: #000;
  margin: 0;
  letter-spacing: 0.5px;
}

.legal-header-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
}

.legal-form-id {
  font-size: 10pt;
  font-weight: bold;
  color: #000;
  line-height: 1.3;
  text-align: right;
}

.legal-form-number {
  font-size: 9pt;
  color: #666;
  margin-top: 4px;
}

/* Section title */
.legal-section-title {
  background: #f0f0f0;
  padding: 8px 16px;
  font-size: 11pt;
  font-weight: bold;
  border-bottom: 1px solid #000;
  border-top: 1px solid #ccc;
  margin: 0;
  color: #000;
}

/* Instructions */
.legal-instructions {
  padding: 12px 16px;
  font-size: 10pt;
  line-height: 1.5;
  color: #000;
  margin: 0;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.legal-instructions::before {
  content: "►";
  margin-right: 4px;
  color: #000;
}

/* Form body */
.legal-body {
  padding: 16px;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.legal-body > .legal-field-grid,
.legal-body > .legal-row {
  width: 100%;
}

/* Field grid layout */
.legal-field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 0;
  border-collapse: collapse;
  border-spacing: 0;
}

/* Individual field */
.legal-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  border: 1px solid #000 !important;
  border-right: none;
  min-height: 55px;
}

.legal-field-grid .legal-field:last-child {
  border-right: 1px solid #000 !important;
}

/* Single column grids - all fields should have right border */
.legal-field-grid[style*="grid-template-columns: 1fr"] .legal-field {
  border-right: 1px solid #000 !important;
}

.legal-field.narrow {
  max-width: 200px;
  border-right: 1px solid #000 !important;
}

.legal-label {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9pt;
  font-weight: normal;
  font-style: italic;
  color: #666;
  margin: 0;
  line-height: 1.2;
  z-index: 1;
  pointer-events: none;
  background: #fff;
  padding: 0 3px;
}

/* Input and select styling - increased specificity to override #intro-form */
#intro-form .legal-field input[type="text"],
#intro-form .legal-field input[type="date"],
#intro-form .legal-field select,
.legal-field input[type="text"],
.legal-field input[type="date"],
.legal-field select {
  width: 100%;
  padding: 24px 6px 2px 6px;
  border: none;
  background: #fff;
  font-family: "Times New Roman", Times, serif !important;
  font-size: 11pt;
  color: #000;
  line-height: 1.1;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  margin-top: auto;
  outline: none;
  min-height: 55px;
  height: 100%;
}

.legal-field input[type="date"] {
  padding-right: 4px;
  min-width: 0;
}

.legal-field input[type="text"]:focus,
.legal-field input[type="date"]:focus,
.legal-field select:focus {
  outline: 2px solid #0066cc;
  outline-offset: -2px;
  border-color: #0066cc;
}

/* Select dropdown arrow styling - inherits all from main rule, just adds arrow */
#intro-form .legal-field select,
.legal-field select {
  padding-right: 24px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

/* Row layout for fields that span */
.legal-row {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  align-items: stretch;
}

.legal-row .legal-field {
  border-right: none;
}

.legal-row .legal-field:last-child {
  border-right: 1px solid #000 !important;
}

/* Certification section */
.legal-certify {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  font-size: 10pt;
  line-height: 1.6;
  color: #000;
}

.legal-signature {
  display: inline-block;
  margin-left: 8px;
  font-weight: normal;
}

.legal-signature span {
  display: inline-block;
  min-width: 200px;
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
  margin-left: 8px;
  text-align: left;
}

/* Hide the placeholder underscores */
#intro-signature-name:empty::before,
#intro-signature-name:has-text("________") {
  content: "";
}

/* Submit button */
.legal-body button[type="submit"] {
  margin-top: 20px;
  padding: 8px 24px;
  background: #fff;
  border: 2px solid #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  font-weight: bold;
  color: #000;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.legal-body button[type="submit"]:hover {
  background: #ccc;
  color: #000;
  border-color: #ccc;
}

.legal-body button[type="submit"]:active {
  background: #8B1E3F;
  color: #fff;
  border-color: #8B1E3F;
}

/* Content styling for legal-field boxes (for Scale and Call to Action sections) */
.legal-field p,
.legal-field .mainviz-rate-message,
.legal-field .mainviz-dynamic-message {
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.4;
  color: #000;
  margin: 0;
}

.legal-field a {
  font-family: "Times New Roman", Times, serif;
  color: #000;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.legal-field a:hover {
  background: #ccc;
  color: #000;
}

.legal-field a:active {
  background: #8B1E3F;
  color: #fff;
}

/* Link button in solution section */
.legal-body.button,
.legal-field a.legal-body.button,
a.legal-body.button {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}

.legal-body.button:hover,
.legal-field a.legal-body.button:hover,
a.legal-body.button:hover {
  background: #ccc !important;
  color: #000 !important;
  border-color: #ccc !important;
}

.legal-body.button:active,
.legal-field a.legal-body.button:active,
a.legal-body.button:active {
  background: #8B1E3F !important;
  color: #fff !important;
  border-color: #8B1E3F !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .legal-field-grid {
    grid-template-columns: 1fr;
  }
  
  .legal-form {
    max-width: 100%;
    margin: 0;
  }
  
  .legal-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .legal-header-right {
    text-align: left;
    padding-left: 0;
  }
}



