
:root {
  --primary-blue: #2E5A87;
  --accent-teal: #5DADE2;
  --light-gray: #F8F9FA;
  --medium-gray: #E9ECEF;
  --dark-gray: #495057;
  --white: #FFFFFF;
  --success-green: #28A745;
  --warning-orange: #FFC107;
  --danger-red: #DC3545;
  --text-dark: #212529;
  --text-muted: #6C757D;
  --border-color: #DEE2E6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

.audit-container {
  max-width: 800px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
}

.audit-form {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.form-content {
  padding: 0;
}

/* Progress Bar */
.progress-container {
  background: var(--light-gray);
  padding: 20px 30px;
  border-bottom: 1px solid var(--border-color);
}

.progress-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--medium-gray);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-teal));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Section Container */
.section-container {
  padding: 30px;
}

.section-header {
  margin-bottom: 30px;
}

.section-badge {
  background: var(--primary-blue);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 16px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Question Blocks */
.question-block {
  margin-bottom: 40px;
  padding: 25px;
  background: var(--light-gray);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.question-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 25px;
  line-height: 1.5;
}

/* Rating Container */
.rating-container {
  width: 100%;
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.rating-options {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rating-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rating-option input[type="radio"] {
  display: none;
}

.rating-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--medium-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.rating-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  font-weight: 500;
}

.rating-option:hover .rating-circle {
  border-color: var(--accent-teal);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(93, 173, 226, 0.3);
}

.rating-option.active .rating-circle {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 90, 135, 0.4);
}

.rating-option.active .rating-label {
  color: var(--primary-blue);
  font-weight: 600;
}

/* Navigation */
.navigation-container {
  padding: 30px;
  background: var(--light-gray);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary-blue);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: #1e3a5f;
}

.btn-secondary {
  background: var(--medium-gray);
  color: var(--text-dark);
}

.btn-secondary:hover:not(:disabled) {
  background: #d1d3d4;
}

.btn-submit {
  background: var(--accent-teal);
  color: var(--white);
  font-size: 18px;
  padding: 15px 30px;
  width: 100%;
  margin-top: 20px;
}

.btn-submit:hover:not(:disabled) {
  background: #3498db;
}

/* Contact Section */
.contact-section {
  margin-top: 40px;
  padding: 30px;
  background: var(--white);
  border-radius: 12px;
  border: 2px solid var(--border-color);
}

.contact-section h3 {
  margin: 0 0 25px 0;
  color: var(--text-dark);
  font-size: 20px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s ease;
  background: var(--white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.1);
}

/* Consent Section */
.consent-section {
  margin: 25px 0;
  padding: 20px;
  background: #FFF9E6;
  border: 1px solid #FFE066;
  border-radius: 8px;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.consent-checkbox input[type="checkbox"]:checked + .checkmark {
  background: var(--success-green);
  border-color: var(--success-green);
}

.consent-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: var(--white);
  font-weight: bold;
  font-size: 14px;
}

.consent-text {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.5;
}

/* Error Message */
.error-message {
  background: #F8D7DA;
  color: #721C24;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 15px 0;
  border: 1px solid #F5C6CB;
  font-size: 14px;
}

/* Success Container */
.success-container {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 60px 40px;
  text-align: center;
}

.success-content {
  max-width: 400px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--white);
  margin: 0 auto 25px;
  font-weight: bold;
}

.success-content h2 {
  color: var(--text-dark);
  margin: 0 0 15px 0;
  font-size: 28px;
  font-weight: 600;
}

.success-content p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .audit-container {
    margin: 10px;
  }
  
  .section-container,
  .navigation-container,
  .contact-section {
    padding: 20px;
  }
  
  .question-block {
    padding: 20px;
  }
  
  .rating-options {
    gap: 5px;
  }
  
  .rating-circle {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .rating-label {
    font-size: 11px;
  }
  
  .question-text {
    font-size: 16px;
  }
  
  .section-badge {
    font-size: 14px;
    padding: 10px 20px;
  }
  
  .navigation-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .success-container {
    padding: 40px 20px;
  }
  
  .success-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }
  
  .success-content h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .rating-options {
    flex-direction: column;
    gap: 10px;
  }
  
  .rating-option {
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
    padding: 10px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
  
  .rating-circle {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .rating-label {
    text-align: left;
    font-size: 14px;
  }
  
  .rating-labels {
    display: none;
  }
}

/* Admin Modal Styles */
.audit-modal {
  display: none;
  position: fixed;
  z-index: 999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  padding: 20px 0;
}

.audit-modal.show {
  display: block !important;
}

.audit-modal-content {
  background-color: #fff;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: none;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.audit-modal-header {
  padding: 20px 30px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
}

.audit-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #212529;
}

.audit-modal-close {
  color: #6c757d;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.audit-modal-close:hover,
.audit-modal-close:focus {
  color: #000;
  background-color: #e9ecef;
}

.audit-modal form {
  padding: 30px;
}

.audit-modal .form-table {
  width: 100%;
  border-collapse: collapse;
}

.audit-modal .form-table th {
  width: 200px;
  padding: 15px 20px 15px 0;
  text-align: left;
  vertical-align: top;
  font-weight: 600;
  color: #212529;
}

.audit-modal .form-table td {
  padding: 15px 0;
  vertical-align: top;
}

.audit-modal .form-table input,
.audit-modal .form-table textarea,
.audit-modal .form-table select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.audit-modal .form-table input:focus,
.audit-modal .form-table textarea:focus,
.audit-modal .form-table select:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.audit-modal .form-table .description {
  font-size: 13px;
  color: #6c757d;
  margin-top: 5px;
  font-style: italic;
}

.audit-modal-footer {
  padding: 20px 30px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-radius: 0 0 8px 8px;
}

.audit-modal-footer .button {
  padding: 8px 16px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  color: #212529;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.audit-modal-footer .button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.audit-modal-footer .button-primary {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.audit-modal-footer .button-primary:hover {
  background: #0b5ed7;
  border-color: #0a58ca;
}

.audit-modal-footer .button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Scale Labels */
.scale-labels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-label-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scale-label-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: normal;
  margin: 0;
}

.scale-label-item input {
  flex: 1;
}

/* Choice Options */
.choice-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.choice-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice-option-item input {
  flex: 1;
}

.remove-option {
  background: #dc3545 !important;
  color: white !important;
  border: none !important;
  border-radius: 3px !important;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.remove-option:hover {
  background: #c82333 !important;
}

#add-choice-option {
  margin-top: 10px;
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

#add-choice-option:hover {
  background: #218838;
}

/* Text Config */
#text-config label {
  display: block;
  margin-bottom: 10px;
  font-weight: normal;
}

#text-config input[type="text"],
#text-config input[type="number"] {
  margin-left: 10px;
  width: auto;
  min-width: 200px;
}

#text-config input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

/* Questions List Styles */
.audit-questions-header {
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.question-item {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  margin-bottom: 15px;
  padding: 15px;
  cursor: move;
  transition: box-shadow 0.2s ease;
}

.question-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-header {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.question-drag-handle {
  color: #666;
  cursor: grab;
  font-size: 18px;
  user-select: none;
}

.question-drag-handle:active {
  cursor: grabbing;
}

.question-info {
  flex: 1;
  min-width: 200px;
}

.question-section {
  background: #86B9B0;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-left: 10px;
  white-space: nowrap;
}

.question-meta {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
}

.question-type {
  background: #f1f1f1;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.question-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.question-description {
  margin-top: 10px;
  color: #666;
  font-style: italic;
}

.question-scale-preview {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scale-item {
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
}

.audit-no-questions {
  text-align: center;
  padding: 40px;
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
}

#questions-sortable .ui-sortable-helper {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: rotate(2deg);
}

/* Responsive Modal */
@media (max-width: 768px) {
  .audit-modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
  }
  
  .audit-modal-header,
  .audit-modal form,
  .audit-modal-footer {
    padding: 20px;
  }
  
  .audit-modal .form-table th {
    width: auto;
    display: block;
    padding: 10px 0 5px 0;
  }
  
  .audit-modal .form-table td {
    display: block;
    padding: 5px 0 15px 0;
  }
  
  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .question-meta {
    justify-content: flex-start;
  }
  
  .audit-questions-header {
    flex-direction: column;
    align-items: stretch;
  }
}
