/* ================================================================
   TFFM NREMT Signs & Symptoms Reference — Shared Stylesheet
   Version: 1.0 | Standalone review build (pre-integration)
   ================================================================ */

:root {
  --bg:          #0d1630;
  --bg-2:        #121f40;
  --card-bg:     #1a2a50;
  --card-bg-2:   #0f1c3a;
  --border:      rgba(255,255,255,0.08);
  --text:        #e8edf5;
  --text-2:      #a8b8d0;
  --text-3:      #6880a0;
  --white:       #ffffff;
  --red-flag:    #ef4444;
  --diff:        #f59e0b;
  --font:        -apple-system,"SF Pro Display","Inter","Segoe UI",system-ui,sans-serif;
  --radius:      12px;
  --radius-lg:   18px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────── */
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ── System Header ──────────────────────────────────── */
.sys-header {
  padding: 40px 0 32px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  border-bottom: 3px solid var(--sys-color, #1E5AA8);
  position: relative;
  overflow: hidden;
}
.sys-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--sys-color, #1E5AA8);
}
.sys-badge {
  display: inline-block;
  background: var(--sys-color, #1E5AA8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.sys-header h1 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.sys-header h1 span { color: var(--sys-color, #1E5AA8); }
.sys-header .subtitle {
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: 18px;
  max-width: 560px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sys-color, #1E5AA8);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--sys-color, #1E5AA8);
  border-radius: 20px;
  transition: background 0.2s;
}
.back-link:hover { background: rgba(255,255,255,0.06); }
.condition-count {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 10px;
}

/* ── Card Grid ──────────────────────────────────────── */
.card-section {
  padding: 36px 0 12px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 0 0 48px;
}
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ── Condition Card ─────────────────────────────────── */
.cond-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--sys-color, #1E5AA8);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header {
  background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.15) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 16px 20px 14px;
}
.card-header h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.card-header .card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sys-color, #1E5AA8);
  margin-bottom: 6px;
}

.card-body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Section Labels ─────────────────────────────────── */
.section-block { display: flex; flex-direction: column; gap: 6px; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  background: currentColor;
  flex-shrink: 0;
}

.label-ss   { color: var(--sys-color, #1E5AA8); }
.label-diff { color: var(--diff); }
.label-flag { color: var(--red-flag); }

/* ── Signs & Symptoms List ──────────────────────────── */
.ss-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}
.ss-list li {
  font-size: 14px;
  color: var(--text);
  padding-left: 16px;
  position: relative;
  line-height: 1.45;
}
.ss-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sys-color, #1E5AA8);
}

/* ── Key Differential ───────────────────────────────── */
.diff-text {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--diff);
  padding: 8px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Red Flag ───────────────────────────────────────── */
.red-flag-text {
  font-size: 13.5px;
  color: #fca5a5;
  line-height: 1.5;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--red-flag);
  padding: 8px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 500;
}

/* ── Divider ────────────────────────────────────────── */
.card-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ── Disclaimer Footer ──────────────────────────────── */
.disclaimer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--card-bg-2);
}
.disclaimer p {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  max-width: 900px;
  text-align: center;
  margin: 0 auto;
}

/* ── Index Page ─────────────────────────────────────── */
.index-header {
  padding: 52px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, #0a0f1e 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.index-header .site-badge {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.index-header h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.index-header p {
  font-size: 16px;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto 6px;
  line-height: 1.6;
}
.index-header .total-count {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 8px;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 44px 0 56px;
}
@media (max-width: 900px)  { .system-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .system-grid { grid-template-columns: 1fr; gap: 12px; } }

.sys-tile {
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}
.sys-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tile-color, #1E5AA8);
}
.sys-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border-color: var(--tile-color, #1E5AA8);
}
.tile-sys-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 8px;
}
.tile-count {
  font-size: 12px;
  color: var(--tile-color, #1E5AA8);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.tile-conditions {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.55;
  flex: 1;
}
.tile-arrow {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--tile-color, #1E5AA8);
  letter-spacing: 0.05em;
}

/* ── How-to-Use block ───────────────────────────────── */
.how-to-use {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px 32px;
  margin-bottom: 40px;
}
.how-to-use h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.how-to-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .how-to-list { grid-template-columns: 1fr; } }
.how-to-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.how-to-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.how-to-item p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Legend ─────────────────────────────────────────── */
.legend {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0 32px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-bar {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── System Header Icon Layout ──────────────────────── */
.sys-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.sys-header-text { flex: 1; min-width: 0; }
.sys-header-icon {
  font-size: 120px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.9;
  filter: drop-shadow(0 0 28px rgba(255,255,255,0.12));
  user-select: none;
  pointer-events: none;
}
@media (max-width: 768px) {
  .sys-header-inner { flex-direction: row; align-items: center; }
  .sys-header-icon { font-size: 80px; }
}
@media (max-width: 540px) {
  .sys-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sys-header-icon { font-size: 60px; }
}

/* ── Index Tile Icon ─────────────────────────────────── */
.tile-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 10px;
  user-select: none;
  pointer-events: none;
  display: block;
}

/* ── Responsive tweaks ──────────────────────────────── */
@media (max-width: 480px) {
  .card-body { padding: 14px 16px 18px; gap: 12px; }
  .card-header { padding: 14px 16px 12px; }
  .sys-header { padding: 28px 0 24px; }
}
