/* Estilos do Sistema de Consentimento LGPD & Cookies — CoreHA */

/* Banner de Consentimento */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 480px;
  background: rgba(14, 20, 28, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  animation: slideUp 0.35s ease-out forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cookie-icon {
  font-size: 1.4rem;
}

.cookie-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.cookie-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.cookie-text a {
  color: var(--accent-emerald);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cookie-btn-accept {
  background: var(--accent-emerald);
  color: #04140e;
}

.cookie-btn-accept:hover {
  background: #059669;
}

.cookie-btn-reject {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.cookie-btn-reject:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.cookie-btn-prefs {
  background: transparent;
  color: var(--accent-cyan);
  border-color: transparent;
  text-decoration: underline;
}

/* Modal de Preferências Granulares */
.cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.cookie-category {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.category-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  font-family: 'JetBrains Mono', monospace;
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Switch Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-subtle);
  transition: .3s;
  border-radius: 24px;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-toggle {
  background-color: var(--accent-emerald);
}

input:checked + .slider-toggle:before {
  transform: translateX(20px);
}

input:disabled + .slider-toggle {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Botão Flutuante de Gerenciar Privacidade (Sempre acessível no canto) */
.privacy-badge-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999;
  background: rgba(14, 20, 28, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.privacy-badge-trigger:hover {
  color: var(--text-main);
  border-color: var(--accent-emerald);
  background: var(--bg-card);
}

/* Mobile Friendly Cookies */
@media (max-width: 600px) {
  .cookie-banner {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    padding: 18px 14px;
    border-radius: var(--radius-sm);
  }
  .cookie-actions {
    flex-direction: column;
    gap: 8px;
  }
  .cookie-btn {
    width: 100%;
    text-align: center;
    padding: 10px 14px;
  }
  .cookie-modal {
    padding: 20px 16px;
  }
  .privacy-badge-trigger {
    bottom: 12px;
    left: 12px;
    font-size: 0.72rem;
    padding: 4px 10px;
  }
}

