/* ============================================================
   doq.css — doQ™ Unified Design System  v1.0
   Shared by: qtree · qdoc · qtreat · qhealth · qcare · qthoughts · admin
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand */
  --teal:      #0E6E58;
  --teal-d:    #094D3E;
  --teal-lt:   #E6F2EE;
  --teal-mid:  #1A8C6E;

  /* Accents */
  --amber:     #E07A2F;
  --amber-lt:  #FEF3C7;
  --violet:    #7C3AED;
  --violet-lt: #F5F3FF;
  --violet-mid:#6D28D9;
  --green-lt:  #D1FAE5;

  /* Neutrals */
  --deep:      #0A1F1A;
  --bg:        #F7F6F2;
  --surface:   #FFFFFF;
  --text:      #1A1A1A;
  --muted:     #6B7280;
  --border:    #E5E3DB;

  /* Layout */
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 2px 12px rgba(0,0,0,.07);
  --shadow-lg: 0 8px 40px rgba(14,110,88,.10);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ── NAV ───────────────────────────────────────────────────── */
.doq-nav {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  background: rgba(247,246,242,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo svg { width: 76px; height: 40px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all .15s;
  white-space: nowrap;
}
.nav-links a:hover  { color: var(--teal); background: var(--teal-lt); }
.nav-links a.active { color: var(--teal); background: var(--teal-lt); font-weight: 600; }
.nav-links a.nav-cta {
  background: var(--teal); color: white !important;
  padding: 7px 16px; border-radius: 8px;
  font-weight: 600;
}
.nav-links a.nav-cta:hover { background: var(--teal-mid); }

@media (max-width: 768px) {
  .doq-nav { padding: 0 16px; }
  .nav-links { gap: 2px; }
  .nav-links a { font-size: 11px; padding: 5px 8px; }
}

/* ── JOURNEY STRIP ─────────────────────────────────────────── */
.journey-strip {
  background: var(--deep);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 40px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.journey-strip::-webkit-scrollbar { display: none; }

.js-node {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
  white-space: nowrap;
  color: #4B5563;
  border-color: #1f2937;
}
.js-node:hover  { color: #9CA3AF; border-color: #374151; }
.js-node.done   { background: #065e5a; color: #5eead4; border-color: #0b7a75; }
.js-node.active { background: var(--teal); color: white; border-color: var(--teal); }
.js-node.pending { color: #4B5563; border-color: #1f2937; }
.js-arrow { color: #1f2937; font-size: 14px; padding: 0 2px; flex-shrink: 0; }

@media (max-width: 768px) {
  .journey-strip { padding: 0 12px; }
}

/* ── DISCLAIMER BANNER (injected by qsmart.js) ─────────────── */
#doq-disclaimer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--deep);
  color: #E0EDE9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  flex-wrap: wrap;
  border-top: 2px solid var(--teal);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  line-height: 1.5;
}
.disc-badge {
  background: var(--teal); color: white;
  font-size: 9px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
}
.disc-text { color: #8BA89E; }
.disc-text strong { color: #E0EDE9; }
.disc-dismiss {
  background: transparent;
  border: 1px solid #1f3a38;
  color: #6B9990;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s;
}
.disc-dismiss:hover { color: #4DB896; }

/* ── PAGE HEADER ───────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }
.page-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
  display: block;
}
.page-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 300;
  color: var(--deep);
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.page-title em { font-style: italic; color: var(--teal); }
.page-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 300;
  max-width: 580px;
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--deep);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn-primary  { background: var(--teal); color: white; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-mid); }
.btn-ghost    { background: white; color: var(--text); border-color: var(--border); }
.btn-ghost:hover   { border-color: var(--teal); color: var(--teal); }
.btn-danger   { background: white; color: #DC2626; border-color: #FCA5A5; }
.btn-danger:hover  { background: #FEE2E2; }
.btn-sm { padding: 6px 13px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 12px; }

/* ── FORM FIELDS ───────────────────────────────────────────── */
.field-wrap  { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.field-input, .field-select, .form-input, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.field-input:focus, .field-select:focus,
.form-input:focus, .form-select:focus {
  border-color: var(--teal);
  background: white;
  box-shadow: 0 0 0 3px var(--teal-lt);
}
.field-input::placeholder, .form-input::placeholder { color: #B0ADA4; }

/* ── URGENCY BADGES ────────────────────────────────────────── */
.badge-urg {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}
.badge-EMERGENCY, .urg-EMERGENCY { background: #FEE2E2; color: #991B1B; }
.badge-URGENT,    .urg-URGENT    { background: #FEF3C7; color: #92400E; }
.badge-ROUTINE,   .urg-ROUTINE,
.badge-STANDARD,  .urg-STANDARD  { background: var(--green-lt); color: #065F46; }
.badge-SELF_CARE, .urg-SELF_CARE { background: var(--teal-lt); color: var(--teal-d); }

/* ── CONTEXT BANNER ────────────────────────────────────────── */
.context-banner {
  background: linear-gradient(135deg, var(--teal-lt), #f0fdf4);
  border: 1.5px solid rgba(14,110,88,.25);
  border-radius: var(--radius);
  padding: 16px 22px;
  display: none;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.context-banner.show { display: flex; }
.cb-icon { font-size: 22px; flex-shrink: 0; }
.cb-body { flex: 1; min-width: 0; }
.cb-body strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--teal-d); margin-bottom: 2px; }
.cb-body span   { font-size: 12px; color: var(--teal); }
.cb-urgency {
  padding: 4px 12px; border-radius: 100px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
}

/* ── STATUS BAR ────────────────────────────────────────────── */
.status-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--amber-lt);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #92400E;
  margin-bottom: 16px;
}
.status-bar.ok { background: var(--green-lt); border-color: #A7F3D0; color: #065F46; }
.status-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,.15);
  border-top-color: #92400E;
  border-radius: 50%;
  animation: doq-spin .7s linear infinite;
  flex-shrink: 0;
}
.status-bar.ok .status-spinner { border-top-color: #065F46; }
@keyframes doq-spin { to { transform: rotate(360deg); } }

/* ── LOADING SPINNER ───────────────────────────────────────── */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: doq-spin .8s linear infinite;
  margin: 0 auto 16px;
}
.spin {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: doq-spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* ── TOAST ─────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--deep); color: white;
  padding: 10px 20px; border-radius: 100px;
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 1000;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #DC2626; }
#toast.ok    { background: var(--teal); }

/* ── SELECTED DOCTOR BANNER (qdoc) ─────────────────────────── */
#selected-banner {
  display: none;
  position: sticky;
  top: 60px; z-index: 150;
  background: var(--deep);
  color: white;
  padding: 12px 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--teal);
  animation: slideDown .2s ease;
}
#selected-banner.show { display: flex; }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.sel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sel-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  transition: all .15s;
}
.sel-btn-primary { background: var(--teal); color: white; }
.sel-btn-primary:hover { background: var(--teal-mid); }
.sel-btn-ghost   { background: rgba(255,255,255,.08); color: #9CA3AF; border: 1px solid rgba(255,255,255,.12); }
.sel-btn-ghost:hover { background: rgba(255,255,255,.15); color: white; }

/* ── FADE IN ANIMATION ─────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.fade-in { animation: fadeIn .3s ease; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 560px) {
  .doq-nav { height: 52px; }
  .journey-strip { height: 38px; }
  .card { padding: 18px 16px; }
  #selected-banner { padding: 10px 16px; }
}

/* ── Legacy variable aliases (for qdoc.html compatibility) ──── */
:root {
  --teal-dark:  var(--teal-d);
  --teal-light: var(--teal-lt);
  --ink:        var(--deep);
  --paper:      var(--bg);
  --card:       var(--surface);
  --cream:      var(--border);
}

/* ── FOOTER ────────────────────────────────────────────────── */
.doq-footer {
  background: var(--deep);
  color: #6B9990;
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid #1f2937;
  margin-top: 60px;
}
.doq-footer svg { width: 60px; height: 32px; flex-shrink: 0; opacity: .8; }
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #6B9990;
  text-decoration: none;
  font-size: 13px;
  transition: color .15s;
}
.footer-links a:hover { color: #4DB896; }
.footer-copy {
  font-size: 11px;
  color: #4B5563;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .doq-footer { padding: 24px 16px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-copy { white-space: normal; }
}
