/* ============================================================
   VortqAI — Cookie Consent System
   Premium SaaS · LGPD Compliant
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --cc-bg:        rgba(11, 18, 34, 0.97);
  --cc-border:    rgba(255,255,255,0.08);
  --cc-blue:      #3B5BFF;
  --cc-cyan:      #22D3EE;
  --cc-white:     #F8FAFC;
  --cc-muted:     #94A3B8;
  --cc-muted2:    #64748B;
  --cc-radius:    16px;
  --cc-radius-sm: 10px;
  --cc-shadow:    0 32px 80px rgba(0,0,0,0.6), 0 8px 32px rgba(0,0,0,0.35);
  --cc-gradient:  linear-gradient(135deg, #3B5BFF 0%, #22D3EE 100%);
  --cc-ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --cc-spring:    cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ══════════════════════════════════════════════════════════════
   BANNER
   ══════════════════════════════════════════════════════════════ */

#cc-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 48px));
  width: calc(100% - 48px);
  max-width: 960px;
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.55s var(--cc-spring),
    opacity   0.4s  var(--cc-ease);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#cc-banner.cc-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cc-banner-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px 18px 20px;
  background: var(--cc-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--cc-border);
  border-top: 1px solid rgba(255,255,255,0.11);
  border-radius: var(--cc-radius);
  box-shadow:
    var(--cc-shadow),
    0 0 0 1px rgba(59,91,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Icon */
.cc-banner-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(59,91,255,0.1);
  border: 1px solid rgba(59,91,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93C5FD;
}

/* Text block */
.cc-banner-text {
  flex: 1;
  min-width: 0;
}

.cc-banner-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--cc-white);
  letter-spacing: -.01em;
  margin: 0 0 3px;
  line-height: 1.35;
}

.cc-banner-desc {
  font-size: .78rem;
  color: var(--cc-muted);
  line-height: 1.55;
  margin: 0;
}

.cc-banner-desc a {
  color: #7EB3FF;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(126,179,255,0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}
.cc-banner-desc a:hover {
  color: var(--cc-cyan);
  text-decoration-color: rgba(34,211,238,0.5);
}

/* Buttons group */
.cc-banner-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */

.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background    0.2s var(--cc-ease),
    border-color  0.2s var(--cc-ease),
    color         0.2s var(--cc-ease),
    transform     0.18s var(--cc-ease),
    box-shadow    0.2s var(--cc-ease);
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: .01em;
  line-height: 1;
  padding: 9px 16px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.cc-btn:focus-visible {
  outline: 2px solid rgba(59,91,255,0.6);
  outline-offset: 2px;
}

/* Ghost — "Configurar" */
.cc-btn-ghost {
  background: transparent;
  color: var(--cc-muted);
  border-color: rgba(255,255,255,0.1);
}
.cc-btn-ghost:hover {
  color: var(--cc-white);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}

/* Secondary — "Apenas essenciais" */
.cc-btn-secondary {
  background: rgba(255,255,255,0.07);
  color: #CBD5E1;
  border-color: rgba(255,255,255,0.11);
}
.cc-btn-secondary:hover {
  background: rgba(255,255,255,0.11);
  color: var(--cc-white);
  border-color: rgba(255,255,255,0.2);
}

/* Primary — "Aceitar todos" */
.cc-btn-primary {
  background: var(--cc-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 14px rgba(59,91,255,0.38);
  padding: 9px 18px;
}
.cc-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 22px rgba(59,91,255,0.55);
}
.cc-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(59,91,255,0.3);
}

/* ══════════════════════════════════════════════════════════════
   OVERLAY
   ══════════════════════════════════════════════════════════════ */

#cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.72);
  backdrop-filter: blur(6px) saturate(150%);
  -webkit-backdrop-filter: blur(6px) saturate(150%);
  z-index: 9991;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--cc-ease);
}
#cc-overlay.cc-overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */

#cc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: calc(100% - 48px);
  max-width: 500px;
  max-height: 90vh;
  z-index: 9992;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity   0.3s var(--cc-ease),
    transform 0.38s var(--cc-spring);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  border-radius: var(--cc-radius);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
#cc-modal::-webkit-scrollbar        { width: 4px; }
#cc-modal::-webkit-scrollbar-track  { background: transparent; }
#cc-modal::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.1); border-radius: 4px; }

#cc-modal.cc-modal-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.cc-modal-inner {
  background: rgba(13, 20, 38, 0.99);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.09);
  border-top: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--cc-radius);
  box-shadow:
    var(--cc-shadow),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}

/* ── Modal header ─────────────────────────────────────────── */
.cc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}

.cc-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cc-white);
  letter-spacing: -.015em;
  margin: 0 0 5px;
  line-height: 1.3;
}
.cc-modal-subtitle {
  font-size: .78rem;
  color: var(--cc-muted);
  line-height: 1.55;
  margin: 0;
}

.cc-modal-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--cc-muted2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
  margin-top: 1px;
}
.cc-modal-close:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: var(--cc-white);
}
.cc-modal-close:focus-visible {
  outline: 2px solid rgba(59,91,255,0.55);
  outline-offset: 2px;
}

/* ── Categories list ─────────────────────────────────────── */
.cc-categories {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: var(--cc-radius-sm);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.cc-category:hover {
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.055);
}

.cc-category-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

/* Category icon */
.cc-category-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.cc-icon-essential     { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: #6EE7B7; }
.cc-icon-analytics     { background: rgba(59,91,255,.12);  border: 1px solid rgba(59,91,255,.25);  color: #93C5FD; }
.cc-icon-marketing     { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.22); color: #FCD34D; }
.cc-icon-functionality { background: rgba(139,92,246,.1);  border: 1px solid rgba(139,92,246,.22); color: #C4B5FD; }

/* Category text */
.cc-category-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--cc-white);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  line-height: 1.35;
}
.cc-always-on {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6EE7B7;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.2;
}

.cc-category-desc {
  font-size: .76rem;
  color: var(--cc-muted2);
  line-height: 1.6;
  margin: 0;
}

/* ── Toggle switch ───────────────────────────────────────── */
.cc-toggle-wrap {
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  display: inline-block;
  margin-top: 3px;
  -webkit-tap-highlight-color: transparent;
}

.cc-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cc-toggle-track {
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.11);
  position: relative;
  transition: background 0.25s var(--cc-ease), border-color 0.25s var(--cc-ease), box-shadow 0.2s;
}

.cc-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition:
    transform  0.28s var(--cc-spring),
    background 0.25s var(--cc-ease),
    box-shadow 0.2s;
}

/* Checked state */
.cc-toggle-input:checked ~ .cc-toggle-track {
  background: var(--cc-gradient);
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(59,91,255,0.12);
}
.cc-toggle-input:checked ~ .cc-toggle-track .cc-toggle-thumb {
  transform: translateX(18px);
  background: #fff;
  box-shadow: 0 2px 8px rgba(59,91,255,0.45);
}

/* Focus ring */
.cc-toggle-wrap:focus-within .cc-toggle-track {
  box-shadow: 0 0 0 3px rgba(59,91,255,0.35);
}

/* Hover glow */
.cc-toggle-wrap:hover .cc-toggle-track {
  border-color: rgba(255,255,255,0.2);
}
.cc-toggle-wrap:hover .cc-toggle-input:checked ~ .cc-toggle-track {
  box-shadow: 0 0 0 3px rgba(59,91,255,0.2);
}

/* Disabled state (Essential) */
.cc-toggle-disabled {
  cursor: not-allowed;
}
.cc-toggle-disabled .cc-toggle-track {
  background: rgba(16,185,129,0.22);
  border-color: rgba(16,185,129,0.3);
  cursor: not-allowed;
}
.cc-toggle-disabled .cc-toggle-input:checked ~ .cc-toggle-track .cc-toggle-thumb {
  background: #A7F3D0;
  box-shadow: none;
}
.cc-toggle-disabled:hover .cc-toggle-track {
  border-color: rgba(16,185,129,0.3);
  box-shadow: none;
}

/* ── Modal footer ─────────────────────────────────────────── */
.cc-modal-footer {
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(255,255,255,0.055);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cc-modal-footer-note {
  font-size: .72rem;
  color: var(--cc-muted2);
  margin: 0;
}

.cc-modal-footer-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.cc-btn-save {
  padding: 10px 20px;
  font-size: .82rem;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVIDADE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  #cc-banner {
    bottom: 16px;
    width: calc(100% - 24px);
  }
  .cc-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 16px 14px;
  }
  .cc-banner-icon { display: none; }
  .cc-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 7px;
  }
  #cc-accept-all {
    grid-column: 1 / -1;
    order: -1;
  }
  .cc-btn { padding: 10px 14px; font-size: .8rem; }
}

@media (max-width: 480px) {
  #cc-modal { width: calc(100% - 20px); max-height: 88vh; }
  .cc-modal-header { padding: 18px 16px 14px; }
  .cc-categories { padding: 10px 10px; }
  .cc-category { padding: 11px 10px; gap: 10px; }
  .cc-modal-footer { flex-direction: column; align-items: stretch; padding: 12px 16px 16px; }
  .cc-modal-footer-note { text-align: center; }
  .cc-modal-footer-actions { flex-direction: column; }
  .cc-btn-save { width: 100%; }
  .cc-category-desc { font-size: .74rem; }
  .cc-banner-title { font-size: .88rem; }
  .cc-banner-desc  { font-size: .75rem; }
}
