/* =========================================================
   Cookie Consent — prefixed pn-consent-
   ========================================================= */

/* Reset scoped styles to avoid global button/a/p/div/footer pollution */
.pn-consent-banner,
.pn-consent-banner *,
.pn-consent-modal,
.pn-consent-modal * {
  box-sizing: border-box;
}

/* ---------- Banner ---------- */
.pn-consent-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 900px;
  z-index: 10000;
  background: rgba(13, 18, 32, 0.97);
  border: 1px solid rgba(139, 120, 255, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 20px;
  color: #eef1fb;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.pn-consent-banner[hidden] {
  display: none !important;
}

.pn-consent-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pn-consent-banner-title {
  flex: 1 1 260px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.pn-consent-banner-text {
  flex: 1 1 260px;
  margin: 0;
  color: #c4cce6;
}

.pn-consent-banner-text a {
  color: #c4cce6;
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 204, 230, 0.35);
}

.pn-consent-banner-text a:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.pn-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pn-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.pn-consent-btn:active {
  transform: translateY(1px);
}

.pn-consent-btn-primary {
  background: linear-gradient(120deg, #4f7cff 0%, #7c5cff 48%, #a855f7 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(79, 124, 255, 0.35);
}

.pn-consent-btn-primary:hover {
  box-shadow: 0 14px 30px rgba(79, 124, 255, 0.45);
}

.pn-consent-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #eef1fb;
  border-color: rgba(150, 170, 255, 0.35);
}

.pn-consent-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(150, 170, 255, 0.6);
}

.pn-consent-btn-ghost {
  background: transparent;
  color: #c4cce6;
  border-color: transparent;
  padding: 0 10px;
}

.pn-consent-btn-ghost:hover {
  color: #ffffff;
}

/* ---------- Modal ---------- */
.pn-consent-modal[hidden] {
  display: none !important;
}

.pn-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pn-consent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 14, 0.75);
  backdrop-filter: blur(4px);
}

.pn-consent-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: rgba(13, 18, 32, 0.97);
  border: 1px solid rgba(139, 120, 255, 0.35);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  padding: 22px;
  color: #eef1fb;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.pn-consent-modal-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.pn-consent-modal p {
  margin: 0 0 14px;
  color: #c4cce6;
}

.pn-consent-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(150, 170, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
}

.pn-consent-option span {
  color: #eef1fb;
}

.pn-consent-option small {
  color: #8794b5;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

/* Toggle switch */
.pn-consent-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.pn-consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pn-consent-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(150, 170, 255, 0.25);
  transition: background .15s ease;
}

.pn-consent-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef1fb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform .15s ease;
}

.pn-consent-toggle input:checked + .pn-consent-toggle-track {
  background: linear-gradient(120deg, #4f7cff 0%, #7c5cff 48%, #a855f7 100%);
}

.pn-consent-toggle input:checked + .pn-consent-toggle-track + .pn-consent-toggle-thumb {
  transform: translateX(20px);
}

.pn-consent-toggle input:disabled + .pn-consent-toggle-track {
  opacity: 0.55;
  cursor: not-allowed;
}

.pn-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
}

/* ---------- Footer links scoped override ---------- */
.pn-consent-footer-link {
  color: #8794b5;
  text-decoration: none;
  border-bottom: 1px solid rgba(135, 148, 181, 0.35);
  transition: color .15s ease, border-color .15s ease;
}

.pn-consent-footer-link:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .pn-consent-banner {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 16px;
    border-radius: 16px;
  }

  .pn-consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .pn-consent-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pn-consent-btn {
    width: 100%;
    height: 44px;
    justify-content: center;
  }

  .pn-consent-modal-dialog {
    padding: 18px;
    border-radius: 18px;
  }
}
