/* ============================================================
   automateglobal.ca — Cookie Consent
   Design: enterprise panel inspired by Usercentrics
   Palette: brand green #0F5C3C, accent #5BC995, cream #FFF8EE
   ============================================================ */

:root {
  --cc-brand: #0F5C3C;
  --cc-brand-hover: #0a4a30;
  --cc-accent: #5BC995;
  --cc-ink: #0A0F0A;
  --cc-ink-60: #555;
  --cc-ink-40: #999;
  --cc-line: #E8E6E0;
  --cc-cream: #FFF8EE;
  --cc-radius: 8px;
  --cc-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

/* -------- Floating launcher button -------- */
.cc-launcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cc-brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(15, 92, 60, 0.35);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              background 0.3s ease;
  padding: 0;
  overflow: visible;
}
.cc-launcher:hover {
  transform: scale(1.08) rotate(-3deg);
  background: linear-gradient(135deg, #0F5C3C 0%, #184d3b 100%);
  box-shadow: 0 12px 32px rgba(91, 201, 149, 0.45),
              0 0 0 6px rgba(91, 201, 149, 0.12);
}
.cc-launcher svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cc-launcher[aria-expanded="true"] { background: var(--cc-brand-hover); }

/* -------- Backdrop + Panel -------- */
.cc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  animation: cc-fade-in 0.2s ease;
}
.cc-backdrop[data-open="true"] { display: flex; }

@keyframes cc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cc-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cc-panel {
  background: #fff;
  border-radius: var(--cc-radius);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--cc-shadow);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Figtree', Arial, sans-serif;
  color: var(--cc-ink);
  animation: cc-slide-up 0.25s ease;
}

/* First-visit banner (centered, slightly different) */
.cc-backdrop[data-mode="banner"] {
  align-items: center;
}

/* -------- Panel header -------- */
.cc-panel-head {
  padding: 24px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.cc-panel-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--cc-ink);
  letter-spacing: -0.3px;
}
.cc-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--cc-ink-60);
  padding: 4px;
  margin: -4px;
  line-height: 1;
}
.cc-close:hover { color: var(--cc-ink); }
.cc-close svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cc-panel-intro {
  padding: 14px 28px 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--cc-ink-60);
  margin: 0;
}
.cc-panel-intro a {
  color: var(--cc-brand);
  text-decoration: underline;
}

.cc-privacy-link {
  padding: 14px 28px 20px;
  font-size: 14px;
}
.cc-privacy-link a {
  color: var(--cc-brand);
  text-decoration: underline;
  font-weight: 500;
}

/* -------- Tabs -------- */
.cc-tabs {
  display: flex;
  border-bottom: 1px solid var(--cc-line);
  padding: 0 28px;
  gap: 0;
}
.cc-tab {
  flex: 1;
  padding: 14px 0 12px;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--cc-ink-60);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.cc-tab:hover { color: var(--cc-ink); }
.cc-tab[aria-selected="true"] {
  color: var(--cc-brand);
  border-bottom-color: var(--cc-brand);
  font-weight: 600;
}

/* -------- Scrollable body -------- */
.cc-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}
.cc-tabpanel { display: none; }
.cc-tabpanel[data-active="true"] { display: block; }

/* -------- Item card (both Categories and Services) -------- */
.cc-item {
  border: 1px solid var(--cc-line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.15s;
}
.cc-item:hover { border-color: #d4d2cc; }
.cc-item-content { flex: 1; min-width: 0; }
.cc-item-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--cc-ink);
}
.cc-item-sub {
  font-size: 12.5px;
  color: var(--cc-brand);
  font-weight: 500;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cc-item-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-ink-60);
  margin: 0;
}

.cc-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Expand chevron (optional details) */
.cc-expand {
  background: transparent;
  border: none;
  color: var(--cc-ink-40);
  cursor: pointer;
  padding: 4px;
}
.cc-expand svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}
.cc-item[data-expanded="true"] .cc-expand svg { transform: rotate(180deg); }
.cc-item-details {
  display: none;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px dashed var(--cc-line);
  width: 100%;
  font-size: 12.5px;
  color: var(--cc-ink-60);
  line-height: 1.5;
}
.cc-item[data-expanded="true"] .cc-item-details { display: block; }

.cc-item-details dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; }
.cc-item-details dt { color: var(--cc-ink-40); font-weight: 500; }
.cc-item-details dd { margin: 0; color: var(--cc-ink-60); }

/* -------- Toggle switch -------- */
.cc-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: #c7c5bf;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.cc-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.cc-toggle[aria-checked="true"] { background: var(--cc-brand); }
.cc-toggle[aria-checked="true"]::after { left: 22px; }
.cc-toggle[aria-disabled="true"] {
  background: #c7c5bf;
  cursor: not-allowed;
  opacity: 0.6;
}

/* -------- Footer buttons -------- */
.cc-footer {
  display: flex;
  gap: 10px;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--cc-line);
  background: #fafaf7;
  flex-wrap: wrap;
}
.cc-btn {
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  flex: 1;
  min-width: 110px;
}
.cc-btn:active { transform: scale(0.98); }
.cc-btn-secondary {
  background: transparent;
  color: var(--cc-ink);
  border: 1px solid var(--cc-line);
}
.cc-btn-secondary:hover { background: #fff; border-color: var(--cc-ink-40); }
.cc-btn-primary {
  background: var(--cc-brand);
  color: #fff;
}
.cc-btn-primary:hover { background: var(--cc-brand-hover); }
.cc-btn-deny {
  background: #fff;
  color: var(--cc-ink);
  border: 1px solid var(--cc-ink-40);
}
.cc-btn-deny:hover { background: #f5f3ee; }

.cc-footer-brand {
  text-align: center;
  font-size: 11px;
  color: var(--cc-ink-40);
  padding: 8px 28px 16px;
  background: #fafaf7;
  margin: 0;
  letter-spacing: 0.3px;
}
.cc-footer-brand a {
  color: var(--cc-ink-60);
  text-decoration: none;
}
.cc-footer-brand a:hover { text-decoration: underline; }

/* -------- Mobile -------- */
@media (max-width: 640px) {
  .cc-launcher { bottom: 18px; left: 18px; width: 56px; height: 56px; }
  .cc-launcher svg { width: 30px; height: 30px; }
  .cc-backdrop { padding: 0; align-items: flex-end !important; }
  .cc-panel {
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
  .cc-panel-head { padding: 20px 20px 0; }
  .cc-panel-title { font-size: 20px; }
  .cc-panel-intro { padding: 12px 20px 0; font-size: 14px; }
  .cc-privacy-link { padding: 12px 20px 16px; }
  .cc-tabs { padding: 0 20px; }
  .cc-body { padding: 16px 20px; }
  .cc-footer { padding: 14px 20px 18px; }
  .cc-btn { flex: 1 1 100%; }
  .cc-item { padding: 14px; gap: 12px; }
}

/* ========= Realistic fingerprint icon + scan animation ========= */
.cc-launcher .cc-fp {
  width: 36px;
  height: 36px;
  display: block;
  overflow: visible;
}
.cc-launcher .cc-fp path {
  transition: stroke 0.4s ease, filter 0.4s ease;
}
.cc-launcher .cc-fp path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}

/* Scanning beam that sweeps across when clicked */
.cc-launcher .cc-fp-scan {
  fill: none;
  stroke: #5BC995;
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0;
  transform-origin: center;
}

/* Click/scan state - triggered by JS adding .cc-scanning class */
.cc-launcher.cc-scanning .cc-fp-scan {
  animation: cc-scan-sweep 0.9s ease-out forwards;
}
.cc-launcher.cc-scanning .cc-fp path {
  animation: cc-fp-glow 0.9s ease-out;
}
.cc-launcher.cc-scanning {
  animation: cc-launcher-pulse 0.9s ease-out;
}

@keyframes cc-scan-sweep {
  0%   { opacity: 0; transform: translateY(-14px); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

@keyframes cc-fp-glow {
  0%, 100% { stroke: #ffffff; filter: none; }
  50% { stroke: #5BC995; filter: drop-shadow(0 0 6px rgba(91,201,149,0.6)); }
}

@keyframes cc-launcher-pulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(15,92,60,0.3); }
  50%      { box-shadow: 0 6px 24px rgba(91,201,149,0.5), 0 0 0 8px rgba(91,201,149,0.15); }
}

/* Idle gentle breathing (very subtle - draws eye without being annoying) */
.cc-launcher:not(.cc-scanning) .cc-fp {
  animation: cc-fp-breathe 4s ease-in-out infinite;
}
@keyframes cc-fp-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.88; }
}

/* Hover emphasizes the fingerprint */
.cc-launcher:hover .cc-fp path {
  stroke: #ffffff;
  opacity: 1;
}


/* ========= Rainbow hover animation on fingerprint ========= */
@keyframes cc-fp-rainbow {
  0%   { stroke: #ff3b30; filter: drop-shadow(0 0 3px rgba(255, 59, 48, 0.6)); }
  14%  { stroke: #ff9500; filter: drop-shadow(0 0 3px rgba(255, 149, 0, 0.6)); }
  28%  { stroke: #ffcc00; filter: drop-shadow(0 0 3px rgba(255, 204, 0, 0.6)); }
  42%  { stroke: #34c759; filter: drop-shadow(0 0 3px rgba(52, 199, 89, 0.6)); }
  57%  { stroke: #5ac8fa; filter: drop-shadow(0 0 3px rgba(90, 200, 250, 0.6)); }
  71%  { stroke: #007aff; filter: drop-shadow(0 0 4px rgba(0, 122, 255, 0.7)); }
  85%  { stroke: #af52de; filter: drop-shadow(0 0 4px rgba(175, 82, 222, 0.7)); }
  100% { stroke: #ff3b30; filter: drop-shadow(0 0 3px rgba(255, 59, 48, 0.6)); }
}

/* Each ridge animates at a slightly different delay so the colors travel across */
.cc-launcher:hover .cc-fp path:nth-of-type(1) {
  animation: cc-fp-rainbow 2.4s linear infinite;
  animation-delay: 0s;
}
.cc-launcher:hover .cc-fp path:nth-of-type(2) {
  animation: cc-fp-rainbow 2.4s linear infinite;
  animation-delay: -0.3s;
}
.cc-launcher:hover .cc-fp path:nth-of-type(3) {
  animation: cc-fp-rainbow 2.4s linear infinite;
  animation-delay: -0.6s;
}
.cc-launcher:hover .cc-fp path:nth-of-type(4) {
  animation: cc-fp-rainbow 2.4s linear infinite;
  animation-delay: -0.9s;
}
.cc-launcher:hover .cc-fp path:nth-of-type(5) {
  animation: cc-fp-rainbow 2.4s linear infinite;
  animation-delay: -1.2s;
}
.cc-launcher:hover .cc-fp path:nth-of-type(6),
.cc-launcher:hover .cc-fp path:nth-of-type(7),
.cc-launcher:hover .cc-fp path:nth-of-type(8) {
  animation: cc-fp-rainbow 2.4s linear infinite;
  animation-delay: -1.5s;
}

/* Soft outer aura cycles through the rainbow too, keyed to the ridges */
@keyframes cc-launcher-aura {
  0%   { box-shadow: 0 12px 32px rgba(255, 59, 48, 0.35), 0 0 0 6px rgba(255, 59, 48, 0.1); }
  25%  { box-shadow: 0 12px 32px rgba(255, 204, 0, 0.35), 0 0 0 6px rgba(255, 204, 0, 0.1); }
  50%  { box-shadow: 0 12px 32px rgba(52, 199, 89, 0.4),  0 0 0 6px rgba(52, 199, 89, 0.12); }
  75%  { box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4),  0 0 0 6px rgba(0, 122, 255, 0.12); }
  100% { box-shadow: 0 12px 32px rgba(255, 59, 48, 0.35), 0 0 0 6px rgba(255, 59, 48, 0.1); }
}
.cc-launcher:hover {
  animation: cc-launcher-aura 2.4s linear infinite;
}

/* Breathe animation stops on hover so rainbow can take over cleanly */
.cc-launcher:hover .cc-fp {
  animation: none !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cc-launcher:hover .cc-fp path,
  .cc-launcher:hover {
    animation: none !important;
  }
  .cc-launcher:hover .cc-fp path {
    stroke: #5BC995 !important;
  }
}


  14%  { fill: #ff9500; }
  28%  { fill: #ffcc00; }
  42%  { fill: #34c759; }
  57%  { fill: #5ac8fa; }
  71%  { fill: #007aff; }
  85%  { fill: #af52de; }
  100% { fill: #ff3b30; }
}
