:root {
  --primary-color: #4f46e5;
  --secondary-color: #2563eb;
  --text-color: #1f2937;
  --background-color: #f9fafb;
  --border-color: #d1d5db;
  --highlight-color: #fff9c4;
  --highlight-border: #ffeb3b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #0ea5e9;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background-color: white;
  color: var(--text-color);
  cursor: pointer;
  transition: all 150ms ease;
}

button:hover, .button:hover {
  background-color: #f9fafb;
}

button:focus, .button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:disabled, .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background-color: white;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 150ms ease;
}

.nav-button:hover {
  background-color: #f3f4f6;
}

.prev-button svg, .next-button svg {
  width: 1rem;
  height: 1rem;
}

.prev-button {
  margin-right: auto;
}

.next-button {
  margin-left: auto;
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.next-button:hover {
  background-color: #4338ca;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.app-container {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.app-header {
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.app-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.app-content {
  flex: 1;
  display: flex;
  padding: 2rem 0;
}

.form-panel {
  flex: 1;
  padding: 1.5rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  margin-right: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.preview-panel {
  flex: 1;
  position: relative;
  padding: 1.5rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.preview-content {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.875rem;
  line-height: 1.7;
}

.document-preview {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.875rem;
  line-height: 1.7;
  padding: 0.5rem;
}

.document-preview h1, .document-title {
  font-size: 11pt;
  text-align: center;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.document-preview h2 {
  font-size: 11pt;
  text-align: center;
  margin: 1.5rem 0 1rem;
}

.document-preview ol {
  padding-left: 2rem;
  margin-bottom: 1rem;
}

.document-preview ol ol {
  list-style-type: lower-alpha;
}

.document-preview ol ol ol {
  list-style-type: lower-roman;
}

.document-preview strong {
  font-weight: bold;
}

.document-preview .signature-block {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
}

.document-preview .signature-section {
  width: 48%;
}

.document-preview .signature-line {
  border-top: 1px solid black;
  width: 100%;
  margin: 2rem 0 0.5rem;
}

.document-preview li.section-space {
  margin-top: 20px;
}

.tab-navigation {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-navigation::-webkit-scrollbar {
  display: none;
}

.tab-button {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--primary-color);
}

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

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-input, .date-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: border-color 150ms ease;
}

.form-input:focus, .date-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: border-color 150ms ease;
  min-height: 100px;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.form-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  appearance: none;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.form-checkbox {
  width: 1.25rem; /* Increased from 1rem */
  height: 1.25rem; /* Increased from 1rem */
  margin-top: 0.25rem;
  margin-right: 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border-color);
  appearance: none;
  background-color: white;
  cursor: pointer;
}

.form-checkbox:checked {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.form-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.checkbox-label {
  font-size: 0.875rem;
  cursor: pointer;
}

.navigation-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.highlighted-text {
  background-color: var(--highlight-color);
  display: inline-block;
  padding: 2px 0;
  animation: highlight 2s;
  border-radius: 2px;
}

@keyframes highlight {
  0% { background-color: var(--highlight-border); }
  100% { background-color: var(--highlight-color); }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.info-box {
  background-color: #e0f2fe;
  border-left: 4px solid #0ea5e9;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.warning-box {
  background-color: #fff7ed;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

/* Improved help tooltip system */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem; /* Increased from 1rem */
  height: 1.25rem; /* Increased from 1rem */
  border-radius: 50%;
  background-color: #4f46e5;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
  cursor: help;
  position: relative;
  transition: all 0.1s ease;
}

/* Faster tooltip display */
.help-icon:hover:after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 10;
  top: -5px;
  left: 100%;
  margin-left: 5px;
  width: 250px;
  padding: 10px;
  border-radius: 4px;
  background-color: #1f2937;
  color: white;
  font-size: 0.75rem;
  font-weight: normal;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.help-text {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
  margin-left: 0.5rem;
}

.checkbox-explanation {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
  margin-left: 1.75rem; /* Aligned with checkbox label */
}

/* Evaluation Cards */
.evaluation-section {
  margin-bottom: 2rem;
}

.evaluation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.evaluation-card {
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.evaluation-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.evaluation-card p {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.evaluation-card ul, .evaluation-card ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.red-card {
  background-color: #fee2e2;
  border: 1px solid #fca5a5;
}

.yellow-card {
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
}

.green-card {
  background-color: #d1fae5;
  border: 1px solid #6ee7b7;
}

.blue-card {
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
}

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

  .form-panel, .preview-panel {
    margin-right: 0;
    margin-bottom: 1rem;
    max-height: none;
  }

  .tab-navigation {
    overflow-x: auto;
  }
  
  .document-preview .signature-block {
    flex-direction: column;
  }
  
  .document-preview .signature-section {
    width: 100%;
    margin-bottom: 2rem;
  }
  
  .evaluation-cards {
    grid-template-columns: 1fr;
  }
}