/* ============================================================
   DILAMPHIS CARE — Custom Theme CSS
   Loaded via css/custom.css as declared in config.xml.
   Extends fruity_twentythree — overrides via normal CSS cascade.
   No rules are patched or removed from the parent; everything
   here layers on top cleanly.

   Palette:
     Deep green  #013717  — structure, trust, primary actions
     Burnt orange #9F4400 — progress, CTAs, sparingly used
     Sky blue    #EAF4FD  — input fields, calm data entry
   ============================================================ */

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

:root {
  --dc-green:        #013717;
  --dc-green-light:  #0F5C2E;
  --dc-green-darker: #011F0D;
  --dc-green-tint:   #E5EFE7;
  --dc-orange:       #9F4400;
  --dc-orange-light: #C25A0B;
  --dc-orange-darker: #7A3300;
  --dc-orange-tint:  #FBEADC;
  --dc-sky:          #EAF4FD;
  --dc-sky-border:   #B9D9F2;
  --dc-cream:        #FBF9F5;
  --dc-card:         #FFFFFF;
  --dc-ink:          #1B2A20;
  --dc-ink-soft:     #4B5A4F;
  --dc-border:       #DCE6DE;
  --dc-error:        #A4242B;

  --dc-font-display: 'Fraunces', Georgia, serif;
  --dc-font-body:    'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --dc-radius:    14px;
  --dc-radius-sm: 8px;
  --dc-shadow:    0 4px 24px rgba(1,55,23,0.08), 0 1px 3px rgba(1,55,23,0.06);

  /* Dark-mode layer tokens — grey border + grey shadow so black-on-black
     surfaces (header, cards, welcome screens) stay visually separated
     instead of melting into the black page background. */
  --dc-dark-border: #3C3C3C;
  --dc-dark-shadow: 0 1px 0 rgba(190,190,190,0.10),
                     0 6px 20px rgba(0,0,0,0.55),
                     0 0 0 1px rgba(190,190,190,0.08);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Page foundation ---------- */
body {
  background:   var(--dc-cream) !important;
  font-family:  var(--dc-font-body) !important;
  color:        var(--dc-ink) !important;
  line-height:  1.6;
}
a       { color: var(--dc-green-light); }
a:hover { color: var(--dc-orange); }

h1, h2, h3, h4,
.group-name, .h2.group-name,
.survey-name, .question-group-name {
  font-family: var(--dc-font-display) !important;
  color:       var(--dc-green) !important;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------- Header / logo band ---------- */
#header, .survey-header, .ls-flex-row.header,
.limesurvey-welcome, .row.survey-header {
  background:    var(--dc-green);
  border-radius: 0 0 var(--dc-radius) var(--dc-radius);
  padding:       20px 28px;
  margin-bottom: 18px;
}
#header .survey-name, .survey-header .survey-name,
#header h1, .survey-header h1 {
  color:       #fff !important;
  font-family: var(--dc-font-display) !important;
  font-size:   1.6rem;
  margin:      0;
}
#header img, .survey-header img, .survey-logo img {
  max-height:    64px;
  border-radius: 50%;
  border:        3px solid var(--dc-orange);
  background:    #fff;
  padding:       2px;
}

.survey-description, #description {
  color:     var(--dc-ink-soft);
  font-size: 0.95rem;
  padding:   0 28px 12px;
}

/* ---------- Progress bar ---------- */
.progress, .ls-progress {
  height:        14px !important;
  background:    var(--dc-green-tint) !important;
  border-radius: 999px !important;
  overflow:      hidden;
  box-shadow:    inset 0 1px 2px rgba(1,55,23,0.08);
  margin:        18px 0 8px;
}
.progress-bar, .ls-progress-bar {
  background:    linear-gradient(90deg, var(--dc-orange) 0%, var(--dc-orange-light) 100%) !important;
  border-radius: 999px;
  transition:    width 0.4s ease;
}
.indicator-percent-completed, .ls-indicator-percent-completed,
.progress-text {
  font-family: var(--dc-font-body);
  font-weight: 600;
  color:       var(--dc-green);
  font-size:   0.85rem;
}

/* ---------- Question group card ---------- */
.group-container, .questions-container, #group-,
.row.group-container, .question-group {
  background:    var(--dc-card);
  border:        1px solid var(--dc-border);
  border-radius: var(--dc-radius);
  box-shadow:    var(--dc-shadow);
  padding:       28px 30px;
  margin:        0 0 22px;
}
.group-description {
  color:         var(--dc-ink-soft);
  font-size:     0.95rem;
  margin-bottom: 16px;
}

/* ---------- Individual questions ---------- */
.question-container, .question-item, .ls-question-text-container {
  border-bottom: 1px solid var(--dc-border);
  padding:       18px 0;
}
.question-container:last-child, .question-item:last-child { border-bottom: none; }

.question-text, .ls-label-question, legend.ls-label-question {
  font-weight:   600;
  color:         var(--dc-ink) !important;
  font-size:     1.02rem;
  margin-bottom: 6px;
}
.question-help, .ls-help, .em_q_fn_validation, .help-block {
  color:     var(--dc-ink-soft);
  font-size: 0.88rem;
}
.asterisk, .text-danger.asterisk { color: var(--dc-orange) !important; }

/* ---------- Inputs ---------- */
input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="date"], textarea,
.form-control, select.form-control, input.text, textarea.form-control {
  background:    var(--dc-sky) !important;
  border:        1.5px solid var(--dc-sky-border) !important;
  border-radius: var(--dc-radius-sm) !important;
  padding:       10px 14px !important;
  font-family:   var(--dc-font-body) !important;
  color:         var(--dc-ink) !important;
  transition:    border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus, input[type="email"]:focus,
input[type="tel"]:focus, input[type="number"]:focus,
input[type="date"]:focus, textarea:focus, .form-control:focus {
  background:  #fff !important;
  border-color: var(--dc-green-light) !important;
  box-shadow:  0 0 0 3px rgba(15,92,46,0.15) !important;
  outline:     none;
}

input[type="radio"], input[type="checkbox"] {
  accent-color: var(--dc-green);
  width: 18px; height: 18px;
}
.answer-item label, .radio label, .checkbox label { color: var(--dc-ink); }
.answer-item:hover, .radio:hover, .checkbox:hover  { color: var(--dc-green); }

/* Keyboard focus (accessibility) */
a:focus-visible, button:focus-visible,
input:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--dc-orange) !important;
  outline-offset: 2px;
}
/* Bootstrap gives buttons a default blue focus-ring box-shadow on
   click/focus/active (--bs-btn-focus-box-shadow), independent of any
   background-color override — this is the blue glow around button
   text/edges. Removed everywhere; the orange outline above already
   covers keyboard-accessibility focus indication. */
.btn:focus, .btn:active, .btn:hover,
.btn:focus-visible, .btn.focus, .btn.active,
button:focus, button:active {
  box-shadow: none !important;
}
.btn:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none !important;
}

/* ---------- Buttons ---------- */
.btn, .ls-move-btn, button[type="submit"] {
  font-family:   var(--dc-font-body) !important;
  font-weight:   600 !important;
  border-radius: 999px !important;
  padding:       11px 28px !important;
  border:        none !important;
  transition:    transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover, .ls-move-btn:hover { transform: translateY(-1px); }

/* Navigation buttons only — exclude Y/N answer buttons which also use btn-primary.
   Next = brand orange, Previous = brand green, both solid fills.
   Light-mode hover LIGHTENS; the dark-mode equivalent (which DARKENS
   instead) lives in the dark-mode section since it needs body.dc-dark
   scoping to differ from this rule. */
.btn-primary:not(.ls-button-label):not(.answer-item),
.ls-move-submit-btn, .ls-move-next-btn,
button.action--ls-button-submit, button.action--ls-button-next {
  background: var(--dc-orange) !important;
  border-color: var(--dc-orange) !important;
  color:      #fff !important;
  box-shadow: 0 3px 10px rgba(159,68,0,0.25);
}
body:not(.dc-dark) .btn-primary:not(.ls-button-label):not(.answer-item):hover,
body:not(.dc-dark) .ls-move-submit-btn:hover,
body:not(.dc-dark) .ls-move-next-btn:hover {
  background: var(--dc-orange-light) !important;
  border-color: var(--dc-orange-light) !important;
  box-shadow: 0 5px 16px rgba(159,68,0,0.32);
}
.ls-move-previous-btn, button.action--ls-button-previous,
.btn-secondary, .btn-default {
  background: var(--dc-green) !important;
  border-color: var(--dc-green) !important;
  color:      #fff !important;
  box-shadow: 0 3px 10px rgba(1,55,23,0.25);
}
body:not(.dc-dark) .ls-move-previous-btn:hover,
body:not(.dc-dark) button.action--ls-button-previous:hover,
body:not(.dc-dark) .btn-secondary:hover,
body:not(.dc-dark) .btn-default:hover {
  background: var(--dc-green-light) !important;
  border-color: var(--dc-green-light) !important;
}

/* ── Y/N buttons — confirmed DOM structure from live survey:
   <input type="radio" id="answerQ6371Y" value="Y">   ← sibling BEFORE label
   <label class="btn btn-primary ls-button-label" for="answerQ6371Y"> Yes </label>
   → input:checked + label is the correct selector.
   Unselected: plain white. Yes: green. No: dark red.         */
label.ls-button-label,
label.answer-item.btn {
  background:   #FFFFFF !important;
  border-color: #CCCCCC !important;
  color:        #555555 !important;
  border-width: 2px     !important;
  transition:   background-color 0.15s ease, border-color 0.15s ease !important;
}
label.ls-button-label:hover,
label.answer-item.btn:hover {
  border-color: var(--dc-green) !important;
  color:        var(--dc-green) !important;
}
/* .ls-icon (confirmed markup: <span class="fa fa-ban ri-close-circle-
   line ls-icon">) is Fruity's own icon-badge class, and it draws a
   BORDER around the glyph — not a background. That's why the earlier
   "make icon backgrounds transparent" fixes never touched it: wrong
   property entirely. Stripped completely here, in both modes, so
   only the actual checkmark/ban glyph shows, no frame around it. */
.ls-icon,
.btn .ls-icon,
label .ls-icon,
.answer-item .ls-icon,
.ls-button-label .ls-icon,
span.ls-icon {
  border:      none !important;
  background:  transparent !important;
  box-shadow:  none !important;
  outline:     none !important;
  padding:     0 !important;
}
/* Yes selected */
input[type="radio"][value="Y"]:checked + label.ls-button-label,
input[type="radio"][value="Y"]:checked + label.answer-item {
  background:   var(--dc-green, #013717) !important;
  border-color: var(--dc-green, #013717) !important;
  color:        #FFFFFF !important;
}
/* No selected */
input[type="radio"][value="N"]:checked + label.ls-button-label,
input[type="radio"][value="N"]:checked + label.answer-item {
  background:   #7B1F1F !important;
  border-color: #7B1F1F !important;
  color:        #FFFFFF !important;
}

/* ---------- Validation / errors ---------- */
.has-error .form-control, .ls-invalid input, .error input {
  border-color: var(--dc-error) !important;
  background:   #FDF1F1 !important;
}
.errormandatory, .ls-errormandatory, .alert-danger {
  color:         var(--dc-error);
  background:    #FDF1F1;
  border:        1px solid var(--dc-error);
  border-radius: var(--dc-radius-sm);
  padding:       10px 14px;
}

/* ---------- Welcome / end screens ---------- */
.welcome, .ls-welcome, .completed-text, .survey-list-row {
  background:    var(--dc-card);
  border-radius: var(--dc-radius);
  box-shadow:    var(--dc-shadow);
  padding:       36px 32px;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .group-container, .questions-container, .question-group {
    padding:       20px 18px;
    border-radius: var(--dc-radius-sm);
  }
  #header, .survey-header { padding: 16px 18px; }
  .btn, .ls-move-btn { width: 100%; margin-bottom: 8px; }
}

/* ---------- Navbar logo ---------- */
/* Logo 84px (50% larger than original 56px). Padding around the logo
   is 3px on every side; navbar height grows to fit (84 + 3 + 3 = 90).

   FIX: this rule previously set `position: relative`, which silently
   overrode Bootstrap's own `.fixed-top` class (`position: fixed;
   top: 0;`) on the real markup (`<div id="survey-nav" class="navbar
   fixed-top">`). With the override in place, the bar was pulled OUT
   of fixed/pinned positioning and rendered in normal document flow
   instead — wherever it naturally fell after whatever precedes it —
   which is exactly what produces a gap of page background above it.
   `.fixed-top` means "pinned to the very top of the viewport"; this
   now makes that explicit and guaranteed rather than hoping
   Bootstrap's own rule wins the cascade unassisted.

   CENTERING FIX (round 2): flex + align-items:center didn't hold up
   on mobile — something inside the bar wasn't resolving cleanly on
   narrow screens. Switched to absolute positioning: top:50% +
   translateY(-50%) finds the exact vertical centre of WHATEVER
   height the bar actually ends up at, unconditionally. It no longer
   depends on flex alignment, sibling heights, or matching min-height
   to the real render. */
#survey-nav, .navbar.fixed-top {
  position:      fixed !important;
  top:           0 !important;
  left:          0;
  right:         0;
  z-index:       1030;
  min-height:    81.6px; /* 75.6px logo + 3px top + 3px bottom */
  background:    var(--dc-green) !important;
  border-bottom: 2px solid var(--dc-green-darker) !important;
}
/* Fixed positioning takes the bar out of the document's normal flow,
   so the page content needs an equivalent top offset or the fixed
   bar will sit ON TOP of (hide) the first ~82px of the page instead
   of pushing it down — this is Bootstrap's own documented pattern
   for any fixed-top navbar. */
body {
  padding-top: 92px !important;
  margin:      0 !important;
}
#survey-nav::before, .navbar.fixed-top::before {
  content:             "";
  position:            absolute !important;
  top:                 50% !important;
  left:                14px !important;
  transform:           translateY(-50%) !important;
  margin:              0 !important;
  width:               75.6px; /* 84px reduced 10% */
  height:              75.6px; /* 84px reduced 10% */
  background-image:    url('https://services.dilamphiscare.com/wp-content/uploads/2024/06/new-logo-Circular-white-bark-e1720031011884.png');
  background-size:     cover;
  background-position: center;
  border-radius:       50%;
  border:              2.5px solid var(--dc-orange);
}
/* The logo is now positioned independently of the bar's own content
   (it's taken clean out of flow), so its old content needs its own
   left space reserved instead of relying on flex order to push it
   right of the logo. 75.6px logo + 14px offset + a little breathing
   room. */
#survey-nav > div, .navbar.fixed-top > div {
  padding-left: 104px !important;
}

/* ---------- Index / flyout menu — identical in light & dark ----------
   The question-index / language-switcher / save-load dropdown/drawer
   that opens from the nav bar. Written as an explicit light-mode rule
   PLUS an unscoped fallback, rather than relying on one unscoped rule
   alone — in testing, the unscoped version alone was losing to
   something in light mode specifically (dark mode happened to be
   reinforced by the separate #survey-nav-green dark rule, which is
   why only light mode showed the bug). Also covers Bootstrap's
   .offcanvas pattern defensively, in case the panel that opens is an
   offcanvas drawer rather than a plain .dropdown-menu — both get
   identical styling either way, so it's safe to cover both. */
#survey-nav .dropdown-menu, .navbar.fixed-top .dropdown-menu,
#navbar-menu .dropdown-menu, #main-dropdown,
#survey-nav .offcanvas, .navbar.fixed-top .offcanvas,
body:not(.dc-dark) #survey-nav .dropdown-menu,
body:not(.dc-dark) .navbar.fixed-top .dropdown-menu,
body:not(.dc-dark) #navbar-menu .dropdown-menu,
body:not(.dc-dark) #main-dropdown,
body:not(.dc-dark) #survey-nav .offcanvas,
body:not(.dc-dark) .navbar.fixed-top .offcanvas {
  background-color: var(--dc-green) !important;
  border:           none !important;
  outline:          none !important;
  border-radius:    var(--dc-radius-sm);
  box-shadow:       0 8px 24px rgba(0,0,0,0.25);
  padding:          6px 0;
  position:   absolute !important;
  max-height: min(70vh, 480px) !important;
  overflow-y: auto !important;
}
/* Every descendant (the <li class="list-group-item index-item ...">
   wrapper especially) loses its own background/border/margin first —
   Bootstrap's .list-group-item ships a default WHITE background and
   a 1px border, which is exactly the "thick border / white patch"
   effect around each item. Zeroing everything out here, THEN the
   .dropdown-item rule right after re-asserts its own green (it wins
   the tie because it's more specific AND comes later), so only the
   actual link row shows colour, cleanly, with nothing peeking through. */
#survey-nav .dropdown-menu *, .navbar.fixed-top .dropdown-menu *,
#survey-nav .offcanvas *, .navbar.fixed-top .offcanvas * {
  color:             #FFFFFF !important;
  background:        transparent !important;
  background-color:  transparent !important;
  border:            none !important;
  outline:           none !important;
  box-shadow:        none !important;
  margin:            0 !important;
}
#survey-nav .dropdown-item, .navbar.fixed-top .dropdown-item,
#survey-nav .offcanvas-header, #survey-nav .offcanvas-body,
.navbar.fixed-top .offcanvas-header, .navbar.fixed-top .offcanvas-body,
body:not(.dc-dark) #survey-nav .dropdown-item,
body:not(.dc-dark) .navbar.fixed-top .dropdown-item,
body:not(.dc-dark) #survey-nav .offcanvas-header,
body:not(.dc-dark) #survey-nav .offcanvas-body,
body:not(.dc-dark) .navbar.fixed-top .offcanvas-header,
body:not(.dc-dark) .navbar.fixed-top .offcanvas-body {
  background-color: var(--dc-green) !important;
  color:            #FFFFFF !important;
  font-family:      var(--dc-font-body);
  padding:          8px 18px;
  margin:           0 !important;
  border:           none !important;
  outline:          none !important;
  box-shadow:       none !important;
}
#survey-nav .dropdown-item:hover, #survey-nav .dropdown-item:focus,
.navbar.fixed-top .dropdown-item:hover, .navbar.fixed-top .dropdown-item:focus,
body:not(.dc-dark) #survey-nav .dropdown-item:hover,
body:not(.dc-dark) #survey-nav .dropdown-item:focus,
body:not(.dc-dark) .navbar.fixed-top .dropdown-item:hover,
body:not(.dc-dark) .navbar.fixed-top .dropdown-item:focus {
  background-color: var(--dc-orange) !important;
  color:            #FFFFFF !important;
  border-radius:    10px !important;
}
/* Unanswered-section indicator — a small orange left accent so
   incomplete sections stand out at a glance in a long intake form.
   Doesn't fight the catch-all above: two classes beats one. */
#survey-nav .dropdown-item.index-warning,
.navbar.fixed-top .dropdown-item.index-warning {
  border-left:  4px solid var(--dc-orange) !important;
  padding-left: 14px !important;
}
/* Current section — Bootstrap's .disabled normally fades it with
   reduced opacity; restored to full strength plus a white "you are
   here" accent so the current position is clear, not muted. */
#survey-nav .dropdown-item.disabled,
.navbar.fixed-top .dropdown-item.disabled {
  opacity:      1 !important;
  font-weight:  700 !important;
  border-left:  4px solid #FFFFFF !important;
  padding-left: 14px !important;
  cursor:       default !important;
}
/* Scrollbar — track matches the menu's own green (blends in rather
   than standing out), thumb is the brand orange (a visible, on-brand
   drag handle) — applies the same in light and dark since the menu
   itself doesn't change colour between modes. */
#main-dropdown::-webkit-scrollbar {
  width: 10px;
}
#main-dropdown::-webkit-scrollbar-track {
  background-color: var(--dc-green) !important;
}
#main-dropdown::-webkit-scrollbar-thumb {
  background-color: var(--dc-orange) !important;
  border-radius:     6px;
}
#main-dropdown {
  scrollbar-color: var(--dc-orange) var(--dc-green);
}

/* ---------- Nav toggle icon (the "···" trigger, top-right) ----------
   Exact markup now confirmed:
   <button id="navbar-toggler" class="navbar-toggler" ...>
     <span class="ri-more-fill"></span>
   </button>
   The grey was the button itself matching the generic "other button"
   dark-mode rule (any plain <button> not otherwise excluded gets a
   neutral charcoal fill) — #navbar-toggler was never excluded from
   that. Fixed directly by ID, which now overrides everything else
   regardless of class-based specificity. */
#navbar-toggler {
  background:       transparent !important;
  background-color: transparent !important;
  border:           none !important;
  box-shadow:       none !important;
  outline:          none !important;
}
body.dc-dark #navbar-toggler {
  background:       transparent !important;
  background-color: transparent !important;
}
/* RemixIcon glyph inside it: kept as a defensive fallback via :has()
   in case any other wrapper ever sits between the button and icon. */
body.dc-dark .ri-more-fill,
body.dc-dark *:has(> .ri-more-fill),
body.dc-dark *:has(.ri-more-fill) {
  background:       transparent !important;
  background-color: transparent !important;
  box-shadow:        none !important;
}
/* Hide the RemixIcon font glyph and draw a 3-line hamburger instead,
   as requested — same colour-and-shape fix, now on the right element. */
body.dc-dark .ri-more-fill,
#survey-nav .ri-more-fill, .navbar.fixed-top .ri-more-fill {
  color:      transparent !important;
  display:    inline-block !important;
  width:      20px;
  height:     20px;
  position:   relative;
}
body.dc-dark .ri-more-fill::before,
#survey-nav .ri-more-fill::before, .navbar.fixed-top .ri-more-fill::before {
  content:             "" !important;
  position:            absolute;
  inset:               0;
  background-image:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FBF9F5' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E") !important;
  background-repeat:   no-repeat !important;
  background-position: center !important;
  background-size:     18px 18px !important;
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE
   Universal rule: body.dc-dark * sets everything to #000 first.
   Named exceptions are carved out below, in this order:
     1. Layered surfaces  — grey border + grey shadow so black-on-
        black cards/header/welcome screens stay visibly separated
     2. Inputs             — #111 so the field boundary shows
     3. Next/Previous buttons — same orange/green fill as light mode,
        hover DARKENS (light mode hover LIGHTENS instead)
     4. All other plain buttons — grey→dark gradient on hover
     5. Progress bar        — dark track, orange fill, grey outline
     6. Top navigation bar (#survey-nav) — keeps the brand green
        #013717, including every child element/box inside it
   The flyout index/language/save menu is styled identically in both
   modes — see the unified rule in the light-mode "Navbar logo"
   section, since it doesn't need to change between modes.
   dc-on-brand section banners keep their branded colours (hook is
   available but not yet wired to any view — see note in summary).

   NOTE ON SPECIFICITY: the universal rule below is intentionally
   given an explicit exclusion list rather than being fought with
   ever-higher-specificity overrides. Inputs, the progress bar, and
   the error/validation boxes were previously losing their exception
   rules to the universal rule (both !important, but the universal
   selector's :not() chain out-specifies a plain class or attribute
   selector) — they are excluded here so their dedicated rules are
   the only authority, no cascade fight, no !important war. ──────── */

/* ── Universal: everything black, text white ─────────────── */
body.dc-dark {
  background-color: #000000 !important;
  color:            #FFFFFF !important;
}
body.dc-dark *:not(.dc-on-brand):not(.dc-on-brand *):not(.dc-theme-toggle):not(input):not(select):not(textarea):not(.form-control):not(.form-select):not(.progress):not(.ls-progress):not(.progress-bar):not(.errormandatory):not(.ls-errormandatory):not(.alert-danger):not(img):not(a):not(.btn:not(.ls-button-label):not(.answer-item.btn)):not(button:not(.ls-button-label):not(.answer-item.btn)):not(.btn *):not(button *):not(input:checked + label.ls-button-label):not(input:checked + label.answer-item.btn):not(.ri-more-fill):not(:has(.ri-more-fill)) {
  background-color: #000000 !important;
  color:            #FFFFFF !important;
  border-color:     #333333 !important;
}

/* ── Layered surfaces: grey border + grey shadow ─────────────
   These containers keep their black background (by design) but
   gain an explicit border-width/style (most had none at all, so
   the universal border-color above was rendering invisibly) plus
   a grey box-shadow, so each layer reads as its own surface. */
body.dc-dark #header,
body.dc-dark .survey-header,
body.dc-dark .ls-flex-row.header,
body.dc-dark .limesurvey-welcome,
body.dc-dark .row.survey-header {
  border-width: 1px !important;
  border-style: solid !important;
  box-shadow:   var(--dc-dark-shadow) !important;
}
body.dc-dark .group-container,
body.dc-dark .questions-container,
body.dc-dark .row.group-container,
body.dc-dark .question-group,
body.dc-dark [id^="group-"] {
  box-shadow: var(--dc-dark-shadow) !important;
}
body.dc-dark .welcome,
body.dc-dark .ls-welcome,
body.dc-dark .completed-text,
body.dc-dark .survey-list-row {
  border-width: 1px !important;
  border-style: solid !important;
  box-shadow:   var(--dc-dark-shadow) !important;
}
/* Error / validation boxes keep a red accent instead of turning
   grey, so warnings stay legible — plus the same grey-shadow lift. */
body.dc-dark .errormandatory,
body.dc-dark .ls-errormandatory,
body.dc-dark .alert-danger {
  background-color: #2A0F0F !important;
  border:           1px solid var(--dc-error) !important;
  color:            #FF9B9B !important;
  box-shadow:       var(--dc-dark-shadow) !important;
}
/* Broader net: any other "text block"/"text box" style container —
   info/warning/success alerts, Bootstrap card/panel/well/list-group
   wrappers, array & matrix question tables, LimeSurvey's own
   answer-list/radio/checkbox classes, icon wrappers, and the
   "Other, please specify" comment box — gets the same border +
   grey-shadow lift. Harmless if a class isn't present on a page. */
body.dc-dark .alert:not(.alert-danger),
body.dc-dark .card,
body.dc-dark .panel,
body.dc-dark .well,
body.dc-dark .list-group,
body.dc-dark .list-group-item,
body.dc-dark .list-group-horizontal,
body.dc-dark .answer-list,
body.dc-dark .radio-list,
body.dc-dark .radio-item,
body.dc-dark .select-list,
body.dc-dark .checkbox-item,
body.dc-dark .checkbox-text-item,
body.dc-dark .comment-container,
body.dc-dark .other-comment-container,
body.dc-dark .other-replace-text,
body.dc-dark .subquestion-list,
body.dc-dark .answers-list,
body.dc-dark table.question,
body.dc-dark .icon-wrapper,
body.dc-dark figure,
body.dc-dark .thumbnail,
body.dc-dark .ls-answer-image,
body.dc-dark .question-image,
body.dc-dark .image-container,
body.dc-dark .answertext {
  border-width: 1px !important;
  border-style: solid !important;
  box-shadow:   var(--dc-dark-shadow) !important;
}
/* Images: never paint a solid black box behind them. The circular
   logo badge keeps its white backdrop (by design, orange ring stays
   visible); every other content image gets a grey frame + shadow
   instead of vanishing into the black page. */
body.dc-dark #header img,
body.dc-dark .survey-header img,
body.dc-dark .survey-logo img {
  background: #ffffff !important;
}
body.dc-dark img:not(.survey-logo):not(#header img):not(.survey-header img) {
  border:        1px solid var(--dc-dark-border) !important;
  box-shadow:    var(--dc-dark-shadow) !important;
  border-radius: 4px;
}

/* ── Inputs: #111 so the field boundary is visible ─────────── */
body.dc-dark input[type="text"],
body.dc-dark input[type="email"],
body.dc-dark input[type="tel"],
body.dc-dark input[type="number"],
body.dc-dark input[type="date"],
body.dc-dark input[type="time"],
body.dc-dark input[type="password"],
body.dc-dark input[type="search"],
body.dc-dark textarea,
body.dc-dark select,
body.dc-dark .form-control,
body.dc-dark .form-select {
  background-color: #111111 !important;
  color:            #FFFFFF !important;
  border-color:     #555555 !important;
  box-shadow:       var(--dc-dark-shadow) !important;
}
body.dc-dark input::placeholder,
body.dc-dark textarea::placeholder { color: #666666 !important; }
body.dc-dark input[type="radio"],
body.dc-dark input[type="checkbox"] { accent-color: var(--dc-orange); }

/* ── Next / Previous buttons: same fill as light mode, but hover
   DARKENS instead of lightens (light mode lightens — see the base
   Buttons section). Still need this dark-scoped resting rule even
   though the colour is identical to light mode, purely to defeat
   the universal blackout above. ──────────────────────────────── */
body.dc-dark .btn-primary:not(.ls-button-label):not(.answer-item),
body.dc-dark .ls-move-next-btn,
body.dc-dark .ls-move-submit-btn,
body.dc-dark button.action--ls-button-next,
body.dc-dark button.action--ls-button-submit {
  background-color: var(--dc-orange) !important;
  border-color:     var(--dc-orange) !important;
  color:            #ffffff !important;
}
body.dc-dark .btn-primary:not(.ls-button-label):not(.answer-item):hover,
body.dc-dark .ls-move-next-btn:hover,
body.dc-dark .ls-move-submit-btn:hover {
  background-color: var(--dc-orange-darker) !important;
  border-color:     var(--dc-orange-darker) !important;
}
body.dc-dark .ls-move-previous-btn,
body.dc-dark button.action--ls-button-previous,
body.dc-dark .btn-secondary,
body.dc-dark .btn-default {
  background-color: var(--dc-green) !important;
  border-color:     var(--dc-green) !important;
  color:            #ffffff !important;
}
body.dc-dark .ls-move-previous-btn:hover,
body.dc-dark button.action--ls-button-previous:hover,
body.dc-dark .btn-secondary:hover,
body.dc-dark .btn-default:hover {
  background-color: var(--dc-green-darker) !important;
  border-color:     var(--dc-green-darker) !important;
}
/* Every OTHER plain button (Clear all, Save/Resume, Print, language
   switcher, modal actions, etc.) is now excluded from the universal
   blackout above (.btn / button), so it needs its own neutral dark
   base style plus the grey→dark gradient on hover. Next/Previous/
   Y-N are excluded from this list — they keep their own brand
   colours from the rules above. */
body.dc-dark .btn:not(.btn-primary):not(.btn-secondary):not(.btn-default):not(.ls-button-label):not(.answer-item.btn):not(.ls-move-next-btn):not(.ls-move-previous-btn):not(.ls-move-submit-btn):not(.dc-theme-toggle),
body.dc-dark button:not(.btn-primary):not(.btn-secondary):not(.btn-default):not(.ls-button-label):not(.answer-item.btn):not(.action--ls-button-next):not(.action--ls-button-previous):not(.action--ls-button-submit):not(.dc-theme-toggle) {
  background:   #2A2A2A !important;
  color:        #FFFFFF !important;
  border-color: #4A4A4A !important;
}
body.dc-dark .btn:not(.btn-primary):not(.btn-secondary):not(.btn-default):not(.ls-button-label):not(.answer-item.btn):not(.ls-move-next-btn):not(.ls-move-previous-btn):not(.ls-move-submit-btn):not(.dc-theme-toggle):hover,
body.dc-dark button:not(.btn-primary):not(.btn-secondary):not(.btn-default):not(.ls-button-label):not(.answer-item.btn):not(.action--ls-button-next):not(.action--ls-button-previous):not(.action--ls-button-submit):not(.dc-theme-toggle):hover {
  background:   linear-gradient(135deg, #4A4A4A, #1C1C1C) !important;
  color:        #FFFFFF !important;
  border-color: #5A5A5A !important;
}
/* Answer-row hover feedback (radio/checkbox lists) — the light-mode
   hover colour wasn't marked !important, so it was losing outright
   to the universal white-text rule and never showing on dark mode. */
body.dc-dark .answer-item:hover,
body.dc-dark .radio:hover,
body.dc-dark .checkbox:hover {
  color: #78C89A !important;
}

/* ── Progress bar track and fill ────────────────────────────── */
body.dc-dark .progress,
body.dc-dark .ls-progress {
  background-color: #222222 !important;
  border:           1px solid var(--dc-dark-border) !important;
}
body.dc-dark .progress-bar {
  background-color: var(--dc-orange) !important;
}

/* ── Top navigation bar (#survey-nav): keep brand green ──────
   Every element/block/box inside the bar — logo container, toggle
   icon, dropdown wrapper — matches the bar's own #013717 instead of
   falling to the universal black. #survey-nav is an ID selector, so
   it naturally outranks the universal rule's specificity — no
   !important war needed. Border is unconditional (2px darker-green,
   set in the light-mode Navbar logo section) so it's already correct
   here without repeating it. The flyout menu is styled the same way
   in both modes — see the unified rule in the light-mode section. */
body.dc-dark #survey-nav,
body.dc-dark #survey-nav *,
body.dc-dark .navbar.fixed-top,
body.dc-dark .navbar.fixed-top * {
  background-color: var(--dc-green) !important;
  color:            #FFFFFF !important;
}

/* ── Links ───────────────────────────────────────────────────── */
body.dc-dark a { color: #78C89A !important; }
body.dc-dark a:hover { color: var(--dc-orange) !important; }
/* Dark mode toggle button */
.dc-theme-toggle {
  position:   fixed;
  bottom:     10px;
  left:       50%;
  transform:  translateX(-50%);
  z-index:    9999;
  background: rgba(1,55,23,0.82);
  color:      #fff;
  border:     none;
  border-radius: 50%;
  width:      32px;
  height:     32px;
  padding:    0;
  font-size:  14px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  cursor:     pointer;
  display:    flex;
  align-items:     center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.dc-theme-toggle:hover {
  transform:  translateX(-50%) translateY(-2px);
  background: var(--dc-orange);
}

/* ── Y/N buttons in dark mode ─────────────────────────────────
   Unselected: the label itself is NO LONGER excluded from the
   universal blackout, so it's plain black/white/grey like every
   other unselected surface — only changes on selection.
   Selected: Yes = burnt orange (matches Next), No = deep green
   (matches Previous) — consistent forward/back colour language.
   The icon badge inside the label (whatever markup it is — i, svg,
   or a wrapper span) is excluded from the blackout above via
   ":not(label.ls-button-label *)" and forced transparent here, so
   it always shows through to the label's CURRENT background —
   black when unselected, orange/green when selected — instead of
   showing its own mismatched dark square. */
/* Any icon/badge/wrapper riding inside ANY button in dark mode
   (Y/N icons, the date-field calendar-picker button's icon, icons in
   generic buttons) never carries its own background — it's excluded
   from the blackout above (":not(.btn *):not(button *)") and forced
   transparent here, so it always shows through to whatever colour
   the BUTTON itself currently is, instead of a mismatched dark square. */
body.dc-dark .btn *,
body.dc-dark button * {
  background:       transparent !important;
  background-color: transparent !important;
}
body.dc-dark input[type="radio"][value="Y"]:checked + label.ls-button-label,
body.dc-dark input[type="radio"][value="Y"]:checked + label.answer-item {
  background:   var(--dc-orange) !important;
  border-color: var(--dc-orange) !important;
  color:        #FFFFFF !important;
}
body.dc-dark input[type="radio"][value="N"]:checked + label.ls-button-label,
body.dc-dark input[type="radio"][value="N"]:checked + label.answer-item {
  background:   var(--dc-green) !important;
  border-color: var(--dc-green) !important;
  color:        #FFFFFF !important;
}

