:root {
  --primary-color: #8bc34a;
  --primary-light: #e6e4ff;
  --secondary-color: #4fc3f7;
  --danger-color: #ffc107;
  --grey-light: #eeeeee;
  --grey: #e9ecef;
  --text-color: #333;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 7px 14px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
  --border-radius: 12px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Sarabun', sans-serif;
  background-color: #f0f2f5;
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
}
.container {
  max-width: 900px;
  margin: 30px auto;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.header {
  background: linear-gradient(135deg, #b39ddb, #4527a0);
  color: white;
  text-align: center;
  padding: 30px 20px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}
.header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}
.content {
  padding: 30px;
  min-height: 400px;
}
.page {
  display: none;
  animation: fadeEffect 0.5s;
}
@keyframes fadeEffect {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.active {
  display: block;
}
.progress-bar-container {
  background-color: var(--grey-light);
  height: 8px;
  border-radius: 4px;
  margin: 15px 0 25px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #bdbdbd, #757575);
  transition: width 0.3s ease;
}
.section-header {
  margin-bottom: 25px;
  padding: 15px 20px;
  border-radius: var(--border-radius);
  text-align: center;
}
.q2-header {
  background: linear-gradient(135deg, var(--primary-color), #33691e);
  color: white;
}
.q9-header {
  background: linear-gradient(135deg, var(--secondary-color), #0288d1);
  color: white;
}
.q8-header {
  background: linear-gradient(135deg, var(--danger-color), #ff6f00);
  color: white;
}
.question-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  border-left: 3px solid #ddd;
}
.q2-card {
  border-left-color: var(--primary-color);
}
.q9-card {
  border-left-color: var(--secondary-color);
}
.q8-card {
  border-left-color: var(--danger-color);
}
.question-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 15px;
}
.q8-sub-question {
  margin-top: 10px;
  display: none;
  animation: fadeEffect 0.3s;
  padding: 15px;
  background-color: var(--grey-light);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--danger-color);
}
.options-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-top: 15px;
  gap: 10px;
}
.option-item {
  text-align: center;
  min-width: 80px;
  flex: 1;
}
.radio-input {
  display: none;
}
.radio-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 10px 5px;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  position: relative;
}
.radio-circle {
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  margin-bottom: 5px;
}
.option-text {
  font-size: 14px;
  transition: all 0.2s ease;
}
.q2-radio:checked + .radio-label .radio-circle {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}
.q2-radio:checked + .radio-label .radio-circle:after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: block;
}
.q2-radio:checked + .radio-label .option-text {
  color: var(--primary-color);
  font-weight: 500;
}
.q9-radio:checked + .radio-label .radio-circle {
  border-color: var(--secondary-color);
  background-color: #FFF3E0;
}
.q9-radio:checked + .radio-label .radio-circle:after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  display: block;
}
.q9-radio:checked + .radio-label .option-text {
  color: var(--secondary-color);
  font-weight: 500;
}
.q8-radio:checked + .radio-label .radio-circle {
  border-color: var(--danger-color);
  background-color: #FFEBEE;
}
.q8-radio:checked + .radio-label .radio-circle:after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--danger-color);
  display: block;
}
.q8-radio:checked + .radio-label .option-text {
  color: var(--danger-color);
  font-weight: 500;
}
.radio-label:hover .radio-circle {
  border-color: #999;
  transform: scale(1.05);
}
.radio-label:hover .option-text {
  transform: translateY(-2px);
}
.footer-reference {
  margin-top: 20px;
  padding: 10px 15px;
  border-radius: 5px;
  background-color: rgba(248, 249, 250, 0.5);
  font-size: 12px;
  color: #777;
  text-align: center;
  border-top: 1px solid #eee;
}
.q2-footer {
  border-color: #e0e0e0;
}
.q9-footer {
  border-color: #e0e0e0;
}
.q8-footer {
  border-color: #e0e0e0;
}
.reference-title {
  font-weight: 500;
  display: inline;
}
.reference-text {
  display: inline;
}
.btn-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  gap: 15px;
}
.btn-line {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #06C755;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 30px;
  text-decoration: none;
  font-family: 'Sarabun', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 220px;
  text-align: center;
}
.btn-line:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  background-color: #05a847;
  color: white;
  text-decoration: none;
}
.line-icon {
  font-size: 1.2rem;
  margin-right: 8px;
}
.btn-line-alert {
  background-color: #ff4757;
  font-weight: 600;
}
.btn-line-alert:hover {
  background-color: #ea3546;
}
button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 180px;
}
button:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.btn-q9 {
  background: var(--secondary-color);
}
.btn-q8 {
  background: var(--danger-color);
}
.btn-restart {
  background: #6c757d;
}
.result-container {
  text-align: center;
  padding: 20px;
}
.result-box {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 25px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 5px solid #ddd;
}
.normal {
  border-color: #4CAF50;
  background-color: #f0fff0;
}
.mild {
  border-color: #ffc107;
  background-color: #fffbf0;
}
.moderate {
  border-color: #ff5722;
  background-color: #fff8f0;
}
.severe {
  border-color: #e51c23;
  background-color: #fff0f0;
}
.icon-container {
  font-size: 60px;
  margin: 20px 0;
}
.icon-success {
  color: #4CAF50;
}
.icon-warning {
  color: var(--danger-color);
}
.result-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  font-weight: 600;
}
.score-display {
  display: inline-block;
  background-color: white;
  border-radius: 20px;
  padding: 5px 15px;
  margin: 5px 0 10px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.normal .score-display {
  background-color: #4CAF50;
  color: white;
}
.mild .score-display {
  background-color: #ffc107;
  color: white;
}
.moderate .score-display {
  background-color: #ff5722;
  color: white;
}
.severe .score-display {
  background-color: #e51c23;
  color: white;
}
.warning-text {
  color: #e51c23;
  font-weight: 600;
  font-size: 18px;
  margin: 10px 0;
}
.step-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.step.active {
  background-color: #757575;
}
.step.completed {
  background-color: #212121;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 2px;
  background-color: #e0e0e0;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
}
.step.completed:not(:last-child)::after {
  background-color: #616161;
}
.question-number {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  margin-right: 10px;
  font-size: 14px;
}
.q9-card .question-number {
  background-color: var(--secondary-color);
}
.q8-card .question-number {
  background-color: var(--danger-color);
}
/* Result animation */
.result-animation {
  animation: scaleIn 0.5s ease-out;
}
@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    margin: 10px auto;
  }
  .header {
    padding: 20px;
  }
  .header h1 {
    font-size: 1.5rem;
  }
  .content {
    padding: 20px 15px;
  }
  .question-text {
    font-size: 15px;
  }
  .options-container {
    flex-wrap: wrap;
  }
  .option-item {
    min-width: 70px;
  }
  .option-text {
    font-size: 12px;
  }
  .step {
    width: 25px;
    height: 25px;
    font-size: 12px;
    margin: 0 5px;
  }
  .step:not(:last-child)::after {
    width: 15px;
  }
  .btn-line, button {
    width: 100%;
    max-width: 280px;
    margin: 5px 0;
  }
}
@media (min-width: 769px) {
  .btn-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
  }
  button, .btn-line {
    margin: 0 10px;
  }
}
