/* ============================================================
   COOKIE CONSENT — PayDay Portal by Gratuity Solutions
   Granular consent banner + preferences modal + reopen control.
   Brand-compliant (Plus Jakarta Sans), dark-mode aware, responsive.
   Paired with js/cookie-consent.js. No external dependencies.
   ============================================================ */

:root {
  --pdp-cc-blue: #234282;
  --pdp-cc-blue-2: #4F689B;
  --pdp-cc-red: #E40C56;
  --pdp-cc-pink: #ED5589;
  --pdp-cc-light-blue: #EEF5FF;
  --pdp-cc-ink: #0F172A;
  --pdp-cc-muted: #5b6470;
  --pdp-cc-border: #D7D7D7;
  --pdp-cc-surface: #FFFFFF;
  --pdp-cc-surface-2: #F6F6F6;
  --pdp-cc-shadow: 0 -6px 32px rgba(15, 23, 42, 0.16);
  --pdp-cc-shadow-modal: 0 24px 60px rgba(15, 23, 42, 0.28);
  --pdp-cc-radius: 16px;
  --pdp-cc-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[data-theme="dark"] {
  --pdp-cc-ink: #E8EDF5;
  --pdp-cc-muted: #a9b3c2;
  --pdp-cc-border: #2c3950;
  --pdp-cc-surface: #16203a;
  --pdp-cc-surface-2: #1d2a47;
  --pdp-cc-light-blue: #1d2a47;
  --pdp-cc-shadow: 0 -6px 32px rgba(0, 0, 0, 0.5);
  --pdp-cc-shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* ---------- shared ---------- */
.pdp-cc,
.pdp-cc * {
  box-sizing: border-box;
}
.pdp-cc {
  font-family: var(--pdp-cc-font);
  color: var(--pdp-cc-ink);
  -webkit-font-smoothing: antialiased;
}
.pdp-cc[hidden] { display: none !important; }

/* ---------- banner ---------- */
.pdp-cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  background: var(--pdp-cc-surface);
  border: 1px solid var(--pdp-cc-border);
  border-radius: var(--pdp-cc-radius);
  box-shadow: var(--pdp-cc-shadow);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  animation: pdp-cc-rise 0.32s ease;
}
@keyframes pdp-cc-rise {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pdp-cc-banner, .pdp-cc-modal-card { animation: none; }
}

.pdp-cc-banner-body { flex: 1 1 auto; min-width: 0; }
.pdp-cc-banner-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.pdp-cc-banner-title .pdp-cc-dots { display: inline-flex; gap: 4px; }
.pdp-cc-banner-title .pdp-cc-dots i {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
.pdp-cc-banner-title .pdp-cc-dots i:nth-child(1) { background: var(--pdp-cc-red); }
.pdp-cc-banner-title .pdp-cc-dots i:nth-child(2) { background: var(--pdp-cc-blue); }
.pdp-cc-banner-title .pdp-cc-dots i:nth-child(3) { background: var(--pdp-cc-blue-2); }

.pdp-cc-banner-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--pdp-cc-muted);
  margin: 0;
}
.pdp-cc-banner-text a {
  color: var(--pdp-cc-blue);
  font-weight: 600;
  text-decoration: underline;
}
html[data-theme="dark"] .pdp-cc-banner-text a { color: var(--pdp-cc-pink); }

.pdp-cc-banner-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- buttons ---------- */
.pdp-cc-btn {
  font-family: var(--pdp-cc-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
.pdp-cc-btn:active { transform: translateY(1px); }
.pdp-cc-btn:focus-visible {
  outline: 3px solid var(--pdp-cc-pink);
  outline-offset: 2px;
}
.pdp-cc-btn-accept { background: var(--pdp-cc-red); color: #fff; }
.pdp-cc-btn-accept:hover { filter: brightness(1.08); }
.pdp-cc-btn-reject { background: var(--pdp-cc-blue); color: #fff; }
.pdp-cc-btn-reject:hover { filter: brightness(1.12); }
.pdp-cc-btn-ghost {
  background: transparent;
  color: var(--pdp-cc-blue);
  border-color: var(--pdp-cc-border);
}
html[data-theme="dark"] .pdp-cc-btn-ghost { color: var(--pdp-cc-ink); }
.pdp-cc-btn-ghost:hover { background: var(--pdp-cc-light-blue); }

/* ---------- modal ---------- */
.pdp-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.pdp-cc-modal-card {
  background: var(--pdp-cc-surface);
  border-radius: 20px;
  box-shadow: var(--pdp-cc-shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pdp-cc-pop 0.28s ease;
}
@keyframes pdp-cc-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.pdp-cc-modal-head {
  padding: 24px 26px 14px;
  border-bottom: 1px solid var(--pdp-cc-border);
}
.pdp-cc-modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.pdp-cc-modal-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--pdp-cc-muted);
  margin: 0;
}
.pdp-cc-modal-body {
  padding: 8px 26px;
  overflow-y: auto;
}

/* ---------- category rows ---------- */
.pdp-cc-cat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--pdp-cc-border);
}
.pdp-cc-cat:last-child { border-bottom: none; }
.pdp-cc-cat-info { flex: 1 1 auto; }
.pdp-cc-cat-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 3px;
}
.pdp-cc-cat-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pdp-cc-muted);
  margin: 0;
}

/* toggle switch */
.pdp-cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}
.pdp-cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.pdp-cc-slider {
  position: absolute;
  inset: 0;
  background: var(--pdp-cc-border);
  border-radius: 999px;
  transition: background 0.18s ease;
  pointer-events: none;
}
.pdp-cc-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.pdp-cc-switch input:checked + .pdp-cc-slider { background: var(--pdp-cc-red); }
.pdp-cc-switch input:checked + .pdp-cc-slider::before { transform: translateX(20px); }
.pdp-cc-switch input:focus-visible + .pdp-cc-slider {
  outline: 3px solid var(--pdp-cc-pink);
  outline-offset: 2px;
}
.pdp-cc-switch input:disabled + .pdp-cc-slider {
  background: var(--pdp-cc-blue-2);
  opacity: 0.7;
  cursor: not-allowed;
}
.pdp-cc-cat-locked {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pdp-cc-blue-2);
  align-self: center;
  flex: 0 0 auto;
}

/* ---------- modal footer ---------- */
.pdp-cc-modal-foot {
  padding: 16px 26px 22px;
  border-top: 1px solid var(--pdp-cc-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.pdp-cc-modal-foot .pdp-cc-btn { flex: 1 1 auto; min-width: 130px; }

/* ---------- reopen floating control ---------- */
.pdp-cc-reopen {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 2147482999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--pdp-cc-border);
  background: var(--pdp-cc-surface);
  color: var(--pdp-cc-blue);
  box-shadow: 0 6px 20px rgba(15,23,42,0.18);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.pdp-cc-reopen:hover { filter: brightness(0.97); transform: scale(1.05); }
.pdp-cc-reopen:focus-visible { outline: 3px solid var(--pdp-cc-pink); outline-offset: 2px; }
html[data-theme="dark"] .pdp-cc-reopen { color: var(--pdp-cc-pink); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .pdp-cc-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }
  .pdp-cc-banner-actions { width: 100%; }
  .pdp-cc-banner-actions .pdp-cc-btn { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 520px) {
  .pdp-cc-banner { left: 10px; right: 10px; bottom: 10px; }
  .pdp-cc-banner-actions { flex-direction: column; }
  .pdp-cc-modal-foot { flex-direction: column-reverse; }
  .pdp-cc-modal-foot .pdp-cc-btn { width: 100%; }
}
