/* ============================================================
   COOKIE CONSENT STYLES
   Matches the Neuvex dashboard palette:
   navy buttons/icons, colored category bars pulled from the
   Actual/Expected/Off-The-Job progress bars, and the light-blue
   "Attention" info-box style reused for the confirmation toast.
   ============================================================ */

:root {
  --cc-navy: #0f2a4a;
  --cc-navy-hover: #16385f;
  --cc-page-tint: #f7f9fc;
  --cc-border: #e5e9f0;
  --cc-text: #16233a;
  --cc-muted: #6b7280;
  --cc-necessary: #64748b;   /* locked / always-on tone */
  --cc-functional: #10b981;  /* matches "Actual Progress" bar */
  --cc-analytics: #6366f1;   /* matches "Expected Progress" bar */
  --cc-marketing: #ec4899;   /* matches "Off The Job Progress" bar */
  --cc-info-bg: #eaf2fd;
  --cc-info-border: #cfe0fb;
  --cc-radius: 14px;
  --cc-shadow: 0 12px 32px rgba(15, 42, 74, 0.16);
  --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#cc-root, #cc-root * { box-sizing: border-box; }

#cc-root {
  font-family: var(--cc-font);
  color: var(--cc-text);
}

/* ---------- Banner ---------- */
#cc-banner {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: 24px;
  max-width: 460px;
  margin-left: auto;
  background: #ffffff;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(16px);
}

#cc-root.cc-ready #cc-banner {
  animation: cc-slide-up 0.35s ease forwards;
}

@keyframes cc-slide-up {
  to { opacity: 1; transform: translateY(0); }
}

#cc-banner-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

#cc-banner-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--cc-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

#cc-banner-icon svg { width: 18px; height: 18px; }

#cc-banner-head h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

#cc-banner-head p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cc-muted);
  margin: 0;
}

#cc-banner-head a {
  color: var(--cc-navy);
  font-weight: 500;
  text-decoration: underline;
}

.cc-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cc-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cc-btn:active { transform: scale(0.97); }

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-analytics);
  outline-offset: 2px;
}

.cc-btn-ghost {
  background: transparent;
  color: var(--cc-muted);
}
.cc-btn-ghost:hover { background: var(--cc-page-tint); color: var(--cc-text); }

.cc-btn-secondary {
  background: var(--cc-page-tint);
  color: var(--cc-navy);
}
.cc-btn-secondary:hover { background: #eef1f6; }

.cc-btn-primary {
  background: var(--cc-navy);
  color: #ffffff;
}
.cc-btn-primary:hover { background: var(--cc-navy-hover); }

/* ---------- Modal ---------- */
#cc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 74, 0.45);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#cc-modal {
  background: #ffffff;
  border-radius: var(--cc-radius);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--cc-shadow);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

#cc-root.cc-modal-open #cc-modal {
  animation: cc-pop-in 0.2s ease forwards;
}

@keyframes cc-pop-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#cc-modal-header {
  padding: 20px 20px 12px 20px;
  border-bottom: 1px solid var(--cc-border);
}

#cc-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

#cc-modal-header p {
  font-size: 13px;
  color: var(--cc-muted);
  margin: 0;
  line-height: 1.5;
}

#cc-modal-body { padding: 4px 20px; }

.cc-category {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  margin: 12px 0;
  background: var(--cc-page-tint);
  border-left: 4px solid var(--cc-cat-color, var(--cc-necessary));
  border-radius: 8px;
}

.cc-category-necessary { --cc-cat-color: var(--cc-necessary); }
.cc-category-functional { --cc-cat-color: var(--cc-functional); }
.cc-category-analytics { --cc-cat-color: var(--cc-analytics); }
.cc-category-marketing { --cc-cat-color: var(--cc-marketing); }

.cc-category-text { flex: 1; }

.cc-category-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.cc-category-text span {
  display: block;
  font-size: 12px;
  color: var(--cc-muted);
  line-height: 1.4;
}

.cc-locked-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--cc-necessary);
  background: #e7eaee;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Toggle switch */
.cc-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
}

.cc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.cc-slider {
  position: absolute;
  inset: 0;
  background: #cbd2dc;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cc-slider::before {
  content: "";
  position: absolute;
  height: 15px;
  width: 15px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.cc-category-functional .cc-switch input:checked + .cc-slider { background: var(--cc-functional); }
.cc-category-analytics .cc-switch input:checked + .cc-slider { background: var(--cc-analytics); }
.cc-category-marketing .cc-switch input:checked + .cc-slider { background: var(--cc-marketing); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(17px); }

.cc-switch input:focus-visible + .cc-slider {
  outline: 2px solid var(--cc-navy);
  outline-offset: 2px;
}

#cc-modal-footer {
  padding: 14px 20px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Toast ---------- */
#cc-toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 320px;
  background: var(--cc-info-bg);
  border: 1px solid var(--cc-info-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--cc-text);
  box-shadow: 0 6px 16px rgba(15,42,74,0.12);
  z-index: 10001;
  align-items: center;
  gap: 10px;
}

#cc-toast.cc-show {
  display: flex;
  animation: cc-toast-in 0.25s ease, cc-toast-out 0.25s ease 2.4s forwards;
}

@keyframes cc-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cc-toast-out { to { opacity: 0; transform: translateY(8px); } }

#cc-toast svg { flex-shrink: 0; width: 16px; height: 16px; color: #2563eb; }

@media (prefers-reduced-motion: reduce) {
  #cc-banner, #cc-modal, #cc-toast { animation: none !important; opacity: 1 !important; transform: none !important; }
}

@media (max-width: 480px) {
  #cc-banner { right: 12px; left: 12px; bottom: 12px; }
  #cc-toast { left: 12px; right: 12px; max-width: none; }
}