/**
 * ============================================
 * COOKIES LGPD - ESTILO CONSOLIDADO
 * ============================================
 */

/* ================================
   🔒 Banner de Cookies
   ================================ */
#cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg,
      rgba(30, 39, 46, 0.685) 0%,
      rgba(20, 25, 30, 0.781) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  padding: 25px 30px;
  z-index: 10000;
  display: none;
  border-radius: 0;
  width: 100%;
  box-sizing: border-box;
  animation: slideUp 0.4s ease;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-banner-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  position: relative;
  z-index: 1;
}

#cookie-consent::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.2) 50%,
      transparent 100%);
  pointer-events: none;
}

#cookie-consent.show {
  display: flex;
}

.cookie-banner-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.cookie-banner-header {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.cookie-banner-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cookie-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

#cookie-consent h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 5px 0;
  color: #ffffff;
}

#cookie-consent p {
  font-size: 0.9rem;
  color: #dfe6e9;
  line-height: 1.6;
  margin: 0;
}

#cookie-consent p a {
  color: #3ac6ff;
  text-decoration: underline;
  font-weight: 500;
}

#cookie-consent p a:hover {
  color: #ffffff !important;
}

.politicas-links {
  font-size: 0.85rem;
  color: #dfe6e9;
  margin-top: 5px;
}

.politicas-links a {
  color: #3ac6ff;
  text-decoration: underline;
  font-weight: 500;
}

.politicas-links a:hover {
  color: #ffffff !important;
}

#cookie-buttons {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
  align-self: flex-end;
}

/* Alinhado a rcs-button.css — banner e modal de preferências */
#cookie-consent .reject-btn,
#cookie-consent .accept-btn,
#cookie-modal .reject-btn,
#cookie-modal .accept-btn {
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 132px;
  line-height: 1.35;
}

#cookie-consent .reject-btn,
#cookie-modal .reject-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

#cookie-consent .reject-btn:hover,
#cookie-modal .reject-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

#cookie-consent .accept-btn,
#cookie-modal .accept-btn {
  background: linear-gradient(318deg, #1dd1a1 25%, #54a0ff 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(123, 47, 255, 0.3);
}

#cookie-consent .accept-btn:hover,
#cookie-modal .accept-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47, 113, 255, 0.4);
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ================================
   ⚙️ Modal de Preferências
   ================================ */
#cookie-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 100000;
  animation: fadeIn 0.4s ease;
}

.cookie-modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 30px;
  width: 95%;
  max-width: 480px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cookie-modal-content h3 {
  margin-bottom: 10px;
  font-size: 20px;
  color: #1a1a1a;
}

.cookie-modal-content p {
  color: #444;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Modal de preferências — tema escuro (site em data-theme=dark) */
html[data-theme="dark"] .cookie-modal-overlay {
  background: rgba(0, 0, 0, 0.75);
}

html[data-theme="dark"] .cookie-modal-content {
  background: #1a2230;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .cookie-modal-content h3 {
  color: #f1f5f9;
}

html[data-theme="dark"] .cookie-modal-content p,
html[data-theme="dark"] .cookie-category p {
  color: #b8c5d6;
}

html[data-theme="dark"] .cookie-category label {
  color: #e2e8f0;
}

.cookie-category {
  margin-bottom: 15px;
}

.cookie-category label {
  font-weight: 600;
  font-size: 15px;
  color: #000;
}

.cookie-category p {
  margin-left: 24px;
  margin-top: 4px;
  font-size: 13px;
  color: #555;
}

.cookie-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ================================
   🔘 Botão Flutuante
   ================================ */
#cookie-toggle {
  position: fixed;
  left: 20px;
  bottom: 25px;
  width: 55px;
  height: 55px;
  background: linear-gradient(318deg, #1dd1a1 25%, #54a0ff 100%);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0px 0px 15px 2px rgb(47 174 255 / 66%);
  z-index: 9998;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

/* Só mostra o botão se não estiver com classe hidden E o banner não estiver visível */
#cookie-toggle:not(.hidden) {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#cookie-toggle.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#cookie-toggle:hover {
  transform: scale(1.1);
}

#cookie-toggle img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

/* Ocultar botão quando banner estiver visível - usando múltiplos seletores */
body:has(#cookie-consent.show) #cookie-toggle,
#cookie-consent.show~#cookie-toggle,
#cookie-consent[style*="flex"]~#cookie-toggle {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ================================
   📋 Modal LGPD
   ================================ */
.modal-lgpd-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: Arial, sans-serif;
}

.modal-lgpd-box {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  max-width: 475px;
  width: 90%;
  box-shadow: 0 0 20px rgba(123, 47, 255, 0.2);
  position: relative;
  color: black;
  text-align: left;
}

.modal-lgpd-logo {
  text-align: center;
  margin: 0 auto 20px auto;
}

.modal-lgpd-logo img {
  height: 65px;
  position: relative;
  left: -20px;
}

.modal-lgpd-logo-dark {
  display: none;
}

html[data-theme="dark"] .modal-lgpd-logo .modal-lgpd-logo-light {
  display: none;
}

html[data-theme="dark"] .modal-lgpd-logo .modal-lgpd-logo-dark {
  display: inline-block;
}

/* Páginas com um único logo no HTML: inverte no escuro */
html[data-theme="dark"] .modal-lgpd-logo img:only-child {
  filter: brightness(0) invert(1);
}

.modal-lgpd-label {
  font-size: 0.9rem;
  color: #5c6370;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.modal-lgpd-title {
  text-align: center;
  margin-bottom: 30px;
  background: linear-gradient(318deg, #1dd1a1 25%, #54a0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-lgpd-text {
  font-size: 14px;
  color: #2b2b2b;
  margin-top: 10px;
  text-align: left;
}

.modal-lgpd-options {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.modal-lgpd-options label {
  flex: 1;
  background: #e5e5e5;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-lgpd-options label input {
  flex-shrink: 0;
}

.modal-lgpd-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #7b2fff;
  color: #000;
  background: #e5e5e5;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.modal-lgpd-input::placeholder {
  color: #999;
}

.modal-lgpd-input:focus {
  outline: none;
  border: 1px solid #7b2fff;
  background: #f3f3f3;
  box-shadow: 0 4px 12px rgba(123, 47, 255, 0.3);
}

.modal-lgpd-error {
  color: #ff6b6b;
  font-size: 13px;
  display: none;
  margin-bottom: 10px;
}

.modal-lgpd-message {
  margin-top: 15px;
  display: none;
  font-size: 14px;
  padding: 10px;
  border-radius: 6px;
}

.modal-lgpd-buttons {
  text-align: right;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-lgpd-cancel {
  background: #636e72;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.modal-lgpd-cancel:hover {
  background: #555;
}

.modal-lgpd-submit {
  background: linear-gradient(318deg, #1dd1a1 25%, #54a0ff 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(123, 47, 255, 0.3);
  transition: all 0.3s ease;
}

.modal-lgpd-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47, 130, 255, 0.4);
}

/* Opt-out / LGPD — tema escuro */
html[data-theme="dark"] .modal-lgpd-overlay {
  background: rgba(0, 0, 0, 0.78);
}

html[data-theme="dark"] .modal-lgpd-box {
  background: #151b26;
  border: 1px solid rgba(84, 160, 255, 0.18);
  color: #e8ecf1;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .modal-lgpd-text {
  color: #b8c5d6;
}

html[data-theme="dark"] .modal-lgpd-label {
  color: #94a3b8;
}

html[data-theme="dark"] .modal-lgpd-options label {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .modal-lgpd-input {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(123, 47, 255, 0.65);
  color: #f1f5f9;
}

html[data-theme="dark"] .modal-lgpd-input::placeholder {
  color: #8899aa;
}

html[data-theme="dark"] .modal-lgpd-input:focus {
  background: rgba(0, 0, 0, 0.45);
  border-color: #54a0ff;
  box-shadow: 0 4px 16px rgba(84, 160, 255, 0.25);
}

html[data-theme="dark"] .modal-lgpd-error {
  color: #ff8787;
}

/* ================================
   📱 Responsividade
   ================================ */
@media (max-width: 768px) {
  #cookie-consent {
    padding: 20px;
  }

  .cookie-banner-container {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .cookie-banner-content {
    flex-direction: row;
    width: 100%;
    gap: 15px;
  }

  .cookie-banner-text {
    flex: 1;
  }

  .cookie-icon {
    width: 40px;
    height: 40px;
  }

  #cookie-consent h4 {
    font-size: 1.1rem;
  }

  #cookie-buttons {
    width: 100%;
    justify-content: stretch;
    align-self: stretch;
  }

  .reject-btn,
  .accept-btn {
    flex: 1;
  }

  .cookie-modal-content {
    padding: 30px 25px;
  }

  .modal-lgpd-box {
    padding: 40px 25px;
  }

  .modal-lgpd-options {
    flex-direction: column;
    gap: 12px;
  }

  .modal-lgpd-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .modal-lgpd-box {
    padding: 20px;
    width: 95%;
  }

  .modal-lgpd-logo img {
    height: 55px;
    left: 0;
  }

  .modal-lgpd-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  #cookie-toggle {
    width: 42px;
    height: 42px;
    bottom: 15px;
    left: 15px;
  }

  #cookie-toggle img {
    width: 22px;
    height: 22px;
  }
}