/* ==========================================================================
   GDC SACCO Society Limited — Compulsory Cookie Consent Gate
   Version: 1.0.0
   ========================================================================== */

:root {
  --gdc-cc-green: #146334;
  --gdc-cc-green-dark: #0c4222;
  --gdc-cc-green-hover: #0f522b;
  --gdc-cc-green-soft: #edf7f0;
  --gdc-cc-gold: #c6922c;
  --gdc-cc-gold-hover: #b28020;
  --gdc-cc-text: #1e293b;
  --gdc-cc-muted: #475569;
  --gdc-cc-border: #d8e2dc;
  --gdc-cc-white: #ffffff;
}

/* Lock scroll while compulsory gate is active */
html.gdc-cc-locked,
body.gdc-cc-locked {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none !important;
}

/* Fullscreen blocking overlay */
#gdc-cookie-consent-overlay {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 2147483640 !important;
  background: rgba(8, 30, 17, 0.78) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif !important;
  box-sizing: border-box !important;
}

#gdc-cookie-consent-overlay.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#gdc-cookie-consent-overlay *,
#gdc-cookie-consent-overlay *::before,
#gdc-cookie-consent-overlay *::after {
  box-sizing: border-box !important;
}

/* Modal Card */
.gdc-cc-modal {
  background: var(--gdc-cc-white) !important;
  color: var(--gdc-cc-text) !important;
  width: 100% !important;
  max-width: 600px !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s ease;
}

#gdc-cookie-consent-overlay.is-visible .gdc-cc-modal {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.gdc-cc-header {
  background: linear-gradient(135deg, var(--gdc-cc-green-dark) 0%, var(--gdc-cc-green) 100%) !important;
  color: var(--gdc-cc-white) !important;
  padding: 22px 26px 20px !important;
  border-bottom: 4px solid var(--gdc-cc-gold) !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

.gdc-cc-header-left {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
}

.gdc-cc-icon {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fde68a !important;
}

.gdc-cc-badge {
  display: inline-block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: #fde68a !important;
  margin-bottom: 4px !important;
}

.gdc-cc-title {
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  color: var(--gdc-cc-white) !important;
}

.gdc-cc-close-btn {
  appearance: none !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: var(--gdc-cc-white) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 8px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Only show close button when re-opened after consent is already saved */
#gdc-cookie-consent-overlay.is-reopen .gdc-cc-close-btn {
  display: inline-flex !important;
}

.gdc-cc-close-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

/* Modal Body */
.gdc-cc-body {
  padding: 22px 26px 24px !important;
}

.gdc-cc-text {
  margin: 0 0 14px !important;
  font-size: 14.5px !important;
  line-height: 1.6 !important;
  color: var(--gdc-cc-text) !important;
}

.gdc-cc-notice {
  background: var(--gdc-cc-green-soft) !important;
  border: 1px solid #cce6d5 !important;
  border-left: 4px solid var(--gdc-cc-green) !important;
  border-radius: 8px !important;
  padding: 11px 14px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--gdc-cc-green-dark) !important;
  margin-bottom: 16px !important;
}

/* Policy Links Row */
.gdc-cc-links {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 16px !important;
  margin-bottom: 18px !important;
  font-size: 13px !important;
}

.gdc-cc-links a {
  color: var(--gdc-cc-green) !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.gdc-cc-links a:hover {
  color: var(--gdc-cc-green-dark) !important;
}

/* Preferences Accordion */
.gdc-cc-prefs {
  display: none !important;
  border: 1px solid var(--gdc-cc-border) !important;
  border-radius: 10px !important;
  margin-bottom: 18px !important;
  overflow: hidden !important;
  background: #f8fbf9 !important;
}

.gdc-cc-prefs.is-open {
  display: block !important;
}

.gdc-cc-pref-item {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 13px 16px !important;
  border-bottom: 1px solid var(--gdc-cc-border) !important;
}

.gdc-cc-pref-item:last-child {
  border-bottom: none !important;
}

.gdc-cc-pref-info strong {
  display: block !important;
  font-size: 13.5px !important;
  color: var(--gdc-cc-text) !important;
  margin-bottom: 2px !important;
}

.gdc-cc-pref-info span {
  display: block !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  color: var(--gdc-cc-muted) !important;
}

.gdc-cc-always-on {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: var(--gdc-cc-green) !important;
  background: #dcfce7 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  margin-top: 2px !important;
}

/* Toggle Switch */
.gdc-cc-switch {
  position: relative !important;
  display: inline-block !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 24px !important;
  margin-top: 2px !important;
}

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

.gdc-cc-slider {
  position: absolute !important;
  cursor: pointer !important;
  inset: 0 !important;
  background-color: #cbd5e1 !important;
  border-radius: 999px !important;
  transition: background-color 0.2s ease !important;
}

.gdc-cc-slider::before {
  position: absolute !important;
  content: "" !important;
  height: 18px !important;
  width: 18px !important;
  left: 3px !important;
  bottom: 3px !important;
  background-color: #ffffff !important;
  border-radius: 50% !important;
  transition: transform 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}

.gdc-cc-switch input:checked + .gdc-cc-slider {
  background-color: var(--gdc-cc-green) !important;
}

.gdc-cc-switch input:checked + .gdc-cc-slider::before {
  transform: translateX(20px) !important;
}

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

/* Action Buttons */
.gdc-cc-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.gdc-cc-actions-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.gdc-cc-btn {
  appearance: none !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 18px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  text-align: center !important;
  line-height: 1.25 !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease !important;
  font-family: inherit !important;
}

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

.gdc-cc-btn-primary {
  background: var(--gdc-cc-green) !important;
  color: var(--gdc-cc-white) !important;
  width: 100% !important;
  box-shadow: 0 4px 12px rgba(20, 99, 52, 0.25) !important;
}

.gdc-cc-btn-primary:hover {
  background: var(--gdc-cc-green-hover) !important;
}

.gdc-cc-btn-secondary {
  background: var(--gdc-cc-white) !important;
  color: var(--gdc-cc-green-dark) !important;
  border: 1.5px solid var(--gdc-cc-green) !important;
}

.gdc-cc-btn-secondary:hover {
  background: var(--gdc-cc-green-soft) !important;
}

.gdc-cc-btn-ghost {
  background: #f1f5f9 !important;
  color: var(--gdc-cc-text) !important;
  border: 1.5px solid #cbd5e1 !important;
}

.gdc-cc-btn-ghost:hover {
  background: #e2e8f0 !important;
}

.gdc-cc-btn-save {
  display: none !important;
  background: var(--gdc-cc-gold) !important;
  color: #141414 !important;
  width: 100% !important;
}

.gdc-cc-btn-save.is-visible {
  display: block !important;
}

.gdc-cc-btn-save:hover {
  background: var(--gdc-cc-gold-hover) !important;
}

.gdc-cc-footer-note {
  margin: 14px 0 0 !important;
  font-size: 11.5px !important;
  color: #64748b !important;
  text-align: center !important;
}

/* Floating Re-open Cookie Settings Pill */
#gdc-cookie-settings-fab {
  position: fixed !important;
  left: 16px !important;
  bottom: 16px !important;
  z-index: 2147483000 !important;
  background: var(--gdc-cc-green-dark) !important;
  color: var(--gdc-cc-white) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 999px !important;
  padding: 9px 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  cursor: pointer !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22) !important;
  transition: background 0.15s ease, transform 0.15s ease !important;
}

#gdc-cookie-settings-fab:hover {
  background: var(--gdc-cc-green) !important;
  transform: translateY(-1px);
}

#gdc-cookie-settings-fab.is-hidden {
  display: none !important;
}

/* Membership Form Consent Shortcode Styling */
.gdc-member-consent-box {
  background: #f0fdf4;
  border: 1.5px solid #146334;
  border-radius: 8px;
  padding: 16px 18px;
  margin: 16px 0;
  font-family: inherit;
}

.gdc-member-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
}

.gdc-member-consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: #146334;
  cursor: pointer;
}

.gdc-member-consent-sub {
  margin: 8px 0 0 28px;
  font-size: 12.5px;
  color: #475569;
}

.gdc-member-consent-sub a {
  color: #146334;
  font-weight: 600;
  text-decoration: underline;
}

@media (max-width: 560px) {
  .gdc-cc-header {
    padding: 18px 18px 16px !important;
  }
  .gdc-cc-body {
    padding: 18px !important;
  }
  .gdc-cc-title {
    font-size: 18px !important;
  }
  .gdc-cc-actions-row {
    grid-template-columns: 1fr !important;
  }
}
