/*
 * ============================================================
 *  FORMIDIUM COOKIE CONSENT — REFERENCE STYLESHEET
 *  Use this file verbatim across all Formidium websites.
 *
 *  Covers:
 *    1. Top-fixed consent banner
 *    2. Three action buttons (Preferences / Decline All / Accept All)
 *    3. Preferences modal overlay
 *    4. Per-category toggle switches
 *    5. Mobile responsive rules
 *
 *  Brand tokens used:
 *    Denim  #176feb   — section labels, toggle-on, modal top border
 *    Onyx   #1d2125   — Accept All button fill, Decline All border
 *    Zircon #0fb7f8   — hover accent
 *    Granite #646668  — muted / sub text, Preferences ghost button
 *
 *  Fonts required in host page:
 *    Poppins  (headings, button labels)
 *    Open Sans (body copy)
 * ============================================================
 */


/* ── 1. MAIN BANNER ─────────────────────────────────────────
   Fixed to bottom of viewport, white background, subtle shadow.
   Sits above all page content via z-index 99999.
   ---------------------------------------------------------- */
#csd-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  font-family: 'Open Sans', sans-serif;
}

.csd-cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.csd-cookie-text {
  flex: 1;
}

.csd-cookie-text p {
  margin: 0;
  font-size: 12px;
  color: #444444;
  line-height: 1.6;
}

.csd-cookie-text a {
  color: #176feb;          /* Denim */
  text-decoration: underline;
}
.csd-cookie-text a:hover { color: #0fb7f8; }  /* Zircon */

.csd-cookie-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}


/* ── 2. BUTTONS ─────────────────────────────────────────────
   Three buttons always appear in this order:
     [Preferences]  [Decline All]  [Accept All]
   ---------------------------------------------------------- */
.csd-btn-accept,
.csd-btn-decline,
.csd-btn-pref {
  padding: 9px 20px;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

/* Accept All — dark filled (Onyx), turns Denim on hover */
.csd-btn-accept {
  background: #1d2125;     /* Onyx */
  color: #ffffff;
  border: 2px solid #1d2125;
}
.csd-btn-accept:hover {
  background: #176feb;     /* Denim */
  border-color: #176feb;
}

/* Decline All — outlined Onyx, light fill on hover */
.csd-btn-decline {
  background: transparent;
  color: #1d2125;
  border: 2px solid #1d2125;
}
.csd-btn-decline:hover {
  background: #f5f5f5;
}

/* Preferences — ghost / text link style, no border */
.csd-btn-pref {
  background: transparent;
  color: #646668;          /* Granite */
  border: 2px solid transparent;
  padding-left: 4px;
  padding-right: 4px;
}
.csd-btn-pref:hover {
  color: #176feb;
  text-decoration: underline;
}


/* ── 3. PREFERENCES MODAL OVERLAY ──────────────────────────
   Full-screen dimmed overlay, modal centred.
   Modal has a Denim top-border accent (4px).
   z-index 100000 so it renders above the banner.
   ---------------------------------------------------------- */
.csd-pref-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(29, 33, 37, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.csd-pref-box {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border-top: 4px solid #176feb;  /* Denim accent */
}

.csd-pref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.csd-pref-header strong {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1d2125;
}

.csd-pref-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #646668;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.csd-pref-close:hover { color: #176feb; background: #f0f6ff; }

.csd-pref-body { padding: 8px 24px; }


/* ── 4. PREFERENCE ROWS (one per cookie category) ──────────
   Each row: [label + description]  [toggle switch]
   Three rows by default:
     Necessary  (always locked ON)
     Analytics
     Marketing
   ---------------------------------------------------------- */
.csd-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.csd-pref-row:last-child { border-bottom: none; }

.csd-pref-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.csd-pref-label {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1d2125;
}

.csd-pref-desc {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  color: #646668;          /* Granite */
  line-height: 1.5;
}


/* ── 5. TOGGLE SWITCH ───────────────────────────────────────
   Default (off): grey pill  #cbd5e1
   On:            Denim pill #176feb
   Locked:        reduced opacity, not-allowed cursor
   ---------------------------------------------------------- */
.csd-toggle {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.csd-toggle--on     { background: #176feb; }   /* Denim */
.csd-toggle--locked { cursor: not-allowed; opacity: 0.6; }

.csd-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s;
}
.csd-toggle--on .csd-toggle-knob { left: 22px; }


/* ── 6. MODAL FOOTER ────────────────────────────────────────
   Two buttons right-aligned:
     [Save Preferences]  [Accept All]
   Uses same .csd-btn-decline / .csd-btn-accept classes.
   ---------------------------------------------------------- */
.csd-pref-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}


/* ── 7. MOBILE ──────────────────────────────────────────────
   Below 640px: banner stacks vertically, buttons wrap.
   Modal footer stacks and buttons go full-width.
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  .csd-cookie-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }
  .csd-cookie-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .csd-pref-footer {
    flex-direction: column-reverse;
  }
  .csd-pref-footer .csd-btn-accept,
  .csd-pref-footer .csd-btn-decline {
    width: 100%;
    text-align: center;
  }
}


/*
 * ============================================================
 *  USAGE INSTRUCTIONS FOR DEVELOPERS
 * ============================================================
 *
 *  1. Copy this file to your project as:
 *       css/cookie-consent.css
 *
 *  2. Copy the companion JS file (cookie-consent.js) to:
 *       js/cookie-consent.js
 *
 *  3. In every HTML page <head>, add:
 *       <link rel="stylesheet" href="css/cookie-consent.css">
 *       <script>
 *         window.CSD_TRACKING = {
 *           gaId:     'G-XXXXXXXXXX',   // Google Analytics 4 ID (required)
 *           hubspot:  true,             // true = load HubSpot after consent
 *           zoominfo: false,            // true = load ZoomInfo after consent
 *           typeform: false             // true = load Typeform embed after consent
 *         };
 *       </script>
 *
 *  4. Before </body> in every HTML page, add:
 *       <script src="js/cookie-consent.js"></script>
 *
 *  HOW CONSENT WORKS
 *  -----------------
 *  First visit   → banner shown. No tracking loads.
 *  Accept All    → localStorage: csd_cookie_consent = 'accepted'
 *                  Loads: GA + HubSpot (if true) + ZoomInfo (if true) + Typeform (if true)
 *  Decline All   → localStorage: csd_cookie_consent = 'declined'
 *                  Nothing loads. HubSpot suppressed via __hs_cookie_cat_pref cookie.
 *  Preferences   → modal opens. User toggles Analytics / Marketing independently.
 *                  localStorage: csd_cookie_consent = 'custom'
 *                               csd_cookie_prefs   = {"analytics":bool,"marketing":bool}
 *  Return visit  → scripts load silently based on stored consent. Banner not shown.
 *
 *  CATEGORIES
 *  ----------
 *  Necessary  — always on, cannot be toggled (site functionality)
 *  Analytics  — controls: gaId (GA4) + zoominfo
 *  Marketing  — controls: hubspot + typeform
 *
 *  BRAND COLOURS (Formidium)
 *  -------------------------
 *  Denim   #176feb   Zircon  #0fb7f8
 *  Onyx    #1d2125   Granite #646668
 * ============================================================
 */
