/* =========================================================
   BANNER DE COOKIES
========================================================= */

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  background: rgb(255 255 255 / 48%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 -8px 32px rgba(0, 45, 71, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  z-index: 10000;
  padding: 24px 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.cookie-icon {
  flex-shrink: 0;
}

.cookie-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.cookie-text {
  flex: 1;
}

.cookie-text h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.2px;
}

.cookie-text p {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.cookie-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cookie-text a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.politicas-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.politicas-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.politicas-links a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

#cookie-buttons {
  display: flex;
  gap: 12px;
}

.reject-btn,
.accept-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.reject-btn {
  background: #f3f4f6;
  color: #4b5563;
}

.reject-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.accept-btn {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 45, 71, 0.2);
}

.accept-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 45, 71, 0.3);
  filter: brightness(1.05);
}

.accept-btn:active {
  transform: translateY(0);
}

/* Botão flutuante para reabrir */
.cookie-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 45, 71, 0.3);
  z-index: 9999;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

.cookie-toggle-btn.show,
.cookie-toggle-btn.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.cookie-toggle-btn.closed {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.cookie-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 45, 71, 0.4);
}

.cookie-toggle-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 50%;
}

/* =========================================================
   MODAL LGPD
========================================================= */

.modal-lgpd-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-lgpd-overlay.show {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.modal-lgpd-box {
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 50%, #f0f4ff 100%);
  border-radius: 24px;
  max-width: 600px !important;
  width: 100%;
  max-height: 90vh;
  height: auto;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 45, 71, 0.4), 0 0 0 1px rgba(0, 45, 71, 0.1);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-gerenciar-cookies {
  max-height: 90vh !important;
  height: 90vh !important;
}

.modal-lgpd-box > *:not(.modal-lgpd-box-content) {
  flex-shrink: 0;
}

.modal-lgpd-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--primary-light),
    var(--primary)
  );
  border-radius: 24px 24px 0 0;
}

.modal-lgpd-overlay.show .modal-lgpd-box {
  transform: scale(1) translateY(0);
}

.modal-lgpd-box-content {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(0, 45, 71, 0.1);
  min-height: 0 !important;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}

.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-title,
.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-text,
.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-label,
.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-options,
.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-input,
.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-error,
.modal-lgpd-box:not(.modal-gerenciar-cookies) .modal-lgpd-message {
  padding-left: 28px;
  padding-right: 28px;
}

.modal-lgpd-box:not(.modal-gerenciar-cookies) {
  display: flex;
  flex-direction: column;
}

.modal-lgpd-box:not(.modal-gerenciar-cookies) > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 0;
}

.modal-lgpd-box-content::-webkit-scrollbar {
  width: 8px;
}

.modal-lgpd-box-content::-webkit-scrollbar-track {
  background: rgba(0, 45, 71, 0.05);
  border-radius: 4px;
  margin: 8px 0;
}

.modal-lgpd-box-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  border-radius: 4px;
}

.modal-lgpd-box-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* Garantir scroll no modal de gerenciar cookies */
.modal-gerenciar-cookies .modal-lgpd-box-content::-webkit-scrollbar {
  width: 10px;
}

.modal-gerenciar-cookies .modal-lgpd-box-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  border-radius: 5px;
}

.modal-lgpd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 28px 0;
  border-bottom: 1px solid rgba(0, 45, 71, 0.1);
  padding-bottom: 24px;
  margin-bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 250, 255, 0.9) 100%
  );
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.modal-lgpd-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-lgpd-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.modal-lgpd-logo-text {
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.modal-lgpd-close {
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #4b5563;
}

.modal-lgpd-close:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.modal-lgpd-title {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 16px 0;
  padding: 0 28px;
  letter-spacing: -0.4px;
}

.modal-lgpd-text {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
  margin: 0 0 28px 0;
  padding: 0 28px;
}

.modal-lgpd-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  padding: 0 28px;
}

.modal-lgpd-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 28px;
  margin-bottom: 24px;
}

.modal-lgpd-options label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 16px;
  border: 1px solid rgba(0, 45, 71, 0.15);
  border-radius: 12px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
}

.modal-lgpd-options label:hover {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(0, 45, 71, 0.03) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 45, 71, 0.1);
}

.modal-lgpd-options input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.modal-lgpd-options span {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.modal-lgpd-input {
  width: calc(100% - 56px);
  padding: 14px 18px;
  border: 1px solid rgba(0, 45, 71, 0.2);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  margin: 0 28px 8px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.modal-lgpd-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 45, 71, 0.1), 0 4px 12px rgba(0, 45, 71, 0.15);
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.modal-lgpd-error {
  display: none;
  color: #dc2626;
  font-size: 12px;
  margin: 0 28px 12px;
  font-weight: 500;
}

.modal-lgpd-error.show {
  display: block;
}

.modal-lgpd-message {
  padding: 14px 20px;
  margin: 0 28px 24px;
  border-radius: 12px;
  font-size: 14px;
  display: none;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.modal-lgpd-message.success {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.modal-lgpd-message.error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.modal-lgpd-buttons {
  display: flex;
  gap: 12px;
  padding: 24px 28px 28px;
  justify-content: flex-end;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 250, 255, 0.9) 100%
  );
  border-top: 1px solid rgba(0, 45, 71, 0.1);
  position: sticky;
  bottom: 0;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  z-index: 10;
}

.modal-lgpd-cancel,
.modal-lgpd-submit {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.modal-lgpd-cancel {
  background: #f3f4f6;
  color: #4b5563;
}

.modal-lgpd-cancel:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.modal-lgpd-submit {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 45, 71, 0.2);
}

.modal-lgpd-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 45, 71, 0.3);
  filter: brightness(1.05);
}

.modal-lgpd-submit:active {
  transform: translateY(0);
}

/* =========================================================
   MODAL GERENCIAR COOKIES
========================================================= */

.modal-gerenciar-cookies {
  max-width: 700px;
  width: calc(100% - 40px) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 90vh !important;
  box-sizing: border-box;
}

.modal-gerenciar-cookies .modal-lgpd-header {
  flex-shrink: 0 !important;
}

.modal-gerenciar-cookies .modal-lgpd-buttons {
  flex-shrink: 0 !important;
  margin-top: 0 !important;
}

.modal-gerenciar-cookies .modal-lgpd-box-content {
  padding: 28px 0 0 0;
  flex: 1 1 auto !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  max-height: none !important;
  -webkit-overflow-scrolling: touch;
  position: relative;
  will-change: scroll-position;
}

.modal-gerenciar-cookies .modal-lgpd-title {
  padding: 0 28px;
}

.modal-gerenciar-cookies .modal-lgpd-text {
  padding: 0 28px;
}

.cookie-categorias {
  padding: 0 28px 28px;
  margin-bottom: 0;
  overflow: visible;
}

.cookie-categoria {
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid rgba(0, 45, 71, 0.15);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(249, 250, 255, 0.7) 100%
  );
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cookie-categoria::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-categoria:hover {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 250, 255, 0.95) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 45, 71, 0.15);
}

.cookie-categoria:hover::before {
  opacity: 1;
}

.cookie-categoria-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.cookie-categoria-header h3 {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px 0;
  letter-spacing: -0.2px;
}

.cookie-categoria-header p {
  font-size: 13px;
  color: #5b6475;
  line-height: 1.6;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 26px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle-switch input:checked + .cookie-slider {
  background-color: var(--primary);
}

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

.cookie-toggle-switch input:disabled + .cookie-slider {
  background-color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Mensagem temporária LGPD */
.mensagem-lgpd {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  z-index: 10002;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 720px) {
  .cookie-consent {
    padding: 20px 0;
  }

  .cookie-content {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
  }

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

  .cookie-text h4 {
    font-size: 16px;
  }

  .cookie-text p {
    font-size: 13px;
  }

  .cookie-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .politicas-links {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .politicas-links a {
    font-size: 13px;
  }

  #cookie-buttons {
    width: 100%;
    display: flex;
    gap: 10px;
  }

  .reject-btn,
  .accept-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 13px;
  }

  .cookie-toggle-btn {
    width: 50px;
    height: 50px;
    bottom: 15px;
    left: 15px;
  }

  .cookie-toggle-btn img {
    width: 28px;
    height: 28px;
  }

  .modal-lgpd-overlay {
    padding: 10px;
  }

  .modal-lgpd-box {
    margin: 0;
    max-height: 95vh;
    border-radius: 20px;
  }

  .modal-gerenciar-cookies {
    max-height: 95vh !important;
  }

  .modal-lgpd-header {
    padding: 20px 20px 0;
    padding-bottom: 20px;
  }

  .modal-lgpd-logo img {
    width: 36px;
    height: 36px;
  }

  .modal-lgpd-logo-text {
    font-size: 18px;
  }

  .modal-lgpd-title {
    font-size: 22px;
    padding: 0 20px;
    margin-bottom: 12px;
  }

  .modal-lgpd-text {
    font-size: 13px;
    padding: 0 20px;
    margin-bottom: 20px;
  }

  .modal-lgpd-label {
    padding: 0 20px;
    margin-bottom: 12px;
  }

  .modal-lgpd-options {
    padding: 0 20px;
    margin-bottom: 20px;
    gap: 10px;
  }

  .modal-lgpd-options label {
    padding: 14px;
  }

  .modal-lgpd-input {
    width: calc(100% - 40px);
    margin: 0 20px 8px;
    padding: 12px 16px;
  }

  .modal-lgpd-error {
    margin: 0 20px 12px;
    font-size: 11px;
  }

  .modal-lgpd-message {
    margin: 0 20px 20px;
    padding: 12px 16px;
    font-size: 13px;
  }

  .modal-lgpd-buttons {
    padding: 20px;
    flex-direction: column;
    gap: 10px;
  }

  .modal-lgpd-cancel,
  .modal-lgpd-submit {
    width: 100%;
    padding: 14px 24px;
  }

  .modal-gerenciar-cookies .modal-lgpd-title {
    padding: 0 20px;
  }

  .modal-gerenciar-cookies .modal-lgpd-text {
    padding: 0 20px;
  }

  .cookie-categorias {
    padding: 0 20px 20px;
  }

  .cookie-categoria {
    padding: 20px;
    margin-bottom: 12px;
  }

  .cookie-categoria-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .cookie-categoria-header h3 {
    font-size: 16px;
  }

  .cookie-categoria-header p {
    font-size: 12px;
  }

  .cookie-toggle-switch {
    width: 44px;
    height: 24px;
  }

  .cookie-slider:before {
    height: 18px;
    width: 18px;
  }

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

  .mensagem-lgpd {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    padding: 14px 20px;
    font-size: 13px;
  }
}
