/* ==========================================================================
   QUIETMETRIC // Cookie & Privacy Consent Banner
   Position: Bottom-Left Corner
   Aesthetics: Deep Precision Slate, Glassmorphism, Warm Orange Accents
   ========================================================================== */

.qm-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  background: rgba(16, 23, 29, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(235, 94, 40, 0.18),
              0 0 30px rgba(235, 94, 40, 0.08);
  z-index: 99998;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #edf2f7;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.qm-cookie-banner.closing {
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
}

/* Header Row */
.qm-cookie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.qm-cookie-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(235, 94, 40, 0.22) 0%, rgba(235, 94, 40, 0.06) 100%);
  border: 1px solid rgba(235, 94, 40, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eb5e28;
  flex-shrink: 0;
}

.qm-cookie-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 0;
}

.qm-cookie-eyebrow {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #eb5e28;
  line-height: 1.1;
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace, sans-serif;
}

.qm-cookie-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.qm-cookie-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Body description */
.qm-cookie-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: #94a3b8;
  margin-bottom: 16px;
}

.qm-cookie-link {
  color: #eb5e28;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.qm-cookie-link:hover {
  color: #f06d37;
}

/* Granular Preferences Box */
.qm-cookie-preferences {
  display: none;
  background: rgba(9, 14, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  flex-direction: column;
  gap: 10px;
  animation: qmPrefFade 0.2s ease;
}

.qm-cookie-preferences.open {
  display: flex;
}

@keyframes qmPrefFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.qm-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.qm-pref-info {
  display: flex;
  flex-direction: column;
}

.qm-pref-name {
  color: #ffffff;
  font-weight: 600;
}

.qm-pref-desc {
  font-size: 11px;
  color: #64748b;
}

.qm-pref-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
}

.qm-pref-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.qm-pref-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #25333f;
  transition: 0.2s ease;
  border-radius: 20px;
}

.qm-pref-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
}

.qm-pref-switch input:checked + .qm-pref-slider {
  background-color: #eb5e28;
}

.qm-pref-switch input:disabled + .qm-pref-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.qm-pref-switch input:checked + .qm-pref-slider:before {
  transform: translateX(14px);
}

/* Button Actions */
.qm-cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qm-cookie-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qm-cookie-btn-accept {
  flex: 1;
  background: #eb5e28;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(235, 94, 40, 0.35);
  transition: all 0.15s ease;
  text-align: center;
}

.qm-cookie-btn-accept:hover {
  background: #f06d37;
  box-shadow: 0 6px 18px rgba(235, 94, 40, 0.5);
  transform: translateY(-1px);
}

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

.qm-cookie-btn-decline {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.qm-cookie-btn-decline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.qm-cookie-toggle-pref {
  background: transparent;
  border: none;
  color: #718096;
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px;
  text-align: center;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.qm-cookie-toggle-pref:hover {
  color: #cbd5e1;
}

/* Floating re-open pill (optional if user wants to change choices later) */
.qm-cookie-reopen-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99997;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18, 26, 33, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #eb5e28;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.qm-cookie-reopen-trigger:hover {
  transform: scale(1.1);
  color: #f06d37;
  background: rgba(25, 36, 46, 0.95);
}

.qm-cookie-reopen-trigger.visible {
  display: flex;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .qm-cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    padding: 18px 16px;
  }
  .qm-cookie-btn-row {
    flex-direction: column;
  }
  .qm-cookie-reopen-trigger {
    bottom: 16px;
    left: 16px;
  }
}
