/**
 * Cookie Consent Banner & Preferences Modal
 * Compliant with Italian Garante per la Protezione dei Dati Personali (10 Giugno 2021) & ePrivacy
 * Strict Palette & Accessibility WCAG AA Compliant
 */

/* Banner Container */
.pk-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 980px;
  margin: 0 auto;
  background: #070F1E;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(2, 132, 199, 0.15);
  padding: 24px 28px;
  z-index: 999999;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s;
}

.pk-cookie-banner.is-active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.pk-cookie-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.pk-cookie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pk-cookie-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pk-cookie-title-wrap svg {
  color: #FFD000;
  flex-shrink: 0;
}

.pk-cookie-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.pk-cookie-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pk-cookie-close-btn:hover,
.pk-cookie-close-btn:focus-visible {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid #0284C7;
}

.pk-cookie-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #CBD5E1;
  margin: 0;
}

.pk-cookie-desc a {
  color: #38BDF8;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.pk-cookie-desc a:hover {
  color: #FFD000;
}

/* Action Buttons */
.pk-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 6px;
}

.pk-cookie-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  line-height: 1.2;
}

/* Primary Accept */
.pk-cookie-btn--accept {
  background: #0284C7;
  color: #FFFFFF;
  border: 1px solid #0284C7;
}

.pk-cookie-btn--accept:hover,
.pk-cookie-btn--accept:focus-visible {
  background: #0369A1;
  border-color: #0369A1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

/* Equal Dignity Reject (Garante Privacy Compliant) */
.pk-cookie-btn--reject {
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.pk-cookie-btn--reject:hover,
.pk-cookie-btn--reject:focus-visible {
  background: #334155;
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Secondary Customize */
.pk-cookie-btn--customize {
  background: transparent;
  color: #CBD5E1;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.pk-cookie-btn--customize:hover,
.pk-cookie-btn--customize:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Modal Overlay */
.pk-cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 15, 30, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.pk-cookie-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.pk-cookie-modal {
  background: #0B1E38;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pk-cookie-modal-backdrop.is-active .pk-cookie-modal {
  transform: scale(1);
}

.pk-cookie-modal-head {
  padding: 22px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pk-cookie-modal-head h3 {
  font-family: 'Syne', sans-serif;
  font-size: 19px;
  font-weight: 800;
  margin: 0;
  color: #FFFFFF;
}

.pk-cookie-modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pk-cookie-modal-intro {
  font-size: 13.5px;
  line-height: 1.6;
  color: #CBD5E1;
  margin: 0;
}

/* Category Cards */
.pk-cookie-cat-card {
  background: #070F1E;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 18px;
}

.pk-cookie-cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.pk-cookie-cat-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pk-cookie-cat-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 9999px;
}

.pk-cookie-cat-badge--required {
  background: rgba(2, 132, 199, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(2, 132, 199, 0.35);
}

.pk-cookie-cat-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: #94A3B8;
  margin: 0;
}

/* iOS / Tailwind Style Toggle Switch */
.pk-cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.pk-cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 24px;
}

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

.pk-cookie-switch input:checked + .pk-cookie-slider {
  background-color: #0284C7;
}

.pk-cookie-switch input:focus-visible + .pk-cookie-slider {
  box-shadow: 0 0 0 2px #FFD000;
}

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

.pk-cookie-switch input:disabled + .pk-cookie-slider {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #0284C7;
}

/* Modal Footer */
.pk-cookie-modal-foot {
  padding: 18px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(7, 15, 30, 0.4);
}

@media (max-width: 640px) {
  .pk-cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 18px;
  }
  .pk-cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .pk-cookie-btn {
    width: 100%;
  }
  .pk-cookie-modal-foot {
    flex-direction: column-reverse;
  }
  .pk-cookie-modal-foot .pk-cookie-btn {
    width: 100%;
  }
}
