/* Digital Doctor — Engine / Flow Styles */

/* ===== FLOW WRAPPER ===== */
.dd-flow-page {
  background: var(--gray-50);
  min-height: calc(100vh - 60px);
  padding: 2rem 0 4rem;
}

/* ===== PROGRESS BAR ===== */
.dd-progress {
  background: var(--gray-200);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.dd-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Step labels */
.dd-step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.dd-step-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400, #9ca3af);
}
.dd-step-label.active { color: var(--primary); }
.dd-step-label.done { color: var(--success); }

/* ===== FLOW CARD ===== */
.dd-flow-card {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}

.dd-flow-card-header {
  background: linear-gradient(135deg, var(--secondary) 0%, #1a3a5c 60%, #0c5c58 100%);
  color: #fff;
  padding: 1.75rem 2rem;
}

.dd-flow-card-header .step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 2rem;
  padding: 0.25rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.dd-flow-card-header h2 {
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.dd-flow-card-header p {
  color: rgba(255,255,255,.8);
  font-size: 0.9rem;
  margin: 0;
}

.dd-flow-card-body {
  padding: 2rem;
}

@media (max-width: 576px) {
  .dd-flow-card-header { padding: 1.25rem 1.25rem; }
  .dd-flow-card-body { padding: 1.25rem; }
}

/* ===== DISCLAIMER CHECKBOXES ===== */
.disclaimer-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: #fff;
}
.disclaimer-check-item:hover { border-color: var(--primary-light); background: var(--gray-50); }
.disclaimer-check-item.checked {
  border-color: var(--primary);
  background: var(--light-bg);
}
.disclaimer-check-item input[type="checkbox"] {
  margin-top: 0.15rem;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.disclaimer-check-item label {
  font-size: 0.9rem;
  color: var(--gray-700);
  cursor: pointer;
  line-height: 1.5;
}

/* ===== QUESTION DISPLAY ===== */
.dd-question-wrap {
  text-align: center;
  padding: 1rem 0 1.5rem;
}

.dd-question-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.dd-question-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

.dd-yn-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-yn {
  min-width: 140px;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  border: 2.5px solid;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-yn-yes {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-yn-yes:hover, .btn-yn-yes.selected {
  background: var(--danger);
  color: #fff;
}

.btn-yn-no {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-yn-no:hover, .btn-yn-no.selected {
  background: var(--primary);
  color: #fff;
}

/* Emergency override question style */
.question-phase-emergency .dd-flow-card-header {
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
}
.question-phase-emergency .step-badge {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,200,200,.3);
}

/* ===== SYMPTOM SELECTION GRID ===== */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.symptom-select-card {
  background: #fff;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  user-select: none;
}
.symptom-select-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
  transform: translateY(-2px);
}
.symptom-select-card.selected {
  border-color: var(--primary);
  background: var(--light-bg);
}
.symptom-select-card .s-icon {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: block;
}
.symptom-select-card .s-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.3;
}

/* ===== RESULT PAGES ===== */
.dd-result-page { padding: 3rem 0 5rem; }

.result-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}
.result-icon-emergency { background: var(--danger-light); color: var(--danger); border: 3px solid var(--danger); }
.result-icon-beyond { background: var(--warning-light); color: var(--warning); border: 3px solid #fbbf24; }
.result-icon-treatment { background: var(--success-light); color: var(--success); border: 3px solid var(--success); }

.result-header {
  text-align: center;
  padding: 2rem 2rem 1.5rem;
}
.result-header h1 { font-size: clamp(1.5rem, 4vw, 2rem); }

.treatment-section {
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  background: #fff;
}
.treatment-section h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--light-bg);
}

.treatment-home-list,
.treatment-medicine-list,
.treatment-avoid-list,
.treatment-seek-list {
  list-style: none;
  padding: 0; margin: 0;
}
.treatment-home-list li,
.treatment-medicine-list li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  font-size: 0.925rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}
.treatment-home-list li:last-child,
.treatment-medicine-list li:last-child { border-bottom: 0; }
.treatment-home-list li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--success); font-weight: 700;
}
.treatment-medicine-list li::before {
  content: "•";
  position: absolute; left: 0.2rem;
  color: var(--primary); font-weight: 700;
}
.treatment-seek-list li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  font-size: 0.925rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}
.treatment-seek-list li:last-child { border-bottom: 0; }
.treatment-seek-list li::before {
  content: "⚠";
  position: absolute; left: 0;
  color: var(--warning);
}

.medicine-safety-note {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-top: 0.75rem;
}

.result-disclaimer-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-top: 1.5rem;
}

/* Print styles */
@media print {
  .dd-header, .dd-footer, #backToTop, .dd-emergency-banner { display: none !important; }
  .dd-result-page { padding: 0; }
  .treatment-section { page-break-inside: avoid; }
}
