/* Layout */
html {
  background-color: #ffffff;
}

body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #ffffff;
}

#inductionForm {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.two-col {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  align-items: stretch;
  min-height: 100%;
}

.input-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  width: 100%;
}

.section-header h2 {
  margin-top: 0;
  margin-bottom: 10px;
  padding-top: 0;
  color: #002512;
}

.input-row {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  justify-content: flex-start;
  /* border-bottom: 1px solid #000; */
  padding: 10px 0px;
  margin-bottom: 0;
  min-width: 0;
}

.input-row label {
  font-weight: 500;
  color: #000;
  font-size: 14px;
  flex-shrink: 0;
  /* min-width: 140px; */
}

.input-row input,
.input-row select {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  margin-top: 0;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background: #fff;
  text-align: left;
  font-size: 16px;
  color: #000;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.input-row input:hover,
.input-row select:hover {
  border-color: #b0b0b0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.input-row input:focus,
.input-row select:focus {
  outline: none;
  border-color: #002512;
  box-shadow: 0 0 0 3px rgba(0, 37, 18, 0.1);
}

.input-row input::placeholder {
  color: #999;
  opacity: 1;
}

.input-row span {
  width: 100%;
  /* flex: 1; */
  max-width: 250px;
  text-align: right;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.data-row {
  width: 100%;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #000;
  padding: 10px 0px;
  margin-bottom: 0;
}

.data-row label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  /* min-width: 180px; */
  flex-shrink: 0;
}

.data-row span {
  width: 100%;
  max-width: 250px;
  text-align: right;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.required {
  color: #dc3545;
}

.input-row label .required {
  color: #000;
}

.form-group {
  width: 100%;
}

.combined-sections {
  display: flex;
  flex-direction: row;
  gap: 30px;
  width: 100%;
  align-items: flex-start;
}

.combined-section-item {
  flex: 1;
  width: 100%;
}

.safety-cards-section {
  margin-top: 20px;
  width: 100%;
}

.safety-card-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.safety-card-input {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: Arial, sans-serif;
  color: #000;
  background: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.safety-card-name {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}

.safety-card-number {
  flex: 2;
  min-width: 150px;
}

.safety-card-input:hover {
  border-color: #b0b0b0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.safety-card-input:focus {
  outline: none;
  border-color: #002512;
  box-shadow: 0 0 0 3px rgba(0, 37, 18, 0.1);
}

.safety-card-input::placeholder {
  color: #999;
  opacity: 1;
}

.remove-card-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 32px;
  min-height: 32px;
}

.remove-card-btn i {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.remove-card-btn:hover {
  background: #c82333;
  transform: scale(1.05);
}

.add-card-btn {
  padding: 10px 14px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.add-card-btn:hover {
  background: #0056b3;
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.signature-note {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
  width: 100%;
}

.signature-container {
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background: #fafafa;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

#signatureCanvas {
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: crosshair;
  display: block;
  width: 100%;
  max-width: 600px;
  height: 200px;
  box-sizing: border-box;
}

.signature-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.clear-signature-btn {
  padding: 8px 16px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.clear-signature-btn:hover {
  background: #5a6268;
}

.submit-btn {
  background: #002512;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  flex: 1;
  max-width: 300px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover {
  background: #002512;
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.reset-btn {
  padding: 12px 24px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  max-width: 300px;
  transition: background-color 0.3s ease;
}

.reset-btn:hover {
  background: #5a6268;
}

.section:last-of-type {
  align-items: center;
}

.button-row {
  display: flex;
  flex-direction: row;
  gap: 15px;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-top: 40px;
}

@media (max-width: 800px) {
  .two-col {
    flex-direction: column;
  }
  .two-col img {
    max-width: 100% !important;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .combined-sections {
    flex-direction: column;
    gap: 20px;
  }
  
  .section-header h2 {
    font-size: 18px;
  }
  
  /* Safety card row always stays as a row, even on mobile */
  .safety-card-row {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .remove-card-btn {
    padding: 4px;
    min-width: 28px;
    min-height: 28px;
  }
  
  .remove-card-btn i {
    width: 14px;
    height: 14px;
  }

  .button-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .submit-btn,
  .reset-btn {
    width: 100%;
    max-width: 100%;
  }

  #signatureCanvas {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .section-header h2 {
    font-size: 16px;
  }
  
  .input-row input,
  .input-row select {
    max-width: 100%;
    text-align: left;
  }
  
  .input-row span {
    max-width: 100%;
    text-align: right;
  }
  
  .remove-card-btn {
    padding: 4px;
    min-width: 24px;
    min-height: 24px;
  }
  
  .remove-card-btn i {
    width: 12px;
    height: 12px;
  }
}

/* Terms and Conditions Link */
.terms-link {
  color: #002512;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.terms-link:hover {
  color: #004d2e;
}

.agreement-status {
  color: #28a745;
  font-weight: 600;
  margin-left: 10px;
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content-large {
  max-width: 900px;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #002512;
}

.modal-close {
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #000;
}

.modal-body {
  display: flex;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.modal-body-pdf {
  padding: 20px;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 200px);
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  gap: 20px;
}

/* Induction Content Styles */
.induction-content {
  width: 100%;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.4;
  color: #333;
}

.induction-title {
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
  color: #002512;
}

.induction-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
}

.induction-content {
  counter-reset: section-counter;
}

.induction-section {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.induction-section h2 {
  font-size: 11px;
  font-weight: bold;
  color: #002512;
  margin-bottom: 8px;
  margin-top: 12px;
  counter-increment: section-counter;
  counter-reset: list-counter;
}

.induction-section h3 {
  font-size: 10.5px;
  font-weight: bold;
  color: #333;
  margin-top: 10px;
  margin-bottom: 6px;
}

.induction-section h4 {
  font-size: 10px;
  font-weight: bold;
  color: #333;
  margin-top: 8px;
  margin-bottom: 5px;
}

.induction-subsection {
  margin-top: 6px;
  margin-bottom: 6px;
}

.induction-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  margin-top: 4px;
}

/* Tab indentation classes */
.tab-1 {
  margin-left: 0;
}

.tab-2 {
  margin-left: 40px;
}

.tab-3 {
  margin-left: 55px;
}

.tab-4 {
  margin-left: 70px;
}

.tab-5 {
  margin-left: 85px;
}

.induction-field label {
  font-weight: 500;
  color: #333;
  min-width: 100px;
  flex: 0 1 auto;
  font-size: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.induction-field span {
  color: #666;
  border-bottom: 1px solid #ccc;
  min-width: 120px;
  flex: 1;
  padding: 1px 3px;
  font-size: 10px;
}

.induction-note {
  font-style: italic;
  color: #666;
  margin-top: 6px;
  margin-bottom: 6px;
  margin-left: 0;
  font-size: 9.5px;
}

.induction-warning {
  font-weight: bold;
  color: #dc3545;
  margin-top: 6px;
  margin-bottom: 6px;
  margin-left: 0;
  font-size: 10px;
}

.induction-signature-section {
  margin-top: 12px;
  padding: 10px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.induction-signature-section p {
  margin-bottom: 6px;
}

.induction-content ul {
  margin-left: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
  list-style-type: lower-alpha;
  padding-left: 20px;
}

.induction-content ol {
  margin-left: 15px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding-left: 0;
}

.induction-content li {
  margin-bottom: 3px;
  font-size: 10px;
  line-height: 1.4;
}

.induction-content ol li {
  counter-increment: list-counter;
  list-style: none;
  position: relative;
  padding-left: 25px;
  text-indent: 0;
}

.induction-content ol li.induction-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.induction-content ul li {
  list-style-type: lower-alpha;
  padding-left: 0;
  position: static;
}

.induction-content ol li::before {
  content: counter(section-counter) "." counter(list-counter) " ";
  font-weight: bold;
  position: absolute;
  left: 0;
}

.induction-content ol ul {
  list-style-type: lower-alpha;
  margin-left: 10px;
  padding-left: 20px;
}

.induction-content ol ul li {
  list-style-type: lower-alpha;
  padding-left: 0;
}

.induction-content ol ul li::before {
  content: "";
  display: none;
}

.induction-content p {
  margin-bottom: 6px;
}

#pdfViewerContainer {
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  padding: 5px;
  align-items: flex-start !important;
  box-sizing: border-box;
}

/* Reduce padding for PDF section */
.section:has(#pdfViewerContainer) {
  padding: 10px;
}

#termsPdfCanvas {
  max-width: 100%;
  width: 100%;
  height: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background: white;
  display: block;
  box-sizing: border-box;
}

#pdfControls {
  margin-top: 15px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

#pdfControls button {
  padding: 6px 12px;
  font-size: 14px;
  min-width: 80px;
}

#pageInfo {
  font-size: 14px;
  color: #666;
  padding: 0 15px;
}

#pdfLoading {
  padding: 40px;
  font-size: 16px;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
  gap: 10px;
}

.modal-footer .submit-btn {
  max-width: 100%;
}

.terms-agreement-text {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 0;
  padding: 10px 0;
  font-style: italic;
}

.terms-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

.terms-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #002512;
}

.modal-btn {
  padding: 8px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  background: #002512;
  color: white;
  font-weight: 500;
}

.modal-btn:hover {
  background: #004d2e;
}

.modal-btn-cancel {
  background: #6c757d;
}

.modal-btn-cancel:hover {
  background: #545b62;
}

@media (max-width: 768px) {
  .modal-content-large {
    max-width: 95%;
    max-height: 95vh;
  }
  
  .modal-body-pdf iframe {
    height: 400px !important;
  }
}
