/* CrewSync.Ltd — GDPR / UK GDPR cookie consent (glassmorphism) */

.gdpr-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.gdpr-card {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: 760px;
  padding: 24px 26px 22px;
  border-radius: 22px;
  color: #f8fafc;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.14) 0%, rgba(147, 51, 234, 0.12) 100%),
    rgba(12, 20, 48, 0.42);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 24px 60px rgba(2, 6, 23, 0.55),
    0 0 40px rgba(41, 152, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.2,.8,.2,1);
}

/* soft light sheen across the glass */
.gdpr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 38%);
  pointer-events: none;
}

.gdpr-wrap.is-visible .gdpr-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gdpr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.gdpr-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.gdpr-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.gdpr-text {
  position: relative;
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.gdpr-text a { color: #38bdf8; }

.gdpr-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.gdpr-actions .btn { padding: 10px 20px; font-size: 0.9rem; }

.gdpr-btn-glass {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}
.gdpr-btn-glass:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(56, 189, 248, 0.7);
}

/* Preferences panel */
.gdpr-prefs {
  position: relative;
  display: none;
  margin: 4px 0 16px;
  gap: 10px;
}
.gdpr-card.show-prefs .gdpr-prefs { display: grid; }

.gdpr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.gdpr-row strong { display: block; font-size: 0.92rem; }
.gdpr-row span { display: block; font-size: 0.8rem; color: #94a3b8; }

/* Toggle switch */
.gdpr-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}
.gdpr-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.gdpr-switch input:disabled { cursor: not-allowed; }
.gdpr-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease;
}
.gdpr-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.2s ease;
}
.gdpr-switch input:checked + .gdpr-slider {
  background: linear-gradient(90deg, #38bdf8, #7c3aed);
}
.gdpr-switch input:checked + .gdpr-slider::after { transform: translateX(20px); }
.gdpr-switch input:disabled + .gdpr-slider { opacity: 0.6; }
.gdpr-switch input:focus-visible + .gdpr-slider { outline: 2px solid #38bdf8; outline-offset: 2px; }

.gdpr-only-prefs { display: none; }
.gdpr-card.show-prefs .gdpr-only-prefs { display: inline-flex; }
.gdpr-card.show-prefs .gdpr-hide-in-prefs { display: none; }

/* Fallback when backdrop-filter is unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gdpr-card { background: rgba(9, 15, 36, 0.95); }
}

@media (max-width: 560px) {
  .gdpr-wrap { padding: 12px; }
  .gdpr-card { padding: 20px 18px 18px; border-radius: 18px; }
  .gdpr-actions { justify-content: stretch; }
  .gdpr-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .gdpr-card { transition: none; }
}
