body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f5f5f5;
  line-height: 1.6;
}

body.no-scroll {
  overflow: hidden;
}

[x-cloak] {
  display: none !important;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  position: relative;
  background: white;
  padding: 30px;
  min-height: 500px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #333;
  text-align: center;
  margin-bottom: 10px;
  font-weight: 200;
}

h2 {
  color: #333;
  margin-bottom: 10px;
  font-weight: 200;
}

.subtitle {
  text-align: left;
  color: #666;
  margin-bottom: 30px;
  font-style: italic;
}

.form-group {
  margin-bottom: 25px;
  padding: 15px;
  border-left: 4px solid #007bff;
  background-color: #f8f9fa;
  border-radius: 0 4px 4px 0;
  transition: all 0.3s ease;
}

.form-group.completed {
  border-left-color: #155724;
  background-color: #d4edda;
}

.question-number {
  font-weight: bold;
  color: #0056b3;
  margin-bottom: 8px;
}

.completed .question-number {
  color: #155724;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: #333;
}

.question-text {
  font-size: 16px;
  margin-bottom: 20px;
  color: #444;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

select {
  background-color: white;
  cursor: pointer;
}

select option {
  padding: 8px;
}

.rating-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.rating-button {
  flex: 1;
  min-width: 120px;
  padding: 12px 8px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background-color: white;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.rating-button:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
  color: #333;
  /* Add this to ensure readable text on light hover background */
  transform: translateY(-1px);
}

.rating-button.selected {
  border-color: #0056b3;
  background-color: #0056b3;
  color: white;
  font-weight: 500;
  animation: pop 0.3s ease;
}

.rating-button.selected:hover {
  background-color: #004085;
  border-color: #004085;
  color: white;
  /* Fix contrast: ensure text stays white on dark background */
}

.rating-legend {
  /* margin: 15px 0 25px 0; */
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 1rem;
}

.rating-legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.rating-legend-item .eq {
  margin-right: 1rem;
  font-size: 1.5rem;
}

.rating-legend-item .legend-button {
  pointer-events: none;
  margin-right: 10px;
  flex: none;
}

@media screen and (max-width: 600px) {
  .rating-legend-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .rating-legend-item .eq {
    display: none;
  }
  .rating-legend-item .legend-button {
    width: 100%;
  }
  .rating-legend-item span {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .rating-buttons {
    flex-direction: column;
  }

  .rating-button {
    min-width: auto;
  }
}

textarea {
  height: 80px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 5px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.business-info {
  background-color: #e8f4fd;
  border-left-color: #17a2b8;
}

button {
  background-color: #007bff;
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-right: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

button:hover:not(:disabled) {
  /* background-color: #0056b3; */
  transform: translateY(-1px);
}

button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  background-color: #6c757d;
}

.button-group {
  text-align: center;
  margin-top: 30px;
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.button-group button {
  display: block;
  width: 100%;
  margin-right: 0;
}

.status {
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 4px;
  text-align: center;
  transition: all 0.3s ease;
}

.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.progress-wrapper {
  background-color: white;
  position: sticky;
  top: 0px;
  padding: 1px 0px 1px 0px;
}

.progress {
  margin: 16px 0;
  background-color: #e9ecef;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  transition: opacity 0.3s ease;
  position: relative;
}

.progress-wrapper .progress {
  height: 16px;
}

.progress-bar {
  background-color: #007bff;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: width 0.5s ease;
}

.progress-bar.saving {
  animation: blink 1s linear infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 0.4;
  }
  51%,
  100% {
    opacity: 1;
  }
}

.progress-text {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 10px;
  color: #666;
  font-size: 18px;
}

.auto-save-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  background-color: #28a745;
  color: white;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  transform: translateY(-100px);
  transition: transform 0.3s ease;
}

.auto-save-indicator.show {
  transform: translateY(0);
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

.disabled-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: all;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.business-id-popup {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  max-width: 65ch;
}

.business-id-popup input {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.business-id-popup button {
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.results-table th,
.results-table td {
  border: 1px solid #ddd;
  padding: 8px;
}

.results-table th {
  background-color: #f2f2f2;
}

.results-table pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.industry-hint {
  color: #666;
  /* text-decoration: none; */
  font-size: 0.75em;
}

.thank-you-message {
  text-align: center;
  font-size: 1.2em;
  margin: 40px 0;
}

.more-link {
  color: #007bff;
}
.more-link:hover {
  text-decoration: underline;
}

@keyframes pop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }
  .container {
    background: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  }
  .progress-wrapper {
    background-color: #1e1e1e;
  }
  h1 {
    color: #fff;
    font-weight: 200;
  }
  h2 {
    color: #fff;
    font-weight: 200;
  }
  a {
    color: #66b3ff;
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }
  .subtitle,
  .progress-text,
  label,
  .question-text {
    color: #ccc;
  }
  .question-number {
    color: #3399ff;
  }
  .completed .question-number {
    color: #52cc5e;
  }
  .form-group {
    background-color: #2b2b2b;
  }
  .form-group.completed {
    background-color: #27472d;
    border-left-color: #28a745;
  }
  input,
  textarea,
  select {
    background-color: #333;
    border-color: #555;
    color: #eee;
  }
  select {
    background-color: #333;
  }
  input:focus,
  textarea:focus,
  select:focus {
    border-color: #3399ff;
    box-shadow: 0 0 0 2px rgba(51, 153, 255, 0.25);
  }
  .rating-button {
    background-color: #333;
    border-color: #555;
    color: #eee;
  }
  .rating-button:hover {
    background-color: #444;
    color: #fff;
    border-color: #666;
  }
  button:hover:not(:disabled) {
    background-color: #0056b3;
  }
  .rating-button.selected {
    background-color: #004085;
    border-color: #004085;
    color: white;
  }
  .rating-legend {
    background-color: rgba(255, 255, 255, 0.05);
  }
  .status.success {
    background-color: #27472d;
    color: #c3e6cb;
    border-color: #1e7e34;
  }
  .status.error {
    background-color: #5f1a1f;
    color: #f5c6cb;
    border-color: #721c24;
  }
  .status.info {
    background-color: #0b3f4c;
    color: #bee5eb;
    border-color: #0c5460;
  }
  .progress {
    background-color: #333;
  }
  .progress-bar {
    background-color: #007bff;
  }
  .disabled-overlay {
    background: rgba(0, 0, 0, 0.6);
  }
  .business-id-popup {
    background: #1e1e1e;
    color: #eee;
  }
  .results-table th {
    background-color: #2b2b2b;
  }
  .results-table th,
  .results-table td {
    border-color: #444;
  }
  .thank-you-message {
    color: #eee;
  }
  .more-link {
    color: #66b3ff;
  }
}

.loader {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.business-id {
  cursor: pointer;
  color: #0645ad;
  text-decoration: underline;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.response-row {
  margin-bottom: 0.5em;
}
