/* ============================================================
   DPP patient tools — shared styling (since 1.7.7)
   Tools: Red-Flag Self-Check, Vertigo Type Triage
   No external dependencies. Mobile-first. Print-friendly.
   ============================================================ */

.dpp-tool {
  max-width: 720px;
  margin: 32px auto;
  padding: 28px;
  background: #fff;
  border: 1px solid #d1d8e0;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(29, 78, 137, 0.06);
  font-family: var(--f-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: #2d3748;
  line-height: 1.55;
}

.dpp-tool-header h2 {
  margin: 0 0 10px 0;
  color: #1d4e89;
  font-size: 1.5em;
  line-height: 1.25;
}

.dpp-tool-sub {
  margin: 0 0 8px 0;
  color: #4a5568;
  font-size: 0.97em;
}

.dpp-tool-disclaimer {
  margin: 8px 0 18px 0;
  padding: 10px 14px;
  background: #fff7ed;
  border-left: 4px solid #d97706;
  border-radius: 4px;
  font-size: 0.92em;
  color: #5c3b0d;
}

.dpp-tool-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e0;
  font-size: 0.9em;
  color: #4a5568;
}
.dpp-tool-credit {
  margin: 8px 0 0 0;
  font-size: 0.85em;
  color: #718096;
}

/* ============ RED-FLAG TOOL ============ */
.dpp-rf-questions {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  counter-reset: rfq;
}
.dpp-rf-q {
  counter-increment: rfq;
  margin: 18px 0;
  padding: 16px 18px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  position: relative;
}
.dpp-rf-q::before {
  content: counter(rfq);
  position: absolute;
  top: 14px;
  left: 18px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1d4e89;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85em;
}
.dpp-rf-q .q-text {
  display: block;
  margin: 0 0 12px 38px;
  font-size: 0.98em;
}
.dpp-rf-q .q-opts {
  margin-left: 38px;
  display: flex;
  gap: 10px;
}
.q-btn {
  padding: 9px 22px;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-radius: 22px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  color: #2d3748;
  transition: all 0.15s;
  font-family: inherit;
}
.q-btn:hover { border-color: #1d4e89; color: #1d4e89; }
.q-btn.selected {
  background: #1d4e89;
  color: #fff;
  border-color: #1d4e89;
}
.q-btn.selected[data-val="yes"] { background: #c8302a; border-color: #c8302a; }

.dpp-rf-progress {
  text-align: center;
  margin: 16px 0;
  font-size: 0.92em;
  color: #4a5568;
}

/* ============ RESULT BOXES ============ */
.dpp-rf-result, .dpp-tr-result {
  display: block;
  margin: 24px 0 0 0;
  padding: 22px 24px;
  border-radius: 8px;
  border-left-width: 6px;
  border-left-style: solid;
}
.dpp-result-critical {
  background: #fff4f4;
  border-color: #c8302a;
  color: #5a1c19;
}
.dpp-result-critical h3 {
  color: #c8302a;
  margin: 0 0 10px 0;
  font-size: 1.3em;
}
.dpp-result-serious {
  background: #fff7ed;
  border-color: #d97706;
  color: #5c3b0d;
}
.dpp-result-serious h3 {
  color: #d97706;
  margin: 0 0 10px 0;
  font-size: 1.2em;
}
.dpp-result-ent {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #5c3b0d;
}
.dpp-result-ent h3 {
  color: #b45309;
  margin: 0 0 10px 0;
  font-size: 1.15em;
}
.dpp-result-ok {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #14532d;
}
.dpp-result-ok h3 {
  color: #166534;
  margin: 0 0 10px 0;
  font-size: 1.15em;
}
.dpp-result-info {
  background: #f5f8fc;
  border-color: #1d4e89;
  color: #1a365d;
}
.dpp-result-info h3 {
  color: #1d4e89;
  margin: 0 0 10px 0;
  font-size: 1.15em;
}

.dpp-result-cta {
  display: inline-block;
  margin: 12px 0 0 0;
  padding: 10px 20px;
  background: #1d4e89;
  color: #fff !important;
  text-decoration: none;
  border-radius: 22px;
  font-weight: 600;
  font-size: 0.95em;
}
.dpp-result-cta.cta-emergency {
  background: #c8302a;
}
.dpp-result-cta.cta-warning {
  background: #d97706;
}

.dpp-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.dpp-result-restart {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 14px;
  background: transparent;
  color: #4a5568;
  border: 1px solid #cbd5e0;
  border-radius: 18px;
  font-size: 0.88em;
  cursor: pointer;
  font-family: inherit;
}
.dpp-result-restart:hover { background: #f7fafc; }

/* ============ TRIAGE TOOL ============ */
.dpp-tr-screen {
  min-height: 220px;
  padding: 8px 0;
}
.dpp-tr-question {
  animation: dpp-fadein 0.3s ease;
}
@keyframes dpp-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.dpp-tr-q-label {
  display: block;
  font-size: 1.1em;
  font-weight: 600;
  color: #1a365d;
  margin: 12px 0 6px 0;
  line-height: 1.35;
}
.dpp-tr-q-help {
  display: block;
  margin: 0 0 16px 0;
  font-size: 0.92em;
  color: #4a5568;
  font-style: italic;
}
.dpp-tr-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.dpp-tr-opt {
  display: block;
  padding: 14px 18px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.97em;
  color: #2d3748;
  transition: all 0.15s;
  width: 100%;
}
.dpp-tr-opt:hover {
  border-color: #1d4e89;
  background: #ebf2fa;
}
.dpp-tr-back {
  display: inline-block;
  margin: 16px 0 0 0;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid #cbd5e0;
  border-radius: 18px;
  color: #4a5568;
  font-size: 0.88em;
  cursor: pointer;
  font-family: inherit;
}
.dpp-tr-back:hover { background: #f7fafc; }

.dpp-tr-progress {
  margin: 18px 0 0 0;
}
.dpp-tr-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.dpp-tr-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1d4e89, #4a90b8);
  transition: width 0.3s ease;
}

.dpp-tr-step-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82em;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============ MOBILE ============ */
@media (max-width: 600px) {
  .dpp-tool { padding: 20px; }
  .dpp-tool-header h2 { font-size: 1.25em; }
  .dpp-rf-q { padding: 14px 14px 14px 14px; }
  .dpp-rf-q::before { top: 12px; left: 14px; }
  .dpp-rf-q .q-text, .dpp-rf-q .q-opts { margin-left: 32px; }
}

/* ============ PRINT ============ */
@media print {
  .dpp-tool { box-shadow: none; border: 1px solid #999; }
  .q-btn, .dpp-result-restart, .dpp-tr-back { display: none; }
}
