/* ------------------------------------------------------------------
   Aflu Cookie Consent Banner
   - Bottom slide-up, brand-aligned
   - GDPR/CCPA: equal-weight Accept All / Reject All + Customize
   - Necessary toggle locked on
   ------------------------------------------------------------------ */

#aflu-cookie-banner,
#aflu-cookie-settings-btn {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--ink, #1a1530);
  box-sizing: border-box;
}
#aflu-cookie-banner *,
#aflu-cookie-banner *::before,
#aflu-cookie-banner *::after {
  box-sizing: border-box;
}

/* Banner shell */
#aflu-cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 880px;
  margin: 0 auto;
  background: #ffffff;
  border: 1.5px solid rgba(124, 63, 255, 0.25);
  border-radius: 16px;
  box-shadow: 0 18px 50px -12px rgba(20, 12, 50, 0.28),
              0 4px 14px -4px rgba(20, 12, 50, 0.12);
  padding: 1.25rem 1.5rem;
  z-index: 999998;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 280ms ease-out;
  visibility: hidden;
}
#aflu-cookie-banner[data-state="open"] {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
#aflu-cookie-banner[data-mode="custom"] {
  max-width: 560px;
}

/* Default summary view */
.afcc__summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: center;
}
@media (max-width: 720px) {
  .afcc__summary { grid-template-columns: 1fr; }
}
.afcc__title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink, #1a1530);
  margin: 0 0 0.25rem 0;
}
.afcc__copy {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted, #5b5670);
  margin: 0;
}
.afcc__copy a {
  color: var(--accent, #7C3FFF);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.afcc__copy a:hover { text-decoration-thickness: 1.5px; }

/* Action row */
.afcc__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .afcc__actions { justify-content: stretch; }
  .afcc__actions > * { flex: 1 1 auto; }
}

.afcc-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
  white-space: nowrap;
  text-align: center;
}
.afcc-btn:focus-visible {
  outline: 2px solid var(--accent, #7C3FFF);
  outline-offset: 2px;
}
.afcc-btn--primary {
  background: var(--accent, #7C3FFF);
  color: #ffffff;
  border-color: var(--accent, #7C3FFF);
}
.afcc-btn--primary:hover { background: #6a2dee; border-color: #6a2dee; }
.afcc-btn--outline {
  background: #ffffff;
  color: var(--ink, #1a1530);
  border-color: rgba(20, 12, 50, 0.22);
}
.afcc-btn--outline:hover { border-color: rgba(20, 12, 50, 0.45); }
.afcc-btn--text {
  background: transparent;
  color: var(--text-muted, #5b5670);
  border-color: transparent;
  padding: 0.6rem 0.75rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.afcc-btn--text:hover { color: var(--accent, #7C3FFF); }

/* Customize panel */
.afcc__custom {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(124, 63, 255, 0.25);
}
#aflu-cookie-banner[data-mode="custom"] .afcc__custom { display: block; }
#aflu-cookie-banner[data-mode="custom"] .afcc__actions .afcc-btn--text { display: none; }

.afcc__cats {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0 0 1rem 0;
  padding: 0;
  list-style: none;
}
.afcc__cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
}
.afcc__cat-meta { min-width: 0; }
.afcc__cat-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink, #1a1530);
  margin: 0 0 0.2rem 0;
}
.afcc__cat-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted, #5b5670);
  margin: 0;
}

/* iOS-style toggle */
.afcc__toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.afcc__toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%; height: 100%;
  margin: 0;
}
.afcc__toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(20, 12, 50, 0.18);
  border-radius: 999px;
  transition: background 180ms ease-out;
}
.afcc__toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(20, 12, 50, 0.25);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.afcc__toggle input:checked ~ .afcc__toggle-track { background: var(--accent, #7C3FFF); }
.afcc__toggle input:checked ~ .afcc__toggle-knob { transform: translateX(18px); }
.afcc__toggle input:disabled { cursor: not-allowed; }
.afcc__toggle input:disabled:checked ~ .afcc__toggle-track { background: rgba(124, 63, 255, 0.5); }
.afcc__toggle input:focus-visible ~ .afcc__toggle-track {
  outline: 2px solid var(--accent, #7C3FFF);
  outline-offset: 2px;
}

.afcc__custom-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .afcc__custom-actions { justify-content: stretch; }
  .afcc__custom-actions > * { flex: 1 1 auto; }
}

/* Floating reopen button (after dismissal) */
#aflu-cookie-settings-btn {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 999997;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(124, 63, 255, 0.3);
  box-shadow: 0 4px 14px -4px rgba(20, 12, 50, 0.2);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--accent, #7C3FFF);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}
#aflu-cookie-settings-btn[data-visible="true"] { display: flex; }
#aflu-cookie-settings-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -6px rgba(20, 12, 50, 0.28);
}
#aflu-cookie-settings-btn:focus-visible {
  outline: 2px solid var(--accent, #7C3FFF);
  outline-offset: 3px;
}
#aflu-cookie-settings-btn svg { display: block; }
