:root {
  --blue-900: #0b3c5d;  /* deep medical navy */
  --blue-700: #165a8a;
  --blue-600: #1b6fae;
  --blue-500: #2a89c9;
  --blue-100: #e6f2fb;
  --teal-400: #2fb7a2;
  --bg: #f7f9fc;
  --text: #0f172a; /* slate-900 */
  --muted: #5b7089; /* slate-500 */
  --card: #ffffff;
  --border: #e6edf5;
  --focus: #90caf9;
  --shadow: 0 10px 20px rgba(11, 60, 93, 0.08), 0 3px 6px rgba(11, 60, 93, 0.06);
}

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; line-height: 1.4;
}

.page {
  max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px;
}

.header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-600), var(--teal-400)); box-shadow: 0 0 0 3px #d9ecfa44; }
h1 { margin: 0; font-weight: 700; font-size: clamp(20px, 2.2vw, 28px); color: var(--blue-900); }
.subtitle { color: var(--muted); font-size: 14px; }

.grid {
  display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: clip; position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  transform-style: preserve-3d;
  padding-bottom: 40px;
}

.card.flipping {
  animation: flipCard 0.6s ease-in-out;
}

@keyframes flipCard {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.card:focus-within, .card:hover { transform: translateY(-1px); box-shadow: 0 14px 24px rgba(11, 60, 93, 0.12), 0 4px 10px rgba(11, 60, 93, 0.08); }

.card-header { padding: 16px 16px 0 16px; position: relative; }
.q-title { font-size: 18px; font-weight: 700; color: var(--blue-900); margin: 0 0 8px 0; }

.flip-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 16px;
  color: var(--muted);
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.flip-btn:hover {
  opacity: 0.8;
}

.card-flip-icon {
  font-size: 16px;
}

.card-flip-icon:before {
  content: "\f363";
  font-family: "Font Awesome 5 Pro";
}

.options { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 16px; }

/* Option row (entire div clickable) */
.option { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 12px 14px; transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.option:hover { background: #f9fbff; border-color: #d6e8f7; }
.option:focus-within, .option.selected { outline: 3px solid var(--focus); outline-offset: 2px; }

.option input[type="radio"] { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

.custom-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--blue-600); display: grid; place-items: center; flex: 0 0 18px; }
.custom-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-600); transform: scale(0); transition: transform 0.15s ease; }
.option input[type="radio"]:checked ~ .custom-radio::after { transform: scale(1); }

.opt-label { font-weight: 600; color: #0f2742; }
.opt-help  { font-size: 12px; color: var(--muted); }

/* RESULT STATE */
.result { padding: 8px 16px 16px; }
.result-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; margin: 6px 0 12px; }

.bars { display: flex; flex-direction: column; gap: 10px; transition: opacity 160ms ease; }
.bars.fade { opacity: 0.25; }

.bar-row { display: flex; flex-direction: column; gap: 8px; }

.bar-label { font-size: 13px; font-weight: 700; color: #0f2742; line-height: 1.3; position: relative; }

.bar-row.selected .bar-label::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--blue-600);
  font-weight: 900;
  font-size: 14px;
}

.bar-row.selected .bar-label {
  color: var(--blue-900);
  padding-left: 20px;
}

.bar-row.selected .bar-container {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 1px var(--blue-600);
}

.bar-container { position: relative; height: 24px; background: var(--blue-100); border: 1px solid #d8e7f5; }
.bar-fill { position: absolute; height: 100%; left: 0; top: 0; background: var(--blue-600); width: 0%; transition: width 420ms ease; }
.bar-pct { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); z-index: 1; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-weight: 700; background: #eef7ff; color: var(--blue-700); border: 1px solid #d8eaff; }

.foot-note { font-size: 12px; color: var(--muted); padding: 0 16px 14px; }

/* Mobile scroll indicator */
.scroll-indicator { position: fixed; left: 50%; transform: translateX(-50%); bottom: 10px; padding: 8px 12px; background: #0b3c5de0; color: #fff; border-radius: 999px; font-size: 12px; display: none; gap: 8px; align-items: center; box-shadow: 0 6px 14px rgba(0,0,0,0.2); z-index: 50; }
.scroll-indicator .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0.8; animation: bounce 1.8s infinite; }
.scroll-indicator .chev { font-size: 16px; line-height: 0; opacity: 0.9; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(3px); opacity: 1; }
}

@media (max-width: 640px) {
  .scroll-indicator { display: inline-flex; }
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

.result-meta .totals {
  display:none;
}

.result-meta .totals.is_admin {
  display: block;
}

#surveyGrid {
  clear: both;
  margin-bottom: 50px;
}

.grid.promoted-survey {
  grid-template-columns: 1fr;
}

#surveyGrid.promoted-survey .submit-btn, 
#surveyGrid.promoted-survey .blurb {
  width: 80%;
  margin: 0 auto;
}

#surveyGrid.promoted-survey .node-link {
  text-align: center;
  width: 100%;
}

#block-rheumnow-theme-promotedsurveyblock .block-title span {
  font-size: 14pt;
  letter-spacing: 1.2px;
  font-family: poppins;
  color: #222626;
}

.free-text-response textarea.free-text-textarea {
  height: 150px;
  border-radius: 15px;
  font-size: 20px;
  border: 1px solid #1b6fae;
  width: 100%; 
}

.char-counter {
  text-align: right;
}

.card.free-text-response .submit-wrapper {
  width: 100%;
}
.submit-free-text-btn.button--primary {
  width: 80px;
  margin: 10px auto;
  display: block;
  background: #1b6fae;
  border-radius: 5px;
}

