/* Pixelcraft — professional cookie consent (GDPR / Personopplysningsloven) */

.pc-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.pc-cookie-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pc-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.33, 0, 0.2, 1), opacity 0.35s ease;
}

.pc-cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.pc-cookie-banner__card {
  max-width: 52rem;
  margin: 0 auto;
  border-radius: 1.25rem;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(30, 27, 75, 0.94));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 1.35rem 1.35rem 1.15rem;
}

@media (min-width: 768px) {
  .pc-cookie-banner__card {
    padding: 1.5rem 1.65rem 1.35rem;
  }
}

.pc-cookie-banner__head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.pc-cookie-banner__icon {
  flex-shrink: 0;
}

.pc-cookie-category__name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.pc-cookie-category__icon {
  margin: 0;
}

.pc-cookie-banner__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-space-grotesk, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.pc-cookie-banner__lead {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #94a3b8;
}

.pc-cookie-banner__lead a {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pc-cookie-banner__lead a:hover {
  color: #c7d2fe;
}

.pc-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.pc-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.65rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.pc-cookie-btn:active {
  transform: scale(0.98);
}

.pc-cookie-btn--ghost {
  background: rgba(51, 65, 85, 0.45);
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.pc-cookie-btn--ghost:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(148, 163, 184, 0.45);
}

.pc-cookie-btn--primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: rgba(129, 140, 248, 0.5);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.pc-cookie-btn--primary:hover {
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.pc-cookie-btn--outline {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.pc-cookie-btn--outline:hover {
  border-color: rgba(165, 180, 252, 0.55);
  color: #f1f5f9;
}

/* Settings modal */
.pc-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pc-cookie-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pc-cookie-modal__dialog {
  width: min(100%, 34rem);
  max-height: min(88vh, 40rem);
  overflow: auto;
  border-radius: 1.15rem;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: #0f172a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  padding: 1.25rem 1.25rem 1rem;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s ease;
}

.pc-cookie-modal.is-visible .pc-cookie-modal__dialog {
  transform: translateY(0) scale(1);
}

.pc-cookie-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pc-cookie-modal__header h2 {
  margin: 0;
  font-family: var(--font-space-grotesk, system-ui, sans-serif);
  font-size: 1.05rem;
  color: #f8fafc;
}

.pc-cookie-modal__close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.55rem;
  background: rgba(51, 65, 85, 0.55);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.pc-cookie-modal__close:hover {
  background: rgba(71, 85, 105, 0.75);
}

.pc-cookie-category {
  border: 1px solid rgba(51, 65, 85, 0.85);
  border-radius: 0.85rem;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.65rem;
  background: rgba(15, 23, 42, 0.65);
}

.pc-cookie-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pc-cookie-category__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.pc-cookie-category__desc {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #94a3b8;
}

.pc-cookie-category__badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

/* Toggle switch */
.pc-cookie-switch {
  position: relative;
  width: 2.65rem;
  height: 1.45rem;
  flex-shrink: 0;
}

.pc-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pc-cookie-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #334155;
  border: 1px solid rgba(148, 163, 184, 0.25);
  cursor: pointer;
  transition: background 0.2s;
}

.pc-cookie-switch input:checked + .pc-cookie-switch__track {
  background: #4f46e5;
  border-color: #818cf8;
}

.pc-cookie-switch input:disabled + .pc-cookie-switch__track {
  opacity: 0.65;
  cursor: not-allowed;
}

.pc-cookie-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  pointer-events: none;
}

.pc-cookie-switch input:checked ~ .pc-cookie-switch__thumb {
  transform: translateX(1.15rem);
}

.pc-cookie-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(51, 65, 85, 0.85);
}

.pc-cookie-modal__legal {
  margin: 0 0 0.75rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #64748b;
}

.pc-cookie-modal__legal a {
  color: #a5b4fc;
}

html.pc-light .pc-cookie-banner__card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 255, 0.96));
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

html.pc-light .pc-cookie-banner__title,
html.pc-light .pc-cookie-modal__header h2,
html.pc-light .pc-cookie-category__name {
  color: #0f172a;
}

html.pc-light .pc-cookie-banner__lead,
html.pc-light .pc-cookie-category__desc {
  color: #475569;
}

html.pc-light .pc-cookie-modal__dialog {
  background: #fff;
  border-color: rgba(99, 102, 241, 0.2);
}

html.pc-light .pc-cookie-category {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html.pc-light .pc-cookie-btn--ghost {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

html.pc-light .pc-cookie-overlay {
  background: rgba(15, 23, 42, 0.35);
}
